[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regularization of Procedures in Scheme



   Date: Tue, 18 Oct 88 14:26:24 PDT
   From: Pavel.pa@Xerox.COM

   Morry, you ask me to ``See earlier reply to same question'' in response to
   my question about why the long form of APPLY has anything to do with making
   it polymorphic on the final argument.  I didn't see an earlier reply that
   seemed applicable.

Suffice it to say that I misread the documentation on the second form of apply,
whic I never use and the problems are insignificant. 

   Concerning ``polymorphism at two levels'' for the MATCH procedure: Isn't
   all of the polymorphism at the second level contained in the predicate and
   not at all part of MATCH's contract?

I believe that match must step down the elements of its argument comparing the
given value to the first element of each element.  Therefore match is
polymorphic both in the type of the backbone and in the types of the elements
of the backbone.  This is because I was assuming that the predicate would
operate on the given value and the first element of each element of the
backbopne.  I guess an alternative which would only require match to be
polymorphic in the type of the backbone would be for it to take the entire
elements of the backbone as the second argument.  This could actually add an
additional form of flexibility in that match could be specified to return the
value returned by the predicate, when it wasn't #f.  (I actually like this idea
quite a bit.)
					Morry Katz
					katz@polya.stanford.edu