lua-users home
lua-l archive

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

A more elaborate example:
       t :where |x| x.shoesize > 7 :sort |a,b| a.age < b.age :print

This would read as the invocation of method sort on number 7. You probably don't want to allow to pass  them  as  parentheses-less parameters.

Notice also that such short functions can used at the beginning of a statement, as in (|x| print(x))(42). You might therefore have to use statements separators for things like: "(|x|foo(x)) (y) (|x|foo(x)) (y)", which can be two statements or a currified 4 parameters function.