Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newsfeed.internetmci.com!swrinde!sdd.hp.com!col.hp.com!news.dtc.hp.com!hplntx!hplntx.hpl.hp.com!gjr
From: gjr@hplgr2.hpl.hp.com (Guillermo (Bill) J. Rozas)
Subject: Re: expressiveness and strong type system?
Sender: news@hpl.hp.com (HPLabs Usenet Login)
Message-ID: <GJR.96Mar21130522@hplgr2.hpl.hp.com>
In-Reply-To: blume@zayin.cs.princeton.edu's message of 20 Mar 1996 20:59:09 GMT
Date: Thu, 21 Mar 1996 21:05:22 GMT
Reply-To: gjr@hpl.hp.com
References: <OZ.96Mar14014447@nexus.yorku.ca> <hbaker-1403961017520001@10.0.2.15>
	<BLUME.96Mar14174151@zayin.cs.princeton.edu>
	<GJR.96Mar20105605@hplgr2.hpl.hp.com>
	<BLUME.96Mar20155909@zayin.cs.princeton.edu>
Nntp-Posting-Host: hplgr2.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Palo Alto, CA
Lines: 32

In article <BLUME.96Mar20155909@zayin.cs.princeton.edu> blume@zayin.cs.princeton.edu (Matthias Blume) writes:

|   In article <GJR.96Mar20105605@hplgr2.hpl.hp.com> gjr@hplgr2.hpl.hp.com (Guillermo (Bill) J. Rozas) writes:
|
|      In my case I am more concerned with type systems that disallow
|      heterogenous lists, vectors, and other arbitrarily-sized "indexed"
|      data structures (not records) where the elements are of different
|      types.
|
|   I think 99% of the cases where people take advantage of this in Scheme
|   is when the size is actually fixed and lists serve as a kludge to make
|   up for the missing record types.

Perhaps, but none of my uses fall here, since the version of Scheme
that I use has record types.

|   The remaining 1% cases where objects of different type go into the
|   same list can easily be dealt with using explicit sum types
|   (`datatypes' in ML).  In this case you even get some extra help from
|   the compiler, who will make sure you don't put things into the list
|   you didn't think of before, and who will warn you if you handle only a
|   subset of all possible cases...

I don't agree.  I often write "system level" code.  I write generic
object finalization code.  I write generic hash tables.  I write
generic parsers, unparsers, inspectors, debuggers, etc.

In all of these cases, the code must be ready to deal simultaneously
with types that it has never encountered before, which is precisely
why I depend on this ability.

Sum types do not cut it because the types must be pre-specified.
