Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, not really, unless you're running the code in a metacircular interpreter.

Imagine encoding the pair ('hello . 'world) into a function. You might say:

  (lambda (msg)
    (if (eq msg 'car) 'hello 'world))
You could get 'hello by applying that function to the 'car symbol, or 'world by applying it to anything else. Wrapping that in another function lets us generalise to any CAR/CDR.

  (lambda (car-value cdr-value)
    (lambda (msg)
      (if (eq msg 'car) car-value cdr-value)))


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: