next up previous
Next: Static error under dynamic Up: Specialization by Example Previous: Higher-order functions

Partially static data structures

To illustrate the difference between constructors (mycons) and primitives (cons) we give an example:

  example642

What this example shows is that even though the constructed value (mycons (f x) 6) contains a dynamic (unknown) component (f x), the static component of the value can still be accessed and used for further specialization. This is not the case for the value constructed by cons. Notice also that although the value of (f x) is not used, it is still computed, since discarding the computation could be semantically unsound.



Jesper Jxrgensen
Sat Jun 27 17:30:51 MET DST 1998