From ba0eeb3c591ebb8e51a5ea2679749e4ceca95e08 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Sat, 26 Dec 2015 20:09:37 -0800 Subject: Rename 'lastItem' to 'last'. Remove the macro definition. --- src/boot/ast.boot | 2 +- src/boot/utility.boot | 6 +++--- src/interp/nruncomp.boot | 2 +- src/interp/sys-utility.boot | 4 ---- 4 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/boot/ast.boot b/src/boot/ast.boot index 986338f3..253002a9 100644 --- a/src/boot/ast.boot +++ b/src/boot/ast.boot @@ -1475,7 +1475,7 @@ translateForm x == x isnt [.,:.] => x x.op is 'QUOTE => x x.op is 'apply and x.args is [fun,:args] => - lastItem args = 'NIL => + last args = 'NIL => ['FUNCALL,:listMap!(butLast! x.args,function translateForm)] args is [['LIST,:ys]] => ['FUNCALL,translateForm fun,:listMap!(ys, function translateForm)] diff --git a/src/boot/utility.boot b/src/boot/utility.boot index 4d4646a5..784d4514 100644 --- a/src/boot/utility.boot +++ b/src/boot/utility.boot @@ -46,7 +46,7 @@ namespace BOOTTRAN module utility (objectMember?, symbolMember?, stringMember?, charMember?, scalarMember?, listMember?, reverse, reverse!, lastNode, append, append!, copyList, substitute, substitute!, - listMap, listMap!, butLast, butLast!, lastItem, + listMap, listMap!, butLast, butLast!, last, setDifference, setUnion, setIntersection, symbolAssoc, applySubst, applySubst!, applySubstNQ, objectAssoc, invertSubst, substTarget, substSource, @@ -59,7 +59,7 @@ module utility (objectMember?, symbolMember?, stringMember?, append!: (%List %Thing,%List %Thing) -> %List %Thing copyList: %List %Thing -> %List %Thing lastNode: %List %Thing -> %Maybe %Node %Thing - lastItem: %List %Thing -> %Thing + last: %List %Thing -> %Thing butLast: %List %Thing -> %List %Thing butLast!: %List %Thing -> %List %Thing removeSymbol: (%List %Thing, %Symbol) -> %List %Thing @@ -200,7 +200,7 @@ lastNode l == l --% return the content of the last item in the list `l'. -lastItem l == +last l == first lastNode l --% return a copy of the input list except the last cons-cell. diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot index 99fa085a..761dd2a7 100644 --- a/src/interp/nruncomp.boot +++ b/src/interp/nruncomp.boot @@ -665,7 +665,7 @@ NRTputInLocalReferences(db,bod) == bod isnt [.,:.] => nil bod is ['SPADCALL,:.] => NRTputInTail(db,bod.args) - fn := lastItem bod.args + fn := last bod.args -- The following test allows function-returning expressions fn is [elt,dom,ind] and dom ~='$ and elt in '(ELT CONST) => k := assocIndex(db,dom) => lastNode(bod).first := ['%tref,'_$,k] diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot index ce2b7838..c22a2d6f 100644 --- a/src/interp/sys-utility.boot +++ b/src/interp/sys-utility.boot @@ -378,10 +378,6 @@ displayTextFile f == finally stream ~= nil => closeStream stream ---% -macro last x == - lastNode(x).first - --% macro loopBody x == take(-2,x).first -- cgit v1.2.3