Erik de Castro Lopo wrote:
4/ Ocaml lets you set a value based on the result of an if statment.
Ruby also lets you do this, as the 'if' statement is an expression. Eg, in Ruby:

x =     if remainder > 2 then
           5
         else
            0
         end


Ruby also lets you put the if after the assignment. Eg,

x = 0
.....
x = 5 if remainder > 2
Cheers,
James
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders

Reply via email to