Re:Lemon – An embeddable, lightweight programming language i...
by rubyfan on Wednesday October 25, 2017 @06:43AM
(#15548969)
Looks like a mashup of Ruby, JavaScript and tiny bit of Python.
[ Parent
| on HN ]
Re:Lemon – An embeddable, lightweight programming language i...
by Hemospectrum on Wednesday October 25, 2017 @06:58AM
(#15549029)
I’m mostly seeing a lot of Python. The examples show that multiple assignment unpacks collections, functions can be called with argument name assignment, and collections can be unpacked into named arguments, as opposed to using collections to replace named arguments.
Re:Lemon – An embeddable, lightweight programming language i...
by vidarh on Wednesday October 25, 2017 @09:48AM
(#15550064)
Ruby supports that too. Here's a snippet that shows named arguments, and unpacking a Hash into named arguments.
It can do multiple assignment and unpacking collections into them too, though unlike with named arguments, that will treat the collection as an Array:
def foo bar:, baz:
p [bar, baz]
end
h = {bar: 1, baz: 2}
foo(h)