New parsing possibilities

dunbarx at aol.com dunbarx at aol.com
Tue Mar 12 09:59:24 EDT 2013



I had started something trivial on the forum that has become very interesting. Not sure how many here also lurk there, so I thought I would bring it over.


Originally, I had commented that something like:


if x,y,z = 0 then beep


threw no error. That has evolved quite nicely into a parsing discussion, and it is worth looking at. It is currently at a stage where new capabilities are being discovered, since:


put 2*2,3*3=4,9  -- returns "true", or
put 2*2,3*3 --yields "4,9".


There are undocumented rules here, for example:


put 2*2,3*3,(0=0) -- yields "4,9,true"


whereas


put 2*2,3*3,0=0  -- yields "false"


Implying that the comma delimited list is parsed as "2*2,3*3,0" = "0" and not as '2*2,3*3,0=0" yields some value as in the first case. Not sure how useful this all might be, but that is what they said about electricity.





Craig Newman


 



More information about the use-livecode mailing list