lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Does lambda x,y (x*(x+y)) feel unbalanced?  In its favour, it does
make _longer_ expressions more visible

 lambda x,y,z (x+(x-2)*g(x,y,z-2*(x+y))-y*z)

(I have a strong urge to put parens around the formal arg list ;))

f u n c t i o n
l a m b d a

Not much of a saving (and an e n d, of course)

I would be OK with the \ syntax (in Europe, but with a sane == UK keyboard)

I like the Scala syntax, Scala being another language attempting to balance oo, procedural and functional approaches

(x,y) => x+y for single expressiones
(x,y) => {  if foo(x)
                return y += 2 else
             { val z = x + y;
               return bar(z);
             }
 
but I don't know what issues that would cause the lua parser.