diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 8 | ||||
-rw-r--r-- | src/algebra/boolean.spad.pamphlet | 3 | ||||
-rw-r--r-- | src/algebra/mkfunc.spad.pamphlet | 11 | ||||
-rw-r--r-- | src/interp/i-intern.boot | 9 |
4 files changed, 22 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 33582967..851cbdf4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2008-10-01 Gabriel Dos Reis <gdr@cs.tamu.edu> + * algebra/mkfunc.spad.pamphlet (InputForm): Remove local mkProperOp. + (compile$InputForm): Tidy. + * algebra/boolean.spad.pamphlet (setelt$IndexedBits): A bit is + not a Boolean. + * interp/i-intern.boot (mkAtreeForToken): New. + +2008-10-01 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/c-util.boot ($optProclaim): New. ($optReplaceSimpleFunctions): Likewise. (setCompilerOptimizations): Likewise. Set them. diff --git a/src/algebra/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet index cee0e13d..07e5df47 100644 --- a/src/algebra/boolean.spad.pamphlet +++ b/src/algebra/boolean.spad.pamphlet @@ -471,7 +471,8 @@ IndexedBits(mn:Integer): BitAggregate() with _or(u, v) == (#v=#u => BVEC_-OR(v, u)$Lisp; map("or", v,u)) xor(v,u) == (#v=#u => BVEC_-XOR(v,u)$Lisp; map("xor",v,u)) setelt(v:%, i:Integer, f:Boolean) == - BVEC_-SETELT(v, range(v, i-mn), TRUTH_-TO_-BIT(f)$Lisp)$Lisp + BIT_-TO_-TRUTH(BVEC_-SETELT(v, range(v, i-mn), + TRUTH_-TO_-BIT(f)$Lisp)$Lisp)$Lisp elt(v:%, i:Integer) == BIT_-TO_-TRUTH(BVEC_-ELT(v, range(v, i-mn))$Lisp)$Lisp diff --git a/src/algebra/mkfunc.spad.pamphlet b/src/algebra/mkfunc.spad.pamphlet index 39c47899..a0edac2d 100644 --- a/src/algebra/mkfunc.spad.pamphlet +++ b/src/algebra/mkfunc.spad.pamphlet @@ -83,7 +83,6 @@ InputForm(): == SExpression add Rep := SExpression - mkProperOp: Symbol -> % strsym : % -> String tuplify : List Symbol -> % flatten0 : (%, Symbol, NonNegativeInteger) -> @@ -148,15 +147,11 @@ InputForm(): name compile(name, types) == + name' := convert(name)@% symbol car cdr car - selectLocalMms(mkProperOp name, convert(name)@%, + selectLocalMms(mkAtreeForToken(name')$Lisp, name', types, nil$List(%))$Lisp - mkProperOp name == - op := mkAtree(nme := convert(name)@%)$Lisp - transferPropsToNode(nme, op)$Lisp - convert op - binary(op, args) == (n := #args) < 2 => error "Need at least 2 arguments" n = 2 => convert([op, first args, last args]$List(%)) @@ -165,7 +160,7 @@ InputForm(): tuplify l == empty? rest l => convert first l conv - concat(convert("Tuple"::Symbol), [convert x for x in l]$List(%)) + concat(convert("tuple"::Symbol), [convert x for x in l]$List(%)) function(f, l, name) == nn := convert(new(1 + #l, convert(nil()$List(%)))$List(%))@% diff --git a/src/interp/i-intern.boot b/src/interp/i-intern.boot index 055fc160..11ff1a4a 100644 --- a/src/interp/i-intern.boot +++ b/src/interp/i-intern.boot @@ -517,3 +517,12 @@ transformCollect [:itrl,body] == it is ["|",pred] => nil [:iterList,bodyTree] +--% + +++ Make a VAT for the symbol `x' and collect all known information +++ about `x' in the current environment into the new VAT. +++ Note: This routine is used in the algebra interface to the interpreter. +mkAtreeForToken: %Symbol -> %Shell +mkAtreeForToken x == + t := mkAtreeNode x + transferPropsToNode(x,t) |