Path: utzoo!attcan!uunet!snorkelwacker!usc!rutgers!njin!princeton!phoenix!markv From: markv@phoenix.Princeton.EDU (Mark T Vandewettering) Newsgroups: comp.lang.scheme Subject: Re: Fun. vs. Logic Message-ID: <11632@phoenix.Princeton.EDU> Date: 19 Nov 89 20:47:19 GMT References: <11500018@hpldola.HP.COM> <11610@phoenix.Princeton.EDU> <3055@brazos.Rice.edu> Reply-To: markv@phoenix.Princeton.EDU (Mark T Vandewettering) Organization: Princeton University, NJ Lines: 44 In article <3055@brazos.Rice.edu> dorai@titan.rice.edu (Dorai Sitaram) writes: My claim originally was: >>Exceptions are not necessarily a non-functional construct, it is >>relatively simple to design a moderately effective exception handling >>mechanism if you adopt a language in which continuations are first >>class. Imagine all applications have not just and operator and an operand, but also a continuation. The result of application is the result of applying the continuation to the result of applying the operator to the operand. This is the basic notion of a continuation passing language. What particular feature of this is non-functional? The flow of control is a bit more convoluted, and analysis of such programs may be more difficult, but I fail to see any reason to toss out such constructs. Continuations are no more complicated or unfunctional that higher order functions. My formal background is weak however. Anyone else have some good ideas? >@ If, by your definition of "functionalness," continuations turn out to > be functional, then why are assignments denied the same privilege? Assignments destroy potential parallelism by introducing context dependance. A simple substitution semantics provides a wide variety of sites where expression reduction might occur. The only requirement is that all inputs to a (strict) function be present before application can begin. When assignment is allowed, potential parallelism is lost because the meaning of the program changes dependant on the current value of the variable. Referential transparency is a very useful property. I have been informal in my description of what I perceive to be as a functional language. Roughly, I would say that something evaluated according to a simple substitution style semantics would be functional. It is my belief that continuations can be well understood in this framework. I would like to hear examples or counterexamples of course. Mark