|[3 earlier articles]|
|Re: pointer elimination in C firstname.lastname@example.org (1993-10-19)|
|Re: pointer elimination in C email@example.com (Robin Popplestone) (1993-10-22)|
|Re: pointer elimination in C firstname.lastname@example.org (1993-10-22)|
|Re: pointer elimination in C email@example.com (1993-10-22)|
|Re: pointer elimination in C firstname.lastname@example.org (1993-10-28)|
|Re: pointer elimination in C email@example.com (1993-10-29)|
|Re: pointer elimination in C firstname.lastname@example.org.COM (1993-11-01)|
|Re: pointer elimination in C email@example.com (1993-11-03)|
|Re: pointer elimination in C firstname.lastname@example.org (1993-11-03)|
|From:||email@example.com.COM (Robert Bernecky)|
|Organization:||Snake Island Research Inc, Toronto|
|Date:||Mon, 1 Nov 1993 16:09:53 GMT|
Robin Popplestone <firstname.lastname@example.org> writes:
|> I would be interested to know what that language is - any serious language
|> -does- in effect provide pointers, but restricts the operations you can do
|> on them in the interests of hygene. LISP for example, provides almost
|> nothing but pointers - typically only short integers and possibly short
|> floats will not be pointers.
APL and J support recursive data structures this way:
xyz =. <X
(denoted box or enclose)
where X is any array, produces a scalar which is a representation of
the array X. These scalars (which are implemented as pointers)
can be catenated, selected, etc, as any other array elements.
(denoted open or disclose)
produces an array which is the value of X as of the time that the
enclose was performed.
Thus X <--> ><X for all X.
Enclose gives you the ability to build tree-like data structures,
manipulate large array collections as simple entities, etc.
In the above example, changing X (assuming it was a named variable, rather
than a temp) would NOT affect the value pointed to by xyz. Techniques
such as static analysis or reference counts ensure that such side effects
The end result is that enclose/box produces an alias-free method of
pointer support. The only problem with this approach is that since it's
side-effect free, you cannot change the original X via a reference from
xyz, even if you want to.
If you could, we'd be back into the world of aliasing problems.
ps: Source and binaries for J are available by anonymous ftp from
watserv1.waterloo.edu (aka watserv1.uwaterloo.ca) in /languages/j.
Robert Bernecky email@example.com
Snake Island Research Inc (416) 203-0854
18 Fifth Street, Ward's Island
Toronto, Ontario M5J 2B9, Canada
Return to the
Search the comp.compilers archives again.