Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

A few facts about Lisp and Haskell

Name: Anonymous 2011-04-18 6:59

Lisp:

* (expt -1 (exp 1))
#C(-0.6332554 0.7739428)


Haskell:

Prelude Data.Complex> (-1) ** exp 1 :: Complex Double
(-0.6332556513148192) :+ (-0.773942685266709)

Name: Anonymous 2011-04-18 15:11

>>25
Duck typing isn't a CL, that's Python.
In most Lisps, including CL, every possible language object (regardless of internal implementation) carries type with it, and variables themselves are untyped, unless you decide to go and force a type into them (for example, for optimization purposes: some compilers may even drop type information if you do that).
In my example, I just shown what happens when different types of floats are used as arguments. Common arithmetic operations are basically generic operations internally (although not so in the spec, despite supporting everything under the sun) which are optimized more heavily. Being such, they tend to support a variety of types for their arguments.

Duck typing as a style is supported in CL, for example through CLOS, but this isn't it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List