Re: pitching names for the attribute for a function with no memor y or side effects
[ date ] 2001/03/30 | Friday | 11:16 PM [ author ] John Porter [EMAIL PROTECTED] Russ Allbery wrote: gcc and the literature both use "pure"; I'd recommend that. John Porter wrote: I like pure too, but I'm afraid the nuance of it will be completely lost on non-Functional programmers. not to worry... If anything, it might educate them. I didn't really grok functional programming before I got to experiment w/ some functional idioms in a perl context. I also like "pure" for its great potential in perl poetry. ;-) my $cents = 2;
Re: pitching names for the attribute for a function with no memory or side effects
John BEPPU, at 12:50 -0700 on Sat, 31 Mar 2001, wrote: I like pure too, but I'm afraid the nuance of it will be completely lost on non-Functional programmers. not to worry... If anything, it might educate them. I didn't really grok functional programming before I got to experiment w/ some functional idioms in a perl context. I also like "pure" for its great potential in perl poetry. ;-) "not to worry"??? I don't think this attitude is useful for deciding how to name thing. You don't decide things merely on the idea of "how things should be"; you have to grasp what the average programmers is going to think of it. Just because one programming paradigm happens to name it "pure" doesn't mean that name should be carried over to other paradigms. In a functional-programming context, sure, "pure" might be a good name. But in a non-functional context, the name has little meaning with regards to the concept of "nosideeffects". -- Frank Tobin http://www.uiuc.edu/~ftobin/
Re: pitching names for the attribute for a function with no memor y or side effects
Frank Tobin [EMAIL PROTECTED] writes: Just because one programming paradigm happens to name it "pure" doesn't mean that name should be carried over to other paradigms. In a functional-programming context, sure, "pure" might be a good name. But in a non-functional context, the name has little meaning with regards to the concept of "nosideeffects". It looks like I was misremembering; I remember a proposal for a "pure" attribute in gcc, but it looks like the attribute used for functions with no memory references and no side effects is "const" (a la C++). I think "pure" was proposed for the somewhat relaxed version of that that allowed memory references but not side effects. -- Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/
Re: pitching names for the attribute for a function with no memor y or side effects
On Sat, Mar 31, 2001 at 02:01:39PM -0600, Frank Tobin wrote: John BEPPU, at 12:50 -0700 on Sat, 31 Mar 2001, wrote: I like pure too, but I'm afraid the nuance of it will be completely lost on non-Functional programmers. not to worry... If anything, it might educate them. I didn't really grok functional programming before I got to experiment w/ some functional idioms in a perl context. I also like "pure" for its great potential in perl poetry. ;-) "not to worry"??? I don't think this attitude is useful for deciding how to name thing. You don't decide things merely on the idea of "how things should be"; you have to grasp what the average programmers is going to think of it. Without commenting on main theme of this thread, although I have plenty of opinions on that too, and not wanting to open too many cans of worms, may I simply mention that I hope we are not trying to cater too much to the average programmer? There are already plenty of languages that will do that. Perl has always been an expert friendly language. That doesn't mean that beginning or average programmers cannot use it, but rather that by using it, by reading the documentation and code from expert programmers, they may be able to improve and become better programmers. I think that is a fine stand for a computer language. Just because one programming paradigm happens to name it "pure" doesn't mean that name should be carried over to other paradigms. In a functional-programming context, sure, "pure" might be a good name. But in a non-functional context, the name has little meaning with regards to the concept of "nosideeffects". By using a correct term, although it may be unknown to the average programmer, the programmer is presented with an oportunity to learn, and may even be exposed to a completely new programming paradigm. And, by the way, it is already possible to do reasonable functional programming in Perl, and it looks as though Perl6 will provide even more support. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net
Re: pitching names for the attribute for a function with no memory or side effects
Paul Johnson, at 01:03 +0200 on Sun, 1 Apr 2001, wrote: Without commenting on main theme of this thread, although I have plenty of opinions on that too, and not wanting to open too many cans of worms, may I simply mention that I hope we are not trying to cater too much to the average programmer? There are already plenty of languages that will do that. I'll accept this. By using a correct term, although it may be unknown to the average programmer, the programmer is presented with an oportunity to learn, and may even be exposed to a completely new programming paradigm. This is true, if "pure" can be "correctly" applied to the notion of "nosideeffects" in the context of standard Perl programming. While the term "pure", surely can be deemed "correct" in the context of functional programming, it cannot in standard Perl programming. This is not to say one can't do functional programming in Perl, or anything of the like. However, considering context in which most Perl is written, "pure" has no meaning, and hence I wouldn't consider it "correct". -- Frank Tobin http://www.uiuc.edu/~ftobin/
Re: pitching names for the attribute for a function with no memor y or side effects
Frank Tobin wrote: While the term "pure", surely can be deemed "correct" in the context of functional programming, it cannot in standard Perl programming. considering context in which most Perl is written, "pure" has no meaning, and hence I wouldn't consider it "correct". No, "pure function" has a general meaning, independent of any specific language. Besides, you're making too much of a distinction between perl and other languages. Lisp isn't a pure FP language by any means. -- John Porter Like music? Then you're gonna love this. I was into these dudes before anybody. Asked me to be the manager.
Re: pitching names for the attribute for a function with no memor y or side effects
Russ Allbery wrote: It looks like I was misremembering; I remember a proposal for a "pure" attribute in gcc, but it looks like the attribute used for functions with no memory references and no side effects is "const" (a la C++). I think "pure" was proposed for the somewhat relaxed version of that that allowed memory references but not side effects. Are you sure? That sounds totally backwards to me. Declaring a function "const" is a promise that it's not going to change anything outside its call frame. But a pure function, in the math sense, doesn't even look at anything outside its call frame. -- John Porter Like music? Then you're gonna love this. I was into these dudes before anybody. Asked me to be the manager.