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

/prog/ whining

Name: Anonymous 2011-02-25 19:02

we always talk about how we're going to build some game together but we never do... is it because we can't stand to look at each others code? i don't know! but i think it's time to have another thread about if we could get our strength together and do something. if history is any indication, chances are pretty low we'll succeed... but i say we keep trying, so: let's build a game.

ITT: whining about how /prog/ was never good and fun game ideas

Name: Anonymous 2011-02-25 19:24

>>8
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