[comp.lang.misc] "true" functions

blarson@skat.usc.edu (Bob Larson) (02/29/88)

In article <1893@phoenix.Princeton.EDU> rjchen@phoenix.Princeton.EDU (Raymond Juimong Chen) writes:
>Propose that there be a way to declare "true functions", ie, functions
>whose return values depend on and are solely determined by the arguments
>passed to it.  They also have no side-effects.

SAIL (Stanford Artificial Intelegence Language) has this.  It allows
much more powerful constant expressions besides the better code
generated.

>	3. be calculated at any time provided the arguments are known.

The "any time" of course should included the compile/link process.
Unfortunatly, most current compiler/linkers can't handle conversions of
function calls to constants and subsequent optimization...

(SAIL has one major problem: it is closely tied to an obsolete 36 bit
arcitecture.  It has a lot of features I would like to see made more
common including true strings, case expressions, concurency, etc.)
-- 
Bob Larson	Arpa: Blarson@Ecla.Usc.Edu	blarson@skat.usc.edu
Uucp: {sdcrdcf,cit-vax}!oberon!skat!blarson
Prime mailing list:	info-prime-request%fns1@ecla.usc.edu
			oberon!fns1!info-prime-request

robison@uiucdcsb.cs.uiuc.edu (03/01/88)

In article <1893@phoenix.Princeton.EDU> rjchen@phoenix.Princeton.EDU (Raymond Juimong Chen) writes:

> Propose that there be a way to declare "true functions", ie, functions
> whose return values depend on and are solely determined by the arguments
> passed to it.  They also have no side-effects.

Russell also has this feature.  In Russell "true functions"
may be used in type declarations, thus allowing generic procedures
with strong type checking.

Arch D. Robison
University of Illinois at Urbana-Champaign
	
CSNET: robison@UIUC.CSNET
UUCP: {ihnp4,pur-ee,convex}!uiucdcs!robison
ARPA: robison@B.CS.UIUC.EDU (robison@UIUC.ARPA)