*scratch*

vijay's weblog

« Back to posts
  • Viewed
    times

Filed under

  • code
  • lisp
February 6, 2011

Symbolic programming

  • Edit
  • Delete
  • Tags
  • Autopost

A simple example that could be used to introduce symbolic programming in Lisp:

(define men '(socrates plato aristotle))

(define (man? x)
    (contains? men x))

(define (mortal? x)
    (man? x))

 ;; test

> (mortal? 'socrates)
=> #t

Conjured this up while answering a question at stackoverflow.

Tweet
  • 0 responses
  • Like
  • Comment