From 29e53d366bd313f432aa744b651875f97438586c Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 2 May 2011 02:18:44 +0000 Subject: * boot/parser.boot (bpDefinition): Accept macro definition starting with the keyword "MACRO". * boot/translator.boot (exportNames): Export them in all evaluation contexts. * interp/c-util.boot: "macro" is now a keyword. * interp/define.boot: Likewise. * interp/g-util.boot: Likewise. * interp/i-syscmd.boot: Likewise. * interp/postpar.boot: Likewise. --- src/interp/c-util.boot | 2 +- src/interp/define.boot | 6 +++--- src/interp/g-util.boot | 4 ++-- src/interp/i-syscmd.boot | 26 +++++++++++++------------- src/interp/postpar.boot | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/interp') diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index 7dfad406..a96c8693 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -143,7 +143,7 @@ substituteDollarIfRepHack m == getRepresentation: %Env -> %Maybe %Mode getRepresentation e == u := get('Rep,'value,e) => u.expr - get('Rep,'macro,e) + get('Rep,"macro",e) ++ Returns true if the form `t' is an instance of the Tuple constructor. diff --git a/src/interp/define.boot b/src/interp/define.boot index e5c8fefa..896e78aa 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -623,7 +623,7 @@ macroExpandInPlace(x,e) == macroExpand: (%Form,%Env) -> %Form macroExpand(x,e) == --not worked out yet atom x => - not IDENTP x or (u := get(x,'macro,e)) = nil => x + not IDENTP x or (u := get(x,"macro",e)) = nil => x -- Don't expand a functional macro name by itself. u is ['%mlambda,:.] => x macroExpand(u,e) @@ -633,8 +633,8 @@ macroExpand(x,e) == --not worked out yet -- macros should override niladic props [op,:args] := x IDENTP op and args = nil and niladicConstructorFromDB op and - (u := get(op,'macro, e)) => macroExpand(u,e) - IDENTP op and (get(op,'macro,e) is ['%mlambda,parms,body]) => + (u := get(op,"macro", e)) => macroExpand(u,e) + IDENTP op and (get(op,"macro",e) is ['%mlambda,parms,body]) => nargs := #args nparms := #parms msg := diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index e1ff661a..d2636c16 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -290,9 +290,9 @@ addIntSymTabBinding(var,proplist,e is [[curContour,:.],:.]) == e putMacro(lhs,rhs,e) == - atom lhs => put(lhs,'macro,rhs,e) + atom lhs => put(lhs,"macro",rhs,e) parms := [gensym() for p in lhs.args] - put(lhs.op,'macro, + put(lhs.op,"macro", ['%mlambda,parms,applySubst(pairList(lhs.args,parms),rhs)],e) --% Syntax manipulation diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot index e25e6290..fbab587a 100644 --- a/src/interp/i-syscmd.boot +++ b/src/interp/i-syscmd.boot @@ -1016,35 +1016,35 @@ displayMacros names == -- first do user defined ones first := true - for macro in macros repeat - symbolMember?(macro,pmacs) => + for m in macros repeat + symbolMember?(m,pmacs) => if first then sayBrightly ['"%l",'"User-defined macros:"] first := nil - displayParserMacro macro - symbolMember?(macro,imacs) => 'iterate - sayBrightly ([" ",'"%b", macro, '"%d", " is not a known OpenAxiom macro."]) + displayParserMacro m + symbolMember?(m,imacs) => 'iterate + sayBrightly ([" ",'"%b", m, '"%d", " is not a known OpenAxiom macro."]) -- now system ones first := true - for macro in macros repeat - symbolMember?(macro,imacs) => - macro in pmacs => 'iterate + for m in macros repeat + symbolMember?(m,imacs) => + m in pmacs => 'iterate if first then sayBrightly ['"%l",'"System-defined macros:"] first := nil - displayMacro macro - symbolMember?(macro,pmacs) => 'iterate + displayMacro m + symbolMember?(m,pmacs) => 'iterate nil getParserMacroNames() == removeDuplicates [first mac for mac in getParserMacros()] -clearParserMacro(macro) == +clearParserMacro(m) == -- first see if it is one - not IFCDR assoc(macro, $pfMacros) => nil - $pfMacros := REMALIST($pfMacros, macro) + not IFCDR assoc(m, $pfMacros) => nil + $pfMacros := REMALIST($pfMacros, m) displayMacro name == m := isInterpMacro name diff --git a/src/interp/postpar.boot b/src/interp/postpar.boot index 3b8d9ec8..736baa83 100644 --- a/src/interp/postpar.boot +++ b/src/interp/postpar.boot @@ -217,7 +217,7 @@ postComma u == postDef: %ParseTree -> %ParseForm postDef t == t isnt [defOp,lhs,rhs] => systemErrorHere ["postDef",t] - lhs is ['macro,name] => postMDef ["==>",name,rhs] + lhs is ["macro",name] => postMDef ["==>",name,rhs] recordHeaderDocumentation nil if $maxSignatureLineNumber ~= 0 then -- cgit v1.2.3