From: Jakub Travnik Date: 2001-12-07T09:14:17+09:00 Subject: [ruby-talk:27769] Re: syntax across languages It is very nice. I have found a problem. in if_then_else section: if c then a else b Haskell, merd, OCaml, Ruby this is not correct, Ruby uses 'end' keyword to end if. and there are more ways possible in Ruby: if c then a else b end if c; a else b end if c a else b end 'then' may be replaced with ';' or newline 'end' is usefull to avoid dangling 'else' problems. Some additions: --------------- package scope: .. pascal(delphi/kylix) type (as in retyping): type(expr) pascal(delphi/kylix) record selector: .. pascal(delphi/kylix) list flattening: flatten ruby(*) (*) flatten is method of Array, not a keyword array indexing: a[i] pascal(delphi/kylix) string concatenation + pascal(delphi/kylix) ascii to character: chr pascal(delphi/kylix) character to ascii: ord pascal(delphi/kylix) false value: false pascal(delphi/kylix), Ruby(**) (**) in ruby both nil and false means false value, all other means true true value: true pascal(delphi/kylix) logical or: or pascal(delphi/kylix) logical and: and pascal(delphi/kylix) power: power delphi/kylix square root / exponential / absolute value: sqrt/exp/abs pascal(delphi/kylix) trigonometry: cos/sin/tan pascal(delphi/kylix) logarithm: ln pascal(delphi/kylix) log10 delphi/kylix modulo: mod pascal(delphi/kylix) Jakub Travnik jabber://jtra@jabber.com