🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #904

"definition" rather than assignment (lazy evaluation)

#904
From: Othar Hansson
Date: Tue, 20 Mar 1990 18:17
26 lines
1506 bytes
Is there any literature on taking assignment/initialization of
variables as "definition", i.e., that

mytype M = A*B;

is taken to mean that M is defined as the product of A and B, and that
changes to A will cause M to change?  Perhaps there's a
general-purpose language in which this is done (aside from
spreadsheets and special-purpose constraint languages)?  It implies
that evaluation will be more than lazy, in that evaluations get out of
date.  Other facilities are also required, such as freezing current
values (e.g., freezing B in the example above (by copying it)).

I've found a simple way to do this in C++, and it has greatly
simplified my code for one application, but I have only a few dozen
data objects to which it applies.  As my application is restricted, I
haven't had to think out the semantics of "definition" too thoroughly,
and I am wondering if I have overlooked some important problem in
applying the technique in general.

Othar Hansson
CS Division
UC Berkeley
...!ucbvax!ernie!othar
othar@ernie.berkeley.edu
Technical Details
Message-ID: <35045@ucbvax.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!ernie.Berkeley.EDU!othar

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!ernie.Berkeley.EDU!othar
From: othar@ernie.Berkeley.EDU (Othar Hansson)
Newsgroups: comp.lang.misc
Subject: "definition" rather than assignment (lazy evaluation)
Message-ID: <35045@ucbvax.BERKELEY.EDU>
Date: 20 Mar 90 18:17:35 GMT
Sender: usenet@ucbvax.BERKELEY.EDU
Reply-To: othar@ernie.Berkeley.EDU (Othar Hansson)
Organization: University of California, Berkeley
Lines: 26