On Jul 12, 2009, at 20:15 , David Green wrote:
  sub nighttime (Canine $rover) { $rover.bark if any(burglars()); }
3) $rover acts like a Canine, but the rest of the original $dogwood arg (the Tree parts) are still there; they just aren't used unless somehow explicitly brought out; for example, by casting $rover to a Tree, or by passing it to some other function that is looking for a Tree object. This is how I'd like it to work, because that's the most flexible.

If you haven't declared it as such, this strikes me as a bad thing. Perhaps some kind of declarative syntax that lets you declare that you can take a Dogwood, such that you get an added argument which is undef (for a non-Dogwood) or a Dogwood (or Tree?)?

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to