diff options
Diffstat (limited to 'src/boot')
-rw-r--r-- | src/boot/ast.boot | 6 | ||||
-rw-r--r-- | src/boot/parser.boot | 32 | ||||
-rw-r--r-- | src/boot/strap/ast.clisp | 6 | ||||
-rw-r--r-- | src/boot/utility.boot | 6 |
4 files changed, 26 insertions, 24 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot index 632fdc47..c741a315 100644 --- a/src/boot/ast.boot +++ b/src/boot/ast.boot @@ -608,11 +608,11 @@ defSheepAndGoats(tu,x)== bfTupleP args => rest args [args] argl = nil => - opassoc := [[op,:body]] + opassoc := [[op,:translateForm body]] [opassoc,[],[]] op1 := makeSymbol strconc(symbolName enclosingFunction tu,'",",symbolName op) opassoc := [[op,:op1]] - defstack := [[op1,args,body]] + defstack := [[op1,args,translateForm body]] [opassoc,defstack,[]] %Pile defs => defSheepAndGoatsList(tu,defs) otherwise => [[],[],[x]] @@ -837,7 +837,7 @@ bfReName x== sequence?(x,pred) == x is ['QUOTE,seq] and cons? seq and - "and"/[apply(pred,y,nil) for y in seq] + "and"/[apply(pred,[y]) for y in seq] idList? x == x is ["LIST",:.] and "and"/[defQuoteId arg for arg in x.args] diff --git a/src/boot/parser.boot b/src/boot/parser.boot index fe167c4c..e390894b 100644 --- a/src/boot/parser.boot +++ b/src/boot/parser.boot @@ -111,7 +111,7 @@ bpNextToken ps == bpFirstToken ps bpRequire(ps,f) == - apply(f,ps,nil) or bpTrap ps + apply(f,[ps]) or bpTrap ps bpState ps == [parserTokens ps,parserTrees ps,parserNesting ps,parserScope ps] @@ -154,7 +154,7 @@ bpIndentParenthesized(ps,f) == bpEqPeek(ps,"OPAREN") => parserNesting(ps) := parserNesting ps + 1 bpNext ps - apply(f,ps,nil) and bpFirstTok ps and + apply(f,[ps]) and bpFirstTok ps and (bpEqPeek(ps,"CPAREN") or bpParenTrap(ps,a)) => parserNesting(ps) := parserNesting ps - 1 bpNextToken ps @@ -177,7 +177,7 @@ bpIndentParenthesized(ps,f) == bpParenthesized(ps,f) == a := parserCurrentToken ps bpEqKey(ps,"OPAREN") => - apply(f,ps,nil) and (bpEqKey(ps,"CPAREN") or bpParenTrap(ps,a)) => true + apply(f,[ps]) and (bpEqKey(ps,"CPAREN") or bpParenTrap(ps,a)) => true bpEqKey(ps,"CPAREN") => bpPush(ps,bfTuple []) true @@ -187,7 +187,7 @@ bpParenthesized(ps,f) == bpBracket(ps,f) == a := parserCurrentToken ps bpEqKey(ps,"OBRACK") => - apply(f,ps,nil) and (bpEqKey(ps,"CBRACK") or bpBrackTrap(ps,a)) => + apply(f,[ps]) and (bpEqKey(ps,"CBRACK") or bpBrackTrap(ps,a)) => bpPush(ps,bfBracket bpPop1 ps) bpEqKey(ps,"CBRACK") => bpPush(ps,[]) bpBrackTrap(ps,a) @@ -196,13 +196,13 @@ bpBracket(ps,f) == bpPileBracketed(ps,f) == bpEqKey(ps,"SETTAB") => bpEqKey(ps,"BACKTAB") => true - apply(f,ps,nil) and (bpEqKey(ps,"BACKTAB") or bpPileTrap ps) => + apply(f,[ps]) and (bpEqKey(ps,"BACKTAB") or bpPileTrap ps) => bpPush(ps,bfPile bpPop1 ps) false false bpListof(ps,f,str1,g)== - apply(f,ps,nil) => + apply(f,[ps]) => bpEqKey(ps,str1) and bpRequire(ps,f) => a := parserTrees ps parserTrees(ps) := nil @@ -215,18 +215,18 @@ bpListof(ps,f,str1,g)== -- to do ,<backset> bpListofFun(ps,f,h,g)== - apply(f,ps,nil) => - apply(h,ps,nil) and bpRequire(ps,f) => + apply(f,[ps]) => + apply(h,[ps]) and bpRequire(ps,f) => a := parserTrees ps parserTrees(ps) := nil - while apply(h,ps,nil) and bpRequire(ps,f) repeat nil + while apply(h,[ps]) and bpRequire(ps,f) repeat nil parserTrees(ps) := [reverse! parserTrees ps,:a] bpPush(ps,FUNCALL(g, [bpPop3 ps,bpPop2 ps,:bpPop1 ps])) true false bpList(ps,f,str1)== - apply(f,ps,nil) => + apply(f,[ps]) => bpEqKey(ps,str1) and bpRequire(ps,f) => a := parserTrees ps parserTrees(ps) := nil @@ -237,10 +237,10 @@ bpList(ps,f,str1)== bpPush(ps,nil) bpOneOrMore(ps,f) == - apply(f,ps,nil)=> + apply(f,[ps])=> a := parserTrees ps parserTrees(ps) := nil - while apply(f,ps,nil) repeat nil + while apply(f,[ps]) repeat nil parserTrees(ps) := [reverse! parserTrees ps,:a] bpPush(ps,[bpPop2 ps,:bpPop1 ps]) false @@ -248,7 +248,7 @@ bpOneOrMore(ps,f) == -- s must transform the head of the stack bpAnyNo(ps,s) == - while apply(s,ps,nil) repeat nil + while apply(s,[ps]) repeat nil true @@ -341,7 +341,7 @@ bpListAndRecover(ps,f)== c := parserTokens ps while not done repeat found := - try apply(f,ps,nil) + try apply(f,[ps]) catch(e: BootParserException) => e if found is "TRAPPED" then @@ -721,7 +721,7 @@ bpInfGeneric(ps,s) == bpRightAssoc(ps,o,p)== a := bpState ps - apply(p,ps,nil) => + apply(p,[ps]) => while bpInfGeneric(ps,o) and (bpRightAssoc(ps,o,p) or bpTrap ps) repeat bpPush(ps,bfInfApplication(bpPop2 ps,bpPop2 ps,bpPop1 ps)) true @@ -729,7 +729,7 @@ bpRightAssoc(ps,o,p)== false bpLeftAssoc(ps,operations,parser)== - apply(parser,ps,nil) => + apply(parser,[ps]) => while bpInfGeneric(ps,operations) and bpRequire(ps,parser) repeat bpPush(ps,bfInfApplication(bpPop2 ps,bpPop2 ps,bpPop1 ps)) diff --git a/src/boot/strap/ast.clisp b/src/boot/strap/ast.clisp index 820f308e..5c3e7db8 100644 --- a/src/boot/strap/ast.clisp +++ b/src/boot/strap/ast.clisp @@ -851,7 +851,8 @@ (SETQ |argl| (COND ((|bfTupleP| |args|) (CDR |args|)) (T (LIST |args|)))) (COND - ((NULL |argl|) (SETQ |opassoc| (LIST (CONS |op| |body|))) + ((NULL |argl|) + (SETQ |opassoc| (LIST (CONS |op| (|translateForm| |body|)))) (LIST |opassoc| NIL NIL)) (T (SETQ |op1| @@ -859,7 +860,8 @@ (CONCAT (SYMBOL-NAME (|enclosingFunction| |tu|)) "," (SYMBOL-NAME |op|)))) (SETQ |opassoc| (LIST (CONS |op| |op1|))) - (SETQ |defstack| (LIST (LIST |op1| |args| |body|))) + (SETQ |defstack| + (LIST (LIST |op1| |args| (|translateForm| |body|)))) (LIST |opassoc| |defstack| NIL)))))) (|%Pile| (LET ((|defs| (CADR |x|))) diff --git a/src/boot/utility.boot b/src/boot/utility.boot index 37907145..4d4646a5 100644 --- a/src/boot/utility.boot +++ b/src/boot/utility.boot @@ -94,11 +94,11 @@ atomic? x == ++ Return the last image of `f' if all images of elements in `l' ++ are non-nil. Otherwise return nil. every?(f,l) == - and/[apply(f,x,nil) for x in l] + and/[apply(f,[x]) for x in l] ++ Return the first non-nil image of `f' of elements in `l'. any?(f,l) == - or/[apply(f,x,nil) for x in l] + or/[apply(f,[x]) for x in l] ++ Return the `n' node prefixes of the list `l'. If `n' is negative, ++ take from the end of the list. @@ -108,7 +108,7 @@ take(n,l) == ++ Return the sublist of `l' whose elements have non-nil image by `f'. takeWhile(f,l) == - [x for x in l while apply(f,x,nil)] + [x for x in l while apply(f,[x])] ++ Return the `n+1'th node and its successors of the list `l'. ++ If `n' is negative, drop from the end. |