[Larceny-users] Ports' type changes unexpectedly

David Rush kumoyuki at gmail.com
Fri Mar 20 05:27:50 EDT 2009


I actually agree with WIll 100%, but since I'm currently studying and
implementing some advanced type systems...

2009/3/19 William D Clinger <will at ccs.neu.edu>:
> Scheme is not a typed language.  Certain properties of an
> object are immutable, but others may be mutable.

I can feel the breeze from your hands waving :)

Types are constraints relating to the values in a formal system. They
provide a level of correctness guarantee that is directly related to
the subject matter of the underlying constraint system. In principle
(as in Scheme), there is no obligation to check constraints any time
sooner than the application of a function to it's arguments.

So all of those lovely predicates in Scheme do produce a type-system
of sorts, but the checking of the constraints is not performed in a
static environment. In fact, Scheme's type-checking is "reflected"
back to the programmer, modulo system primitives.

Looked at this way, having the set of constraints satisfied by a port
after a close operation change is completely unsurprising. The Scheme
"type system" is actually *richer* than in statically-typed languages,
because you can express type constraints that are sensitive to data
flow.

(perhaps I exaggerate slightly :)

david
-- 
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt



More information about the Larceny-users mailing list