2 ms·
With syntax hilighting and proper indenting, the Scheme code is pretty easy to read: http://img1.imagilive.com/0413/scheme-fact.png http://img1.imagilive.com/0
by gnosis 13y ago
With syntax hilighting and proper indenting, the Scheme code is pretty easy to read:
http://img1.imagilive.com/0413/scheme-fact.png http://img1.imagilive.com/0413/scheme-fact.png
You could even simplify it a little by getting rid of the lambda:
http://img1.imagilive.com/0413/scheme-fact2.png http://img1.imagilive.com/0413/scheme-fact2.png
In any case, I find toy examples like this less than convincing. In real-world programs, issues of style, design, and documentation usually trump most anything else, as far as clarity is concerned.
Also, I personally find the penchant for one-letter variable names in the OCaml/SML/Haskell world to be very confusing and obfuscating.
The Scheme way is to be more verbose and explicit. For me, that results in much greater clarity -- especially when looking at unfamiliar code or code that you've stepped away from for a few months.
Of course, there also such a thing as being too verbose and explicit. But for me, Scheme is in the sweet spot between verbosity and terseness.