Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running set example errors #266

Closed
heapwolf opened this issue May 16, 2015 · 5 comments
Closed

Running set example errors #266

heapwolf opened this issue May 16, 2015 · 5 comments

Comments

@heapwolf
Copy link

Freshly pulled from github, after running make...

./wren example/set.wren
WhereSequence does not implement '+(_)'.
[main line 91] in &(_)
[main line 110] in (script)
true
@bjorn
Copy link
Contributor

bjorn commented May 16, 2015

Hrm, I didn't notice this example when I changed Sequence.where to be lazy rather that eagerly returning the computed list, which apparently the example Set class relies on.

The example can be fixed by adding .toList() at the end of each call to where and the call to map.

@bjorn
Copy link
Contributor

bjorn commented May 16, 2015

Note that this example is now quite bad since implementing a set should be much more efficient based on the Map class instead of the List class. So while it could be fixed up to run, it probably really needs a complete rewrite.

Maybe it's something @zeckalpha would like to pick up again.

@munificent
Copy link
Member

+1 for rewriting it to use a map.

@kmarekspartz
Copy link
Contributor

Yeah, I wrote that before Maps existed. Feel free to remove the file entirely, too.

@munificent
Copy link
Member

Done!

kmarekspartz pushed a commit to kmarekspartz/wren that referenced this issue May 20, 2015
munificent added a commit that referenced this issue May 23, 2015
Run examples as tests. Would have prevented #266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants