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
Set example updated syntax #96
Set example updated syntax #96
Conversation
|
||
contains(element) { | ||
for (item in this) { | ||
if (element == item) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: how about making this a one-liner:
if (element == item) return true
I like omitting the {}
for if
(in both C and Wren) as long as the entire thing fits on one line and there's no else
clause.
Oh, yeah! I forgot all about this. I tend to go through periods where I cycle between side projects and I put Wren down for a while. I like this example. Added a few comments. As you noted, some documentation and tests for Once we get maps in the language, I think that will imply more comprehensive support for hash codes. At that point, it will probably make sense to revise this. But until then, this is groovy. |
I see you merged this, but I was still working on it! I'll have a follow-up with some tweaks soon. |
Oops! Feel free to send me your tweaks. I was maybe a little overeager to get to zero open pull requests. :) |
This is a rebase of #30, and could be part of #86.
As mentioned near the end of #30, I should be adding tests and documentation. I'm not expecting this to be merged until then; I just wanted to get the syntax caught up.