I do this:
[~ 479] scala
Welcome to Scala version 2.7.3.final (Java HotSpot(TM) Client VM, Java 1.5.0_16).
Type in expressions to have them evaluated.
Type :help for more information.
scala> 1 + 2*3
res0: Int = 7
If
1+2*3
returns a value other than 7, I automatically reject the language. For completeness, I also check 2*3+1
. What programming I do is normally math-intensive enough that I refuse to deal with languages that can't handle normal precedence rules.Prefix languages like the Lisp family pass this test, as they won't return a value. I've not worked with postfix languages like Forth, but I think they'd pass, too.
No comments:
Post a Comment