quickutil icon indicating copy to clipboard operation
quickutil copied to clipboard

Clojure style binding with let- (new util)

Open ejbs opened this issue 11 years ago • 6 comments

(defmacro let- (bindings &body body)
  `(let (,@(let ((binds (subdivide bindings 2)))
                (if (every #'(lambda (bind)
                               (= (length bind) 2))
                           binds)
                    binds
                    (error "Invalid bindings"))))
     ,@body))

Provides: let- Requires: subdivide Author: Johan Sjölén License: Public domain

ejbs avatar Oct 23 '13 15:10 ejbs

Can this be released in the public domain?

stylewarning avatar Oct 28 '13 23:10 stylewarning

Sure, I don't really care. I just thought that MIT was "good enough". Also, gonna change the requirment to subdivide.

ejbs avatar Oct 30 '13 00:10 ejbs

let+ name is already used by https://github.com/tpapp/let-plus Just to get you noticed.

dervus avatar Nov 06 '13 18:11 dervus

That's not good! Gonna change the code to show my disappointment (though let-plus looks nice)

ejbs avatar Nov 07 '13 00:11 ejbs

@ejbs Can we call this let-clojure or something like that instead?

I would just like to try to avoid let1, let+, let-, let-let, sin(let), and e^(i*let + 1) kinds of macros too much.

stylewarning avatar Dec 24 '15 05:12 stylewarning

@tarballs-are-good if you're interested in adding it, then whatever is fine by me. If you feel like it's not worth the trouble to add it, then I'd have no problem in closing this issue (considering that it was added over two years ago).

ejbs avatar Dec 27 '15 20:12 ejbs