The test objects are Point2d and Point3d. No interface inheritance is needed, but it can help.
Common Lisp | |
Dylan | |
Python | |
Ruby | |
Java | need some downcasting back from Point to Point2d or Point3d |
C++ | no runtime error |
Haskell | no runtime error (uses existential types) |
OCaml | no runtime error |
merd | no runtime error |
nice | no runtime error |
Common Lisp | |
Dylan | |
Python | explicit "add" argument runtime type checking |
Ruby | explicit "add" argument runtime type checking |
Java | explicit "add" argument runtime type checking
need some downcasting back from Point to Point2d or Point3d |
C++ | explicit "add" argument runtime type checking |
Haskell | no runtime error but can't make a list of points having the ability to use "add" |
Haskell | explicit "add" argument runtime type checking uses unpacking from existential type back to real type |
OCaml | no runtime error but can't make a list of points having the ability to use "add" |
merd | no runtime error |
nice | no runtime error |
Common Lisp | |
Dylan | |
Python | explicit runtime dispatching |
Ruby | explicit runtime dispatching |
Java | no runtime error explicit runtime dispatching need some downcasting back from Point to Point2d or Point3d |
C++ | no runtime error explicit runtime dispatching |
Haskell | no runtime error explicit runtime dispatching uses unpacking from existential type back to real type |
Haskell | no OO, using a variant for unifying Point2d and Point3d |
OCaml | no OO, using a variant for unifying Point2d and Point3d |
merd | no runtime error |
nice | no runtime error |
Release: $Id$