zepto icon indicating copy to clipboard operation
zepto copied to clipboard

Better `let`

Open hellerve opened this issue 8 years ago • 1 comments

let is an integral part of writing code in any Lisp. Sadly, the default tranforms in zepto are clumsy (again, due to poor choices in Scheme), i.e. there are let, let*, letrec, and letrec*, for no good reason whatsoever, because letrec*, possibly with builtin destructuring of values, would be the sane default.

An illustrating example of what the new let should be - minimally - capable of achieving:

(let (((x y . z) (list 1 2 3))
        (m (+ y 10))
        (l (length z)))
  (+ l m))

hellerve avatar Nov 23 '16 15:11 hellerve

There is a unified, pattern-matching implementation of let (not letrec-conformant yet) in the zepto-stdlib branch v0.9.7-new-let.

hellerve avatar Nov 24 '16 11:11 hellerve