entry (was Re: Pointers to functions)
David Collier-Brown
daveb at geac.UUCP
Mon Mar 14 06:55:01 AEST 1988
In article <1988Mar11.221528.1392 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
> It's also not at all clear that it
>is particularly useful, which is probably why nobody ever did anything
>with the "entry" keyword.
It was useful in PL/1 for simulating C-like static-to-file
variables and C++-like packages... (sudden thought: ++- should be a
new operator in D).
It got dropped just about the time it might have proved usefull,
much to my relief. C++ is much cleaner than:
balanced_binary_tree: procedure returns ptr; begin;
declare 1 tree;
(2 left, 2 right, 2 ptr) ptr
based on (p);
on misallocate goto cleanup;
allocate (tree) set(p);
return p;
cleanup:
return null;
newleft: entry(p,q) returns ptr; begin;
declare p, q ptr;
if (p->left = null) then do;
p->left = balanced_binary_tree;
p->left->ptr = q;
end do;
else do;
rebalance(p,q);
end do;
return p->left;
end;
...
The Multicians managed to avoid this almost entirely, the unicians
left it out of the language and the tune-in-next-weekians found a
better way.
Never let it be said that we aren't making progress.
--
David Collier-Brown. {mnetor yunexus utgpu}!geac!daveb
Geac Computers International Inc., | Computer Science loses its
350 Steelcase Road,Markham, Ontario, | memory (if not its mind)
CANADA, L3R 1B3 (416) 475-0525 x3279 | every 6 months.
More information about the Comp.lang.c
mailing list