Category talk:Wren-dynamic: Difference between revisions

m
Fixed syntax highlighting.
(→‎Source code: Added 2 new methods to Enum and Flags classes. Removed redundant Flags.indexOf method.)
m (Fixed syntax highlighting.)
Line 13:
To create for example a Point tuple, one could proceed as follows:
 
<langsyntaxhighlight lang=ecmascript>import "/dynamic" for Tuple
 
var Point = Tuple.create("Point", ["x", "y"])
var p = Point.new(1, 2)
System.print([p.x, p.y, p]) // [1, 2, (1, 2)]</langsyntaxhighlight>
 
More complicated cases than these are best dealt with by manual programming as at present.
 
===Source code===
<langsyntaxhighlight lang=ecmascript>/* Module "dynamic.wren" */
 
import "meta" for Meta
Line 254:
"abcdefghijklmnopqrstuvwxyz".toList,
97
)</langsyntaxhighlight>
9,485

edits