Function Table

A Function Table Is an AssociativeArray that has a key of type symbol and a value of type function. in scheme you can do this

  (define (foo x y)
((assq x <foo>) y))
  (define <foo> (list (cons 'foo (lambda (x) (+ x x)))
(cons 'bar (lambda (y) (* y y)))))
Function tables can be used like Extensible Case Statements where the key is the case and the function is the code.


EditText of this page (last edited June 20, 2007) or FindPage with title or text search