stylewarning / quickutil

The solution to the Utility Library problem.
87 stars 8 forks source link

Clojure style binding with let- (new util) #37

Open ejbs opened 11 years ago

ejbs commented 11 years ago
(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

stylewarning commented 11 years ago

Can this be released in the public domain?

ejbs commented 11 years ago

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

dervus commented 11 years ago

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

ejbs commented 11 years ago

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

stylewarning commented 8 years ago

@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.

ejbs commented 8 years ago

@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).