Dylan, as well as CLOS, Cecil, and others, uses "multiple dispatch", which is a generalization of the single dispatch mechanism of C++, Java, and Smalltalk. Whereas in single dispatch there is a distinguished "receiver" object whose class determines the method chosen, multiple dispatch uses the classes of all the arguments of a call to choose the most applicable method.
(contributed by Greg Sullivan, gregs@ai.mit.edu)
let first-five = #[1, 2, 3, 4, 5];There's a gotcha, though, as has been discussed on comp.lang.dylan, given:
define constant $jack = 11; define constant $queen = 12; define constant $king = 13; define constant $ace = 14;one cannot do this:
let faces = #[$jack, $queen, $king, $ace]; // doesn't compileHowever, one can use the vector function to achieve pretty much the same thing:
let faces = vector($jack, $queen, $king, $ace); // ok(Jason Trenouth explains this gotcha in detail).
application-arguments()
gives an array of strings passed in from the command-line (see a detailed discussion here).
format-out()
something, and it doesn't show in the shell ... why?force-output(*standard-output*);
after you output something.
Please email me at dauclair@hotmail.com with questions you'd like answered on this FAQ.