|
Saturday, October 30, 2004 |
While I'm mentioning Predicate Dispatch - Here's a Java based Predicate Dispatch implementation: JPred. It seems to do its magic via a custom Java compiler (built on top of an extensible compiler system).
4:22:32 PM
|
|
From Lemonodor: A paper describing how to implement predicate dispatch in portable Common Lisp: Predicate Dispatching in the Common Lisp Object System.
Predicate dispatch is a generalisation of multi-method dispatch.
Instead of dispatching on the type of an object you can define a
'predicate' function that returns true or false to indicate whether or
not the passed object matches the type signature. As an example you
could have methods that operate on 'empty lists' where the predicate is
'list size is zero' and non-empty lists where the predicate is 'list
size is greater than zero'. The particular method will be called
depending on whether the list is empty or non-empty.
Cecil is an example of a programming language that has predicate dispatch built in.
4:18:05 PM
|
|
© Copyright 2005 Chris Double.
|
|
|