Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From a quick glance, this looks very nice and well thought-out.

The only thing that I didn't like at first glance was that closures aren't explicitly delimited:

    print( strings.where( \ s -> s.length() > 3 ).sort() )
This looks like it could get ugly very fast if you want to write any kind of non-trivial closures. (Which is some of the same criticism that python often gets, and from which one could learn).

"if", "for", "using" and all the other standard constructs use curly braces around the code - why not lambdas too? Hey, they even call them "Blocks" in the documentation (http://gosu-lang.github.io/docs.html#blocks)



We use a bit of a dated version of Gosu where I work (something I never thought I'd get to claim on HN...), but I believe that curly braces are perfectly fine to use, and actually required if you have a multi-statement block (essentially starting to look like anonymous functions in Javascript).


Exactly if you want to return just an expression you can avoid them, otherwise if you use statements in the body of the lambda you need curly braces.


OK, thank you both for the explanation. That does sound sane :-).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: