lua-users home
lua-l archive

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



function a(t) return cos(t), sin(t), 1 end
vx,vy,vx+=a(t)


Thanks, nice notation!  Adds our friends += etc and makes them do the obvious Lua thing!
 
 
Of course, there's a typo in that line, so it will actually expand as: 
  vx=cos(t)+1
  vy=sin(t)

Perhaps we should take this as a cautionary tale illustrating the pitfalls of excessive shorthand :-)