[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Nov 28 00:45:40 1995 
Subject:Re: local uses of "vars" 
From:Aaron Sloman 
Volume-ID:951129.01 

For some reason this did not join the pop-forum list nor get onto
comp.lang.pop when I first sent it.

John,
Many thanks for your much nicer definition.

johnw@uk.ac.susx.cogs (John Williams) writes:

> Date: 27 Nov 1995 19:17:14 -0000

>
> Please would people instead use this re-definition:
>
>     sysunprotect("vars");
>
>     define syntax vars;
>         pop11_comp_declaration(sysVARS, "undef")
>     enddefine;
>
>     sysprotect("vars");
>
> as it is more correct (and shorter).
>
> If you put this code in a file called "init.p" in your home directory
> it will be loaded automatically every time you startup Poplog.

Unfortunately this clobbers other things, like

	define vars foo(x,y);
		....
	enddefine;

This produces a misplaced syntax word error. My version did also!

So I am now using the following.

     define syntax pvars;
		;;; for locally declaring pattern variables, etc.
         pop11_comp_declaration(sysVARS, "undef")
     enddefine;

Then I use "pvars" for the old style local "vars" definitions.

Moral: ANY system-produced warning message should use a user-definable
print procedure, like prwarning. Then we could simply turn off the
warnings, or produce them more selectively.

Aaron
-- 
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs )
School of Computer Science, The University of Birmingham, B15 2TT, England
EMAIL   A.Sloman@cs.bham.ac.uk
Phone: +44-121-414-4775 (Sec 3711)       Fax:   +44-121-414-4281