Artifact c5c100ab27ff9cad343d2dc25183406ab6bb012fb5f91387f8f21f73e2715587:
- Executable file
r37/packages/rlisp/switch.red
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 2165) [annotate] [blame] [check-ins using] [more...]
- Executable file
r38/packages/rlisp/switch.red
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 2165) [annotate] [blame] [check-ins using]
module switch; % Support for switches and ON and OFF statements. % Author: Anthony C. Hearn. % Copyright (c) 1991 The RAND Corporation. All rights reserved. global '(!*switchcheck switchlist!*); % No references to RPLAC-based functions in this module. symbolic procedure on u; for each j in u do on1 j; symbolic procedure off u; for each j in u do off1 j; symbolic procedure off1 u; onoff(u,nil); symbolic procedure on1 u; onoff(u,t); symbolic procedure onoff(u,bool); begin scalar x,y; if not idp u then typerr(u,"switch") else if not flagp(u,'switch) % then if !*switchcheck then rerror(rlisp,25,list(u,"not defined as switch")); % else lpriw("*****",list(u,"not defined as switch")); x := intern compress append(explode '!*,explode u); if !*switchcheck and lispeval x eq bool then return nil else if y := atsoc(bool,get(u,'simpfg)) then lispeval('progn . append(cdr y,list nil)); if bool and x eq '!*!r!a!i!s!e then x := '!*raise; % Special case. set(x,bool) end; symbolic procedure switch u; % Declare list u as switches. for each x in u do begin scalar y; if not idp x then typerr(x,"switch"); if not(x memq switchlist!*) then switchlist!* := x . switchlist!*; flag(list x,'switch); y := intern compress append(explode '!*,explode x); if not fluidp y and not globalp y then fluid list y end; deflist('((switch rlis)),'stat); % we use deflist since it's flagged % eval flag('(switch),'eval); put('off,'stat,'rlis); put('on,'stat,'rlis); flag ('(off on),'ignore); % Symbolic mode switches: switch backtrace,comp,defn,demo,echo,errcont,fastfor, % eoldelimp int,lessspace,msg,output,pret,quotenewnam,raise,time; put('eoldelimp,'simpfg,'((t (flag (list !$eol!$) 'delchar)) (nil (remflag (list !$eol!$) 'delchar)))); % Support for REDUCE 4. switch reduce4; put('reduce4,'simpfg,'((t (load!-package 'reduce4) (!%reduce4)))); endmodule; end;