Re: Recommendation: "functional" keyword

2011-01-09 Thread Andrei Alexandrescu
On 01/09/2011 04:31 PM, Sean Eskapp wrote: That's.. ehem.. quite limiting. :) (you probably meant heap) I meant what I said, and I said what I meant. Stack allocated implicitly would be fine, but explicit stack allocation, like declaring variables, doesn't happen in purely functional languages

Re: Recommendation: "functional" keyword

2011-01-09 Thread Jonathan M Davis
On Sunday 09 January 2011 14:31:11 Sean Eskapp wrote: > >That's.. ehem.. quite limiting. :) (you probably meant heap) > > I meant what I said, and I said what I meant. Stack allocated implicitly > would be fine, but explicit stack allocation, like declaring variables, > doesn't happen in purely fu

Re: Recommendation: "functional" keyword

2011-01-09 Thread Sean Eskapp
>That's.. ehem.. quite limiting. :) (you probably meant heap) I meant what I said, and I said what I meant. Stack allocated implicitly would be fine, but explicit stack allocation, like declaring variables, doesn't happen in purely functional languages. Personally, I like being able to impose th

Re: Recommendation: "functional" keyword

2011-01-09 Thread Tomek Sowiński
Sean Eskapp napisał: > It's a programmer contract, nothing more. It forces the code to be > functional, not > procedural. Just like const and @safe are simply programmer contracts, Immutably (strongly) pure (pure + all arguments immutable) functions break D onto functional grounds. > functiona

Re: Recommendation: "functional" keyword

2011-01-09 Thread Sean Eskapp
It's a programmer contract, nothing more. It forces the code to be functional, not procedural. Just like const and @safe are simply programmer contracts, functional would mean no explicit stack allocation, except that allocated in called functions.

Re: Recommendation: "functional" keyword

2011-01-09 Thread Simen kjaeraas
Eskapp wrote: Functional functions could not modify ANY data, including explicitly allocating variables. Although, come to think of it, this wouldn't imply pure, as they should still be allowed to read global data and call impure functions. I don't think I understand this. pure functions

Re: Recommendation: "functional" keyword

2011-01-09 Thread Sean Eskapp
Functional functions could not modify ANY data, including explicitly allocating variables. Although, come to think of it, this wouldn't imply pure, as they should still be allowed to read global data and call impure functions.

Re: Recommendation: "functional" keyword

2011-01-09 Thread Simen kjaeraas
Sean Eskapp wrote: I recommend that there be a "functional" keyword, which when applied to functions, would not allow them to modify existing data, or call impure functions. This would imply pure. Thoughts? What is the difference between this and pure? -- Simen

Recommendation: "functional" keyword

2011-01-09 Thread Sean Eskapp
I recommend that there be a "functional" keyword, which when applied to functions, would not allow them to modify existing data, or call impure functions. This would imply pure. Thoughts?