Commit Graph

5 Commits

Author SHA1 Message Date
5418e4f8f3 Add MapEntry to core to let maps be directly iterated.
Fix #372.
2016-07-06 07:17:07 -07:00
d46dfc9500 Allow "*" on lists and strings to repeat them.
This is not implemented on Sequence because, at least for lists and
strings, I think users expect an eager result. Multiplying a string
should give you back a string, not a lazy sequence of repeated
characters.

This also mirrors "+" on strings and lists, which is eager. I like the
idea of having a general guideline that operators are eager.

Repetition is useful for arbitrary sequences, but for that maybe we
should add a "repeat()" method.
2016-02-24 07:48:03 -08:00
5bde04db4c Eagerly evaluate interpolated expressions.
If we ever support custom string templates, we'll need to go back to
compiling them to functions. But, for now, they can be evaluated
eagerly, leading to simpler code.
2015-11-23 07:08:14 -08:00
78655c68b0 Simple string interpolation.
This allows "%(...)" inside a string literal to interpolate the
stringified result of an expression.

It doesn't support custom interpolators or format strings, but we can
consider extending that later.
2015-11-11 07:55:48 -08:00
30e7d9e508 Move core.wren to be next to wren_core.wren.inc. 2015-10-17 22:17:10 -07:00