View Single Post
Old 25 August 2015, 13:05   #312
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
the advantage is that you can always tell there is a block there, basically "do...end" is equivalent to "{...}" but with friendlier symbols. Another idea that just occurred to me, is to use a colon for the long form and a comma for the short form. This is a bit like how we'd use punctuation in English:

if n=0, return 1
-- or
if n=0:
   return 1
unusual if syntax, btw.. it appears to actually reverse the order in which the terms would be executed

Last edited by Mrs Beanbag; 25 August 2015 at 13:10.
Mrs Beanbag is offline  
Page generated in 0.03972 seconds with 10 queries