ptr^^

Rod Schiffman call at byucsa.UUCP
Thu Feb 21 01:11:50 AEST 1985


> On the topic of PASCAL and MODULA-2:
> 
> 	Pascal doesn't allow declaring a "pointer to pointer to ..." directly
> 	(you need an intermediate type), but given such a thing allows you to
> 	say "object pointed to by object pointed to by ...".  I thought that
> 	Wirth had fixed this when I saw that M-2 does allow declaring a
> 	"pointer to pointer to ..." directly.  My enthusiasm was tempered when
> 	I noticed that it does NOT allow "ptr^^"; you must use a run-time
> 	temp variable.  Anybody know why the change?

I have been using Modula-2 on the Lilith for 4 years now.  Since this is the
machine that Wirth uses for his programming and both of the ETH supported
Modula-2 compilers were written on and for this machine, I would assume that
programs that both the one pass and four pass compilers compile would have to
be considered as pretty standard stuff.  Both compilers will run the following
program fragment.

MODULE testp;

  VAR
    x: POINTER TO POINTER TO POINTER TO CARDINAL;

BEGIN
  x^^^ := 7;
END testp.

There are a lot of gray areas in Modula-2. The One pass compiler will not
compile any significant program I have written using the four pass compiler,
and the four pass compiler will not compile any significant program that I
have written for the one pass compiler; however, the handling of pointer
variables is the same in both compilers.
-- 

	{ihnp4,noao,mcnc,utah-cs}!arizona!byucsa!call



More information about the Comp.lang.c mailing list