[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: A Review of MoonScript 0.2.0
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 15 Dec 2011 13:57:18 +0200
On Thu, Dec 15, 2011 at 1:45 PM, Alex Bradbury <email@example.com> wrote:
> As the documentation states, this means `b = x-10` is converted to
> `local b = x(-10)`.
There's a few points like that, where a simple space can make all the
difference. It's hard to learn to watch out for single spaces ;)
> One aspect of Lua which Moonscript doesn't help with is the lack of a
> try/catch mechanism.
That would be consistent (it's a tricky thing to get exactly right, as
Fabien can tell you)
I suppose it would currently be:
ok,err = pcall ->
error "throw a wobbly"
if not ok
print "failed, dammit!", err
> local var = 100
> for i=1,10 do
> local var = i*i
The closest MoonScript gets AFAIK to a solution is the 'using' clause
It's a good example of a problem generated by local-as-default.