icky let-slots pasted by C-Keen on Thu Oct 19 21:51:02 2017
(define-syntax
let-slots
(ir-macro-transformer
(lambda (e i c)
(let* ((slots (caadr e))
(struct-name (cadadr e))
(struct (car (cddadr e)))
(body (cddr e)))
`(let ,(map (lambda (s)
`(,s (,(i (apply symbol-append (map strip-syntax (list struct-name '- s)))) ,struct)))
slots)
,@body)))))
let-slots usage added by C-Keen on Thu Oct 19 21:54:49 2017
#;2> (define-record foo bar baz) #;3> (let-slots ((bar baz) foo (make-foo 1 2)) (+ bar baz)) 3