Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel-eecis!news.mathworks.com!newsfeed.internetmci.com!in3.uu.net!news.biu.ac.il!discus.technion.ac.il!news!qobi
From: qobi@eesun.technion.ac.il (Jeffrey Mark Siskind)
Subject: Re: Scheme or ML? (was Re: multiple values)
Reply-To: Qobi@EE.Technion.AC.IL
Organization: Technion, Israel Institute of Technology
Date: Wed, 7 Aug 1996 07:16:52 GMT
Message-ID: <QOBI.96Aug7101652@eesun.technion.ac.il>
In-Reply-To: bhelm@blackrabbit.cs.uoregon.edu's message of 4 Aug 1996 21:08:28
	-0700
X-Nntp-Posting-Host: eesun.technion.ac.il
References: <qijn30oeaoq.fsf@lambda.ai.mit.edu>
	<cc001636-2607960950310001@ip95.van-nuys.ca.interramp.com>
	<31FE3046.3E93@cs.cmu.edu> <4u38ip$b63@garbo.cs.indiana.edu>
	<4u3s3s$3n3@blackrabbit.cs.uoregon.edu>
Sender: news@discus.technion.ac.il (News system)
Lines: 33

In article <4u3s3s$3n3@blackrabbit.cs.uoregon.edu> bhelm@blackrabbit.cs.uoregon.edu (B. Robert Helm) writes:

   >A wide misconception among (or misstatement by) static typing
   >proponents is that Scheme is not strongly typed.  In fact, it is, but
   >the types are checked at run time, allowing fewer programs to be
   >rejected, which makes Scheme more rather than less general, and makes
   >ML "but one tiny little corner" of Scheme, if we want to resort to such
   >pejorative statements.

   Well, Scheme is strongly typed in the sense that it detects all
   violations of its _own_ type system.  However, there is no convenient,
   standard way to keep it from violating _my_ type system.  To do that
   in R4RS/IEEE Scheme, I have to write code to store and check type
   tags, just as I would in the hypothetical "one-type" ML translation of
   my Scheme program.

QobiScheme, available free from my home page, includes a DEFINE-STRUCTURE
macro for Scheme->C that eliminates the need to explicitly write code to store
and check type tags. Stalin, also available free from my home page, includes a
compatible DEFINE-STRUCTURE facility built into the compiler, and safely
eliminates of the storage and checking of type tags for defined structures
when possible. Together, these provide a convenient way to extend the type
system of R4RS and keep Scheme programs from violating user-defined type
systems.

Many, maybe even most, Scheme/Lisp dialects and implementations have record
definition mechanisms for extending the type system. In Common Lisp the
mechanism is standardized. To my knowledge, however, no Scheme/Lisp
implementation other than Stalin does type inference to eliminate storage and
checking of type tags on record data.
-- 

    Jeff (home page http://tochna.technion.ac.il/~qobi)
