RE: local 'in' syntax

  • From: Gavin Wraith <gavin@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 01 May 2016 21:45:44 +0100

In message <COL127-W51F22768506A8A5843F766BC780@xxxxxxx>
          William Adams <william_a_adams@xxxxxxxxxxx> wrote:

If I use 'in' to specialize for creating locals from libraries/tables, what
happens if I do:

sin, cos, pow in math

Will it imply the 'local'?

No, it will give a syntax error. The 'in' in RiscLua only works after
the keyword 'local'. I believe that Peter Shook's original 'from' patch
was more general (and thereby required more code).
Maybe 'from' is better than 'in'? Not so liklely to be confused
with the for .. in .. do .. end construct, maybe.
--
Gavin Wraith (gavin@xxxxxxxxxxxxxxx)
Home page: http://www.wra1th.plus.com/

Other related posts: