James Long | 17 May 15:05

full polymorphism in Pre-Scheme

Hi,

I have a few questions about Pre-Scheme's type system.  I will be  
referencing the following paper as "the paper":

Pre-Scheme: A Scheme Dialect for Systems Programming (http://citeseer.ist.psu.edu/196055.html 
)

and I am using Pre-Scheme from scheme48 v1.8.  Note that I don't have  
much experience with type systems, this is just my first step in  
understanding them.  I am interested in these problems because I would  
like to extend Pre-Scheme's type system to treat numbers with more  
granular interest, such as integer16 and integer32.

------

1.The paper states that Pre-Scheme's type reconstruction algorithm  
supports 4 kinds of polymorphism, one of them being full  
polymorphism.  The example case in the paper to illustrate this is one  
which would normally be rejected by basic type systems:

(define (add-one x)
   (+ x 1))

(* (add-one 1.5)
     (vector-ref v (add-one 3)))

I understand the polymorphic nature of the above expressions, and how  
full polymorphism would support this.  The problem is that Pre-Scheme  
does *not* seem to support this, from pragmatic testing.  The  
(Continue reading)

Richard Kelsey | 17 May 17:10

Re: full polymorphism in Pre-Scheme

   From: James Long <james.long <at> coptix.com>
   Date: Sat, 17 May 2008 15:08:42 +0200

   I have a few questions about Pre-Scheme's type system.  I will be  
   referencing the following paper as "the paper":

   Pre-Scheme: A Scheme Dialect for Systems Programming (
   http://citeseer.ist.psu.edu/196055.html )

   and I am using Pre-Scheme from scheme48 v1.8.  Note that I don't have  
   much experience with type systems, this is just my first step in  
   understanding them.

Pre-Scheme's handling of numeric types has changed over
time.  Initially I tried to make it handle types the way
C does, with overloaded numeric operators being made
concrete at compile time.  This seemed like the best fit
for Scheme's dynamic overloading.  After spending a lot
of time messing around with complex types systems and
mostly making it work, I realized that it didn't add
enough value to the language.  I don't think that the
current Pre-Scheme compiler does any overloading of
numeric operators.

   1. The paper states that Pre-Scheme's type reconstruction
   algorithm supports 4 kinds of polymorphism, one of them
   being full polymorphism.  The example case in the paper
   to illustrate this is one which would normally be
   rejected by basic type systems:

(Continue reading)


Gmane