Author: David Hanley
Date: 15:30:16 12/11/01
Go up one level in this thread
Ok, i should be clearer. If you're looking as templates in the exact C++ sense ( a big macro that lets the compiler fill in types ) then C++ introduced it. However, the same thing has been availabl for a long time, under the title "generic programming" SML is statically typed but allows genericity, and lisp is dynamically typed and allows genericity, do example (defgeneric foo( x ) ) (defmethod foo( (u user) ) .. ) (defmethod foo( (p programmer) ) .. ) (defmethof foo( (c customer) ) .. ) (map 'list #'foo people) Will call the right (foo) fumction for each person in people, and collect the results into a list. Modula-3 has deferred typing which is templates with slightly different syntax. There's a good example at : http://m3.polymtl.ca/dagenais/if515/main/main.html#SECTION002217000000000000000 dave
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.