lua-users home
lua-l archive

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

2009/12/3 David Kastrup <>:
> function(x) return x*(x-1) end
> is terse enough not to pine for shortcuts looking like line noise.

Hi David,

I've introduced the notation |x| x*(x-1) because
- I was writing a *lot* of times "function(args) return expr end" and
I was feeling
  a come compact notation was useful
- I've seen this notation adopted in metalua
- it is very close the the mathematical notation.

I'm in correspondance with many peoples and almost all of them likes
this kind of notation. I believe its adoption is a matter of taste and
it also depends on the kind of code you write usually but I feel it is
a usuful clean notation that could have its place in Lua.