Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!usc!apple!bionet!ames!sgi!shinobu!odin!thebeach.wpd.sgi.com!shap From: shap@thebeach.wpd.sgi.com (Jonathan Shapiro) Newsgroups: comp.lang.functional Subject: Re: The name of the game Message-ID: <6375@odin.corp.sgi.com> Date: 15 Apr 90 01:31:31 GMT References: <1818@majestix.ida.liu.se> <9108@chaph.usc.edu> Sender: news@odin.corp.sgi.com Reply-To: shap@sgi.com Organization: Silicon Graphics, WorkGroup Products Division Lines: 42 > Also, wouldn't it be more accurate to say "no reassignments"? or is > there a serious distinction made between function definition and value > assignments?? There is a difference between initializing a variable and reassigning a variable. The first creates a cell for a value (at least semantically) while the second mutates an existing cell to give it a new value. Initialization is also known as 'binding,' which is probably the more common term in the context of functional languages. To give an example from scheme, the following code fragment operates in a purely functional way: (let ((a (+ 1 2))) a) where the next one doesn't: (let ((a nil)) (set! a (+ 1 2)) a) For those of you not familiar with scheme per-se, set! is like setq in other LISP dialects. The names of all mutating operators are terminated by a '!' by convention. > Perhaps one should make a distinction between the operating system > (where values and functions can be defined) and the functional > language (where everything is all nice and neat)? The question of whether a language is 'functional' or not has nothing to do with the support environment, such as the OS. Whether a language is functional is solely determined by the semantics of the language. If the language provides routines that maintain private state (such as many operating system routines), an argument can be made that the language is non- functional. Strictly speaking, any language that has input or output primatives is by definition non-functional, since these primatives logically maintain state. In practice, such languages are still considered functional by most.