🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.functional
Article #518

Re: A question about types in ML

#518
From: Jeff Dalton
Date: Wed, 21 Nov 1990 17:11
31 lines
1933 bytes
In article <11901@life.ai.mit.edu> tmb@ai.mit.edu writes:
>|> If you remove the imperative features from the core of Common Lisp,
>|> and remove the features which allow function definitions
>|> to be disassembled as lists, what remains _can_ be viewed
>|> as a functional language in which all expressions
>|> denote elements of the recursive domain
>|> 
>|> 	D = (Atoms + Booleans + DxD + D->D)_bottom.

But you can define new types using DEFSTRUCT and DEFCLASS.
All of them are "atoms" in the sense of the predicate ATOM
(ie, not a cons), but then so are functions.  And any object
can be used as a boolean.

>Of course, you can use ML in the same way:
>
>datatype D = Atom of string | Bool of bool | Int of int |
>	     Real of real | Cons of (D * D) | Vector of (D array)

Not the same.  "Atom" in CL does not mean "string".  Even if we
take it to mean "symbol" and suppose that ML could have symbols
(why not?), it is possible in CL to add new types at run-time.

>But, at least in ML you have the option of using strong typing,
>whereas in CommonLisp (or other dynamically typed languages),
>there is no language support whatsoever for handling typing.

That is a very strong claim: no support whatsoever for typing.
Indeed, it is false.

-- Jeff
Technical Details
Message-ID: <3798@skye.ed.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!edcastle!aiai!jeff
References: <fraser.658398987@melomys> <4906@rex.cs.tulane.edu> <2215@opal.cs.tu-berlin.de> <4971@rex.cs.tulane.edu> <11901@life.ai.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!edcastle!aiai!jeff
From: jeff@aiai.ed.ac.uk (Jeff Dalton)
Newsgroups: comp.lang.functional
Subject: Re: A question about types in ML
Message-ID: <3798@skye.ed.ac.uk>
Date: 21 Nov 90 17:11:23 GMT
References: <fraser.658398987@melomys> <4906@rex.cs.tulane.edu> <2215@opal.cs.tu-berlin.de> <4971@rex.cs.tulane.edu> <11901@life.ai.mit.edu>
Reply-To: jeff@aiai.UUCP (Jeff Dalton)
Distribution: comp
Organization: AIAI, University of Edinburgh, Scotland
Lines: 31