Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Practical Common Lisp is disorganized shit.

Name: Suomynona 2011-12-21 2:53

So is Common Lisp.

Name: Anonymous 2011-12-21 9:49

>>12
Macro in LISP.

(defmacro aif (cond then else)
  `(let ((it ,cond))
     (if it ,then ,else)))


"Macro" in Scheme/Racket.

#lang racket
(require racket/stxparam)
 
(define-syntax-parameter it (lambda (stx) (raise-syntax-error 'anaphora "missed context" stx)))
 
(define-syntax-rule (aif cond then else)
  (let ([temp cond])
    (syntax-parameterize ([it (make-rename-transformer #`temp)])
                         (if temp then else))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List