Commit Graph
332 Commits
Author SHA1 Message Date
Bob Nystrom da4cadf16b Unify body handling.
Blocks, functions, and methods now have the same code for handling
their bodies.

This means that single-line methods work like single-line functions:
they return the result of their expression.
2014-04-03 07:48:19 -07:00
Bob Nystrom 55c2c6ffb0 Remove old function syntax. 2014-04-02 20:22:36 -07:00
Bob Nystrom d146018559 Convert all fns to block arg syntax. 2014-04-02 19:41:53 -07:00
Bob Nystrom a550d6cea4 Change how new operators are compiled.
Instead of an instruction that always instantiates an instance,
the "new" is compiled to a method call on the class, followed by a
method call on the (presumably) new instance.

The former lets built-in types like Fn do special stuff instead of
allocating an instance. In particular, it means:

  new Fn { ... }

can just return the block argument.
2014-04-02 17:42:30 -07:00
Bob Nystrom cc56ac4da7 Convert fiber tests to use block arguments. 2014-04-02 17:31:58 -07:00
Bob Nystrom dc366185bd Add support for block arguments in method calls. 2014-04-02 17:26:39 -07:00
Bob Nystrom 48a36adf4f Clean up runtime error handling.
This is prep work for being able to catch a runtime error from
another fiber.
2014-03-30 08:39:28 -07:00
Bob Nystrom 9a959c9eb9 Error if argument to new is not a class. 2014-03-06 06:51:16 -08:00
Bob Nystrom 44e68a5db9 Fix #31. Bitwise operators on numbers. 2014-02-24 07:27:43 -08:00
Bob Nystrom 161075affe Merge pull request #39 from zeckalpha/feature/methodNotFound-receiver
Include the receiver name in methodNotFound error messages.
2014-02-24 07:03:56 -08:00
Kyle Marek-Spartz df4c1fa6b2 Changed phrasing, fixed and added a test. 2014-02-23 21:53:49 -06:00
Kyle Marek-Spartz 9f05e0d045 Include the receiver name in methodNotFound error messages.
> class Foo {}
> Foo.baz
Receiver 'Foo metaclass', does not implement method 'baz'.
2014-02-22 01:20:53 -06:00
Bob Nystrom 97235caf9c Reword code size limit. 2014-02-19 07:14:46 -08:00
Bob Nystrom a3086a0306 Merge pull request #38 from zeckalpha/feature/corelib-spaces
Remove spaces before arguments in core.wren
2014-02-19 07:13:03 -08:00
Bob Nystrom 001a8fe54f Merge pull request #37 from zeckalpha/feature/docs-todos
Feature/docs todos
2014-02-19 07:12:33 -08:00
Bob Nystrom 60613c486f Merge pull request #33 from zeckalpha/feature/docs-punctuation
Punctuation choices
2014-02-19 07:10:38 -08:00
Kyle Marek-Spartz 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
Kyle Marek-Spartz 9a566e8203 Strunk would be proud. 2014-02-17 13:56:41 -06:00
Bob Nystrom b59f33fa6f Merge pull request #36 from zeckalpha/feature/docs-title-in-template
Move title to left side for when there are many tabs open.
2014-02-17 10:27:27 -08:00
Bob Nystrom 177ba58c61 Merge pull request #32 from zeckalpha/feature/docs-indentation
Change indentation to match 2 space indents seen elsewhere
2014-02-17 10:20:33 -08:00
Kyle Marek-Spartz b0e2b29e41 Move title to left side for when there are many tabs open. 2014-02-16 22:02:04 -06:00
Kyle Marek-Spartz 4eead2b611 Punctuation choices 2014-02-16 21:56:51 -06:00
Kyle Marek-Spartz 5b8b06cf52 TODO note about refactoring classes and method-calls documentation. As a user of the documentation, I found some aspects confusing about this, particularly the operator section. There should be an example of how to define custom operators on the Classes page. 2014-02-16 21:56:21 -06:00
Kyle Marek-Spartz 16756cb619 todo note about static methods 2014-02-16 21:56:14 -06:00
Kyle Marek-Spartz 7ed6922c2c Change indentation to match 2 space indents seen elsewhere 2014-02-16 21:55:03 -06:00
Bob Nystrom 6d9842b148 Merge pull request #27 from zeckalpha/feature/bitwise-operators
Make custom bitwise operators work, add tests
2014-02-16 17:43:40 -08:00
Kyle Marek-Spartz d25504eb4e Put custom bitwise operator tests into existing operators test file. 2014-02-16 19:42:49 -06:00
Bob Nystrom 681ec5aa13 Merge pull request #26 from zeckalpha/feature/docs-io
Update a bunch of `io` to `IO` in docs.
2014-02-16 17:37:45 -08:00
Kyle Marek-Spartz c43dbe96d3 Make custom bitwise operators work, add tests 2014-02-16 12:01:40 -06:00
Kyle Marek-Spartz 3f96637274 Update a bunch of io to IO in docs. 2014-02-16 11:28:56 -06:00
Bob Nystrom 719139a446 Merge branch 'master' of https://github.com/munificent/wren 2014-02-16 09:20:43 -08:00
Bob Nystrom 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
Bob Nystrom 46de1ec1ea Merge pull request #22 from zeckalpha/master
Spelling typos in docs: "rivaling", "carnival"
2014-02-16 08:51:34 -08:00
Kyle Marek-Spartz b383b78863 Spelling typos in docs: "rivaling", "carnival" 2014-02-15 17:12:18 -06:00
Bob Nystrom 4d8bf4bc8e Update benchmark to use ? and .where(). 2014-02-15 11:59:56 -08:00
Bob Nystrom e535d7a9e7 Conditional operator. 2014-02-15 11:36:01 -08:00
Bob Nystrom 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
Bob Nystrom b672be8443 Merge pull request #18 from zeckalpha/feature/list-map
Add List.map method and test
2014-02-15 09:12:04 -08:00
Kyle Marek-Spartz 3409d588e5 Added List.where method and tests. 2014-02-15 00:42:14 -06:00
Kyle Marek-Spartz 1d31c95872 Cleanups for merging map method 2014-02-15 00:34:30 -06:00
Bob Nystrom c67b239d06 Merge pull request #19 from zeckalpha/feature/c-small-fixes
Two very unimportant changes: a typo and dead code.
2014-02-14 22:22:15 -08:00
Kyle Marek-Spartz 10b335908c Two very unimportant changes: a typo and dead code. 2014-02-15 00:15:51 -06:00
Kyle Marek-Spartz 83ea5aaf45 Add List.map method and test 2014-02-14 23:06:29 -06:00
Bob Nystrom b1bae8fc6c Fix #17. 2014-02-14 20:15:49 -08:00
Bob Nystrom ea3cfa05bd Allow [0..-1] and [0...0] to work on empty lists. 2014-02-14 20:10:41 -08:00
Bob Nystrom ca7ff222fe Fix iterating over an empty list. 2014-02-14 17:24:06 -08:00
Kyle Marek-Spartz 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
Bob Nystrom edd360a934 More fiber tests. 2014-02-14 07:16:56 -08:00
Bob Nystrom ca4f4d6660 Test "this" in static methods. 2014-02-14 06:37:37 -08:00
Bob Nystrom 59bb7eec7a Remove some outdated TODOs.
They’re TODONE!
2014-02-13 08:38:44 -08:00