[comp.lang.c] Entry

daveb@geac.UUCP (David Collier-Brown) (03/13/88)

In article <1988Mar11.221528.1392@utzoo.uucp> henry@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.

cik@l.cc.purdue.edu (Herman Rubin) (08/17/89)

In article <15373@rphroy.UUCP>, tkacik@rphroy.UUCP (Tom Tkacik) writes:

			..........................

> but my interpretation of it was to give the entry point into the program,
> if you did not like main.
> 
> Maybe something like:
> 
> entry start();
> 
> start()
> {
> 	/* this is now the main routine */
> }
> 
> Does anybody know what 'entry' was supposed to do?

An entry point in a program or subroutine was any point which could be
called from outside.  For example, it was standard for the function which
produced the sine or cosine to be of the form

sin(x)
.
.
.
entry cos(x)
.

which would tell the compiler that this was not a separate process, but that
cos was an entry point to the same process as sin.  The way that this is
usually handled in C is to use

sin(x)
.
.
return work(y)
cos(x)
.
.
return work(y)
work(y)
.
.
return expr

This always has two returns, whereas the other way would only have one,
although other manipulations may be needed.

The other use of entry, which is still available with difficulty, is to
tell the loader which globals are starting points, and which of them is
to be used,

These useful things seem to have been forgotten in the computing field.
Entry is not a pseudonym.
-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907
Phone: (317)494-6054
hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)