[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Nov 27 19:17:14 1995 
Subject:Re: local uses of "vars" 
From:John Williams 
Volume-ID:951128.05 

I am coming to the conclusion that Aaron is right - the warning messages
produced by vars when it is used inside a procedure are more trouble
than they're worth. (Given the prevalence of vars inside procedures in
existing documentation).

Aaron suggests redefining vars to not print these warnings, as follows:

>lvars oldvars = nonsyntax vars;
>
>sysunprotect("vars");
>
>define syntax vars;
>   ;;; It should work as normal outside procedure definitions, and
>   ;;; suppress warning messages inside procedure definitions.
>   lvars item;
>   if popexecute then
>       oldvars();
>   else
>       repeat
>           readitem() -> item;
>       quitif(item = ";");
>           unless item = "," then
>               sysSYNTAX(item, 0, false);
>               sysLOCAL(item)
>           endunless;
>       endrepeat;
>       ";" :: proglist -> proglist;
>   endif;
>enddefine;
>
>sysprotect("vars");


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.


John Williams (Poplog development team).