M
metaperl
In this video -
http://video.google.com/videoplay?d...=14&start=0&num=10&so=0&type=search&plindex=0
Peter Seibel says that Lisp generic functions give Lisp an edge in
"double dispatch" or even higher degrees of dispatch. I.e., when you
must decide which function to run based on the types of n or more
things.
The example he gave was displaying one of { Book, CD, DVD } to
any of { Text , Graphics }
but can't you simply write a bunch of static functions for each case?
Ie:
static void display(Book b, TextDisplay t);
static void display(Book b, GraphicDisplay t);
and so on?
http://video.google.com/videoplay?d...=14&start=0&num=10&so=0&type=search&plindex=0
Peter Seibel says that Lisp generic functions give Lisp an edge in
"double dispatch" or even higher degrees of dispatch. I.e., when you
must decide which function to run based on the types of n or more
things.
The example he gave was displaying one of { Book, CD, DVD } to
any of { Text , Graphics }
but can't you simply write a bunch of static functions for each case?
Ie:
static void display(Book b, TextDisplay t);
static void display(Book b, GraphicDisplay t);
and so on?