diff options
author | Gabriel Dos Reis <gdr@axiomatics.org> | 2016-01-06 09:47:36 -0800 |
---|---|---|
committer | Gabriel Dos Reis <gdr@axiomatics.org> | 2016-01-06 09:47:36 -0800 |
commit | aef653a1712e6273f9b4ab5152d3b02a2989b8d0 (patch) | |
tree | d762fb5c1a0cec57261cad7a19323c063fb29deb /src/interp/functor.boot | |
parent | 390e8b6664a6e5fd58111b8d650d176825a877d3 (diff) | |
download | open-axiom-aef653a1712e6273f9b4ab5152d3b02a2989b8d0.tar.gz |
optFunctorBody: Take a DB argument.
Diffstat (limited to 'src/interp/functor.boot')
-rw-r--r-- | src/interp/functor.boot | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/interp/functor.boot b/src/interp/functor.boot index 9579defb..378f8b28 100644 --- a/src/interp/functor.boot +++ b/src/interp/functor.boot @@ -244,22 +244,22 @@ compCategories1(db,u,v,e) == [c,:.] := comp(macroExpand(u,e),v,e) => c error 'compCategories1 -optFunctorBody x == +optFunctorBody(db,x) == atomic? x => x x is ['DomainSubstitutionMacro,parms,body] => - optFunctorBody DomainSubstitutionFunction(parms,body) + optFunctorBody(db,DomainSubstitutionFunction(parms,body)) x is ['%list,:l] => null l => nil - l:= [optFunctorBody u for u in l] + l:= [optFunctorBody(db,u) for u in l] every?(function optFunctorBodyQuotable,l) => quote [optFunctorBodyRequote u for u in l] ['%list,:l] - x is ['PROGN,:l] => ['%seq,:optFunctorPROGN l] + x is ['PROGN,:l] => ['%seq,:optFunctorPROGN(db,l)] x is ['%when,:l] => - l := [v for u in l | v := relevantClause u] where - relevantClause u == + l := [v for u in l | v := relevantClause(db,u)] where + relevantClause(db,u) == u is [pred,:conseq] => - u := [optFunctorBody pred,:optFunctorPROGN conseq] + u := [optFunctorBody(db,pred),:optFunctorPROGN(db,conseq)] u is ['%otherwise] => nil u nil @@ -273,7 +273,7 @@ optFunctorBody x == first pred="HasCategory" => nil ['%when,:l] ['%when,:l] - [optFunctorBody first x,:optFunctorBody rest x] + [optFunctorBody(db,first x),:optFunctorBody(db,rest x)] optFunctorBodyQuotable u == u = nil or integer? u or string? u => true @@ -286,17 +286,17 @@ optFunctorBodyRequote u == u is ['QUOTE,v] => v systemErrorHere ["optFunctorBodyRequote",u] -optFunctorPROGN l == +optFunctorPROGN(db,l) == l is [x,:l'] => - worthlessCode x => optFunctorPROGN l' - l':= optFunctorBody l' - l' is [nil] => [optFunctorBody x] - [optFunctorBody x,:l'] + worthlessCode(db,x) => optFunctorPROGN(db,l') + l':= optFunctorBody(db,l') + l' is [nil] => [optFunctorBody(db,x)] + [optFunctorBody(db,x),:l'] l -worthlessCode x == - x is ['%when,:l] => and/[x is [.,y] and worthlessCode y for x in l] - x is ['PROGN,:l] => optFunctorPROGN l = nil +worthlessCode(db,x) == + x is ['%when,:l] => and/[x is [.,y] and worthlessCode(db,y) for x in l] + x is ['PROGN,:l] => optFunctorPROGN(db,l) = nil x is ['%list] => true x = nil => true false |