Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!ukma!rex!caesar!fs From: fs@caesar.cs.tulane.edu (Frank Silbermann) Newsgroups: comp.lang.functional Subject: Re: A question about types in ML Message-ID: <4987@rex.cs.tulane.edu> Date: 16 Nov 90 17:22:33 GMT References: <2215@opal.cs.tu-berlin.de> <4971@rex.cs.tulane.edu> <11901@life.ai.mit.edu> Sender: news@rex.cs.tulane.edu Distribution: comp Organization: Computer Science Dept., Tulane Univ., New Orleans, LA Lines: 30 In article <11901@life.ai.mit.edu> tmb@ai.mit.edu writes: >In article <4971@rex.cs.tulane.edu>, fs@caesar.cs.tulane.edu (Frank Silbermann) writes: >|> >> Because compromise between flexibility and safety >|> >> will always involve a trade-off, I believe that >|> >> untyped functional languages (e.g. those in the >|> >> LISP/Scheme style) will never become completely obsolete. >|> >|> > In the very rare case, this property is to be just an object ... >|> ^^^^^^^^^ >|> 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. > >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) I didn't know that -- thank you for correcting me. At least now we've finally answered the original question of <11901@life.ai.mit.edu> re how one can create an ML list of "anything". Just define datatype D as above, and then declare "list D". Frank Silbermann fs@cs.tulane.edu Tulane University New Orleans, Louisianna USA