Re: In a Pascal-like language, would being able to declare a subroutine as "purely functional" be of any value?

1Z <pdjpurchase@googlemail.com>
Fri, 11 Mar 2011 16:49:30 -0800 (PST)

          From comp.compilers

Related articles
In a Pascal-like language, would being able to declare a subroutine as noitalmost@cox.net (noitalmost) (2011-03-11)
Re: In a Pascal-like language, would being able to declare a subroutin gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-03-11)
Re: In a Pascal-like language, would being able to declare a subroutin bobduff@shell01.TheWorld.com (Robert A Duff) (2011-03-11)
Re: In a Pascal-like language, would being able to declare a subroutin pdjpurchase@googlemail.com (1Z) (2011-03-11)
Re: In a Pascal-like language, would being able to declare a subroutin gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-03-12)
Re: In a Pascal-like language, would being able to declare a subroutin comp.lang.misc@inglorion.net (Robbert Haarman) (2011-03-12)
Re: In a Pascal-like language, would being able to declare a subroutin mcr@wildcard.demon.co.uk (Martin Rodgers) (2011-03-12)
Re: In a Pascal-like language, would being able to declare a subroutin noitalmost@cox.net (noitalmost) (2011-03-15)
Re: In a Pascal-like language, would being able to declare a subroutin wclodius@los-alamos.net (2011-03-15)
Re: In a Pascal-like language, would being able to declare a subroutin mcr@wildcard.demon.co.uk (Martin Rodgers) (2011-03-16)
[4 later articles]
| List of all articles for this month |
From: 1Z <pdjpurchase@googlemail.com>
Newsgroups: comp.compilers
Date: Fri, 11 Mar 2011 16:49:30 -0800 (PST)
Organization: Compilers Central
References: 11-03-032
Keywords: syntax, optimize
Posted-Date: 11 Mar 2011 19:55:46 EST

On Mar 11, 7:15 pm, noitalmost <noitalm...@cox.net> wrote:
> I was thinking of something like:
> pure function foo(x,y : int) int
> begin
> ...
> end;
>
> Then foo isn't allowed to modify its parameters or to reference
> (except possibly through a parameter) or modify any non-local
> variables. ...


This has been added as a non standard extension to C in gcc, so it is
doable. I think it is useful, since you don't have to use it if your
don't want to.



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.