3 ms·
My ideal s-expression syntax would allow you to replace some brackets with whitespace. For instance, your function would become: define (pointless-function a
by qu4z-2 14y ago
My ideal s-expression syntax would allow you to replace some brackets with whitespace. For instance, your function would become:
define (pointless-function a z)
let*
numbers (map (lambda (n) (* n 2)) (range a z))
multiple-of-three? (lambda (n) (= 0 (mod n 3)))
multiples-of-three (filter multiple-of-three? numbers)
printf "Your numbers are: ~s~%" multiples-of-three
Obviously there are some down-sides, but the main idea is that the mapping should have no knowledge of the language details, and be a pure s-expression transform. I really should explore the idea more. I have no idea whether the above example can even be uniquely parsed.