[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jul 21 11:09:07 1993 
Subject:Stacks 
From:Anthony Worrall 
Volume-ID:930721.01 

Giving "[% ... %]" and "{% ... %}" their own stacks could presumably be done with in 
the existing Poplog bounds by using the same mechanism as used by processes.

For example (I use procedures only becaus I do not have acces to the stack
creation mechanism of procedures, which I assume is more efficent than
just copying the stack and calling clearstack :->). 

: define foo(); {% hd(); %}; enddefine;
: vars proc = consproc(0,foo);
: [a]; runproc(0,proc);

;;; MISHAP - ste: STACK EMPTY (missing argument? missing result?)
;;; DOING    :  hd foo runproc compile pop_setpop_compiler 

Setpop
: define foo(); [% erase();hd(); %]; enddefine;
: vars proc = consproc(0,foo);
: [a]; runproc(0,proc);

;;; MISHAP - ste: STACK EMPTY (missing argument? missing result?)
;;; DOING    :  hd foo runproc compile pop_setpop_compiler 

Setpop
: =>
** 
: define foo(); [% popversion %]; enddefine;
: vars proc = consproc(0,foo);
: runproc(0,proc);
: =>
** [(Version 14.2 Wed Feb  3 12:46:18 GMT 1993)] 


Doing this would cause an additional overhead so we might want to keep
the old behavour with the syntax nc_{% ... %}_nc and nc_[% ... %]_nc.
This would allow programmers who a sure of the code to keep the efficiency
while helping others to find bugs in the programme.

This will not satisfy Jon Rowe but I think it not possible to do what he 
wants with arbitrary procedures with the current definition of pop11.

Anthony.Worrall@Reading.ac.uk