3 ms·
I don't see how: Racket: > (define (fact n) (if (= n 1) 1 (* n (fact (- n 1))))) > (fact 6) 720 OCaml: # let rec fact = fu
by zarakshR 5mo ago
I don't see how:
Racket:
> (define (fact n)
(if (= n 1)
1
(* n (fact (- n 1)))))
> (fact 6)
720
OCaml:
# let rec fact = function
| 1 -> 1
| n when n > 1 -> n * (fact (n - 1))
in fact 6;;
- : int = 720
- kubb 5mo agoWhenever someone complains about not being able to use a slightly different syntax, I assume they just don't have any neuroplasticity anymore.
- drob518 5mo agoI think syntax matches with our brains or not. I think anyone is capable of learning any syntax. The question is whether they want to. At some level, programming is art.