Evaluation of complex conditions

Alex Tweedly alex at tweedly.net
Thu Oct 6 14:27:58 EDT 2011


On 06/10/2011 18:14, Ken Ray wrote:
> There are certain times where parens are necessary (I just wish I 
> could remember specifically where and when). It *is* a good practice 
> to put expressions in parens for readability, especially when it comes 
> to working with objects. Compare:
My favourite example of the need to use parentheses in LC is with URLs.

put URL "file:" & tVariable into temp

will attempt to put the URL "file:" into temp, and then append the 
contents of 'tVariable' to it, because 'URL' is a high-precedence 
operator. You need to do

put URL ("file:" & tVariable) into temp

to get the desired result.

FWIW, I fully agree - parentheses are very helpful to readability, and 
should be widely used.

-- Alex.




More information about the use-livecode mailing list