Skip to content

Instantly share code, notes, and snippets.

@kosugi
Last active December 31, 2015 17:29
Show Gist options
  • Select an option

  • Save kosugi/8020252 to your computer and use it in GitHub Desktop.

Select an option

Save kosugi/8020252 to your computer and use it in GitHub Desktop.
マクロに apply できない問題
(defun or/l (args)
(let ((r nil))
(while (and args (null r))
(setq r (or r (car args)))
(setq args (cdr args)))
r))
(define (or/l xs)
(if (null? xs) #f
(let1 x (car xs)
(or x (or/l (cdr xs))))))
;; https://twitter.com/anohana/status/413272565629456384
(any values xs) ; ここまでくると define し直す意義ないか.
(define (or/l xs)
(fold (lambda (r l) (or r l)) #f xs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment