Commit Graph

30 Commits

Author SHA1 Message Date
ed8e595f54 Get rid of bytecodes for list literals.
Just compile them to:

new List
.add(...)
.add(...)
...

Gets rid of some code in the interpreter loop, which is always good.
Also addresses the old limitation where a list literal could only have
255 elements.
2015-01-25 22:49:30 -08:00
492c730e6f Key and value iteration for maps. Also toString. 2015-01-25 10:27:38 -08:00
abe80e6d4b Initial map implementation.
Still lots of methods missing and clean up and tests to do.
Also still no literal syntax.

But the core hash table code is there and working. The supported
key types are all, uh, supported.
2015-01-24 22:27:35 -08:00
4977083904 Abstract List's toString method to a more general join method on Sequence. 2015-01-24 14:01:16 -08:00
eb424f5c1a Make strings iterable over their code points.
I'm not sure why, but this also regresses perf:

binary_trees - wren            ..........  3290  0.30s   96.68% relative to baseline
delta_blue - wren              ..........  7948  0.13s   99.06% relative to baseline
fib - wren                     ..........  3165  0.32s   95.90% relative to baseline
for - wren                     ..........  8242  0.12s   96.00% relative to baseline
method_call - wren             ..........  5417  0.18s   78.74% relative to baseline

Need to investigate.
2015-01-22 20:58:22 -08:00
5cfb638fd1 Use @munificent's single-argument reduce 2015-01-16 09:26:19 +01:00
4c6b819ed1 Add reduce function on Sequence 2015-01-16 09:24:59 +01:00
78e99c6c99 Merge branch 'list-forall' of git://github.com/gsmaverick/wren into gsmaverick-list-forall 2015-01-15 06:52:43 -08:00
b829ce67af Rename forall to all. 2015-01-14 23:19:31 -08:00
f2b334d7d2 Add more forall test cases. 2015-01-14 22:51:34 -08:00
7716ad6263 Adds forall method on Sequences. 2015-01-13 23:47:01 -08:00
1d9445d9bc Tests for IO.read(). 2015-01-11 21:47:29 -08:00
7a7c7a8fad Merge branch 'add-read-string' of git://github.com/pwoolcoc/wren into pwoolcoc-add-read-string
Conflicts:
	builtin/io.wren
	src/wren_io.c
2015-01-11 20:05:52 -08:00
c0b0920d67 Update set example to new Syntax. Replaces #30 2015-01-09 16:02:40 -06:00
15b0d8777c Handle toString not returning a string in IO.print and IO.write.
Fix #67.
2015-01-08 07:53:37 -08:00
7ecff2d79f Implement IO.read 2015-01-04 19:54:28 -05:00
48dab5323d A few small cleanups. 2014-04-19 11:44:51 -07:00
7393e12555 Allow multiple arguments to IO.print(). 2014-04-09 07:48:35 -07:00
dca58ff747 Require parentheses around operator and setter arguments. 2014-04-08 17:54:37 -07:00
9a8f2edda4 List.addAll(). 2014-04-06 08:37:37 -07:00
9792581292 Style choice: I had been writing methods with spaces before the arguments, but that doesn't seem to be the case in the documentation. This is just to keep things consistent 2014-02-18 11:55:55 -06:00
f8a9d7f321 Make Sequence base class.
This lets us share functionality between List and Range (and
other user-defined sequence types).
2014-02-16 09:20:31 -08:00
4728687ca5 Merge branch 'feature/list-where' of git://github.com/zeckalpha/wren into zeckalpha-feature/list-where
Conflicts:
	builtin/core.wren
	src/wren_core.c
2014-02-15 11:21:24 -08:00
3409d588e5 Added List.where method and tests. 2014-02-15 00:42:14 -06:00
83ea5aaf45 Add List.map method and test 2014-02-14 23:06:29 -06:00
ea3cfa05bd Allow [0..-1] and [0...0] to work on empty lists. 2014-02-14 20:10:41 -08:00
ca7ff222fe Fix iterating over an empty list. 2014-02-14 17:24:06 -08:00
e519ecbc49 Third try. ;) Concat operator, tests. Now [1,2,3] + (4..6) works! Inlined helper functions to keep core lib small. 2014-02-14 11:16:57 -06:00
756fe0d920 Make "this" the implicit receiver! 2014-02-12 17:33:35 -08:00
36df70dba1 Move IO into a separate module. 2014-02-04 08:44:59 -08:00