4 ms·
SRFI 49 went too far the other way. In F# the expression would be: let rec fac x = if x = 0 then 1 x * fac (x - 1) Or with pattern matching:
by AdeptusAquinas 9y ago
SRFI 49 went too far the other way. In F# the expression would be:
let rec fac x =
if x = 0 then
1
x * fac (x - 1)
Or with pattern matching:
let rec fac = match x with
| 0 -> 1
| _ -> x * fac (x - 1)
- nocman 9y agoI suspect that SRFI 49 went as far as it did in an attempt to reduce ambiguity (but I haven't spent much time looking at it, so take that with a grain of salt). I understand why people prefer the combination of infix expressions and a possible reduction in the number of bracket-like symbols in their programming language (indeed, as I stated before, I originally found lisp syntax to be weird, and originally I didn't like it). When things are different than what you are used to, it is common to not like them. However, having spent a considerable amount of time programming in lisp-like languages, I find that the benefits of prefix notation and the use of parens as boundaries in the language far outweigh the costs of having them there. Any discomfort with the aesthetics of the code seems to fade with time for most people (if they are willing to spend enough time using the language to get used to them).