aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-05-31 20:35:23 +0000
committerdos-reis <gdr@axiomatics.org>2010-05-31 20:35:23 +0000
commita1eeda981dd4d753a805ff4a13a4ef26d167a7fb (patch)
tree0618ba4d65441897c18e85942a75ce485387356d /src
parentb34d97dda5ce8c88d31412d11b1ad67da058480e (diff)
downloadopen-axiom-a1eeda981dd4d753a805ff4a13a4ef26d167a7fb.tar.gz
* interp/compiler.boot (compWithMappingMode): Handle lambda
expressions as mapping.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/compiler.boot1
-rw-r--r--src/interp/g-opt.boot4
-rw-r--r--src/interp/g-util.boot14
4 files changed, 19 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f93ba384..37818c86 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-31 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * interp/compiler.boot (compWithMappingMode): Handle lambda
+ expressions as mapping.
+
2010-05-30 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/c-util.boot (middleEndExpand): Tidy.
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 6bad4fcb..0fd20551 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -360,6 +360,7 @@ compWithMappingMode(x,m is ["Mapping",m',:sl],oldE) ==
if get(x,"modemap",$CategoryFrame) is [[[.,target,:argModeList],.],:.] and
(and/[extendsCategoryForm("$",s,mode) for mode in argModeList for s in sl]
) and extendsCategoryForm("$",target,m') then return [x,m,e]
+ x is ["+->",:.] => compLambda(x,m,oldE)
if string? x then x:= INTERN x
for m in sl for v in (vl:= take(#sl,$FormalMapVariableList)) repeat
[.,.,e]:= compMakeDeclaration(v,m,e)
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index bf094be5..953efd3f 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -404,9 +404,9 @@ $VMsideEffectFreeOperators ==
MINUSP GREATERP ZEROP ODDP FLOAT_-RADIX FLOAT FLOAT_-SIGN FLOAT_-DIGITS
CGREATERP GGREATERP CHAR BOOLE GET BVEC_-GREATER FUNCALL %false %true
%and %or %not %eq %ieq %ilt %ile %igt %ige %head %tail %integer?
- %imul %iadd %isub %igcd %ilcm %ipow %imin %imax %ieven? %iodd?
+ %imul %iadd %isub %igcd %ilcm %ipow %imin %imax %ieven? %iodd? %iinc
%feq %flt %fle %fgt %fge %fmul %fadd %fsub %fexp %fmin %fmax
- %fpow %nil %pair?)
+ %fpow %nil %pair? %lconcat %llength %hash %ismall?)
++ List of simple VM operators
$simpleVMoperators ==
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 5e1a228a..6d19f0dd 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -255,12 +255,14 @@ for x in [
['%ineg, :"-"],
['%integer?,:'INTEGERP],
['%iodd?, :'ODDP],
+ ['%ismall?, :'FIXNUMP],
-- binary integer operations.
['%iadd,:"+"],
['%ieq, :"EQL"],
['%igcd,:'GCD],
['%ige, :">="],
['%igt, :">"],
+ ['%iinc,:"1+"],
['%ilcm,:'LCM],
['%ile, :"<="],
['%ilt, :"<"],
@@ -287,9 +289,15 @@ for x in [
-- list contants
-- ['%nil, :'NIL],
-- unary list operations
- ['%head,:'CAR],
- ['%pair?, :'CONSP],
- ['%tail,:'CDR]
+ ['%head, :'CAR],
+ ['%llength, :'LIST_-LENGTH],
+ ['%pair?, :'CONSP],
+ ['%tail, :'CDR],
+ -- binary list operations
+ ['%lconcat, :'APPEND],
+
+ -- general utility
+ ['%hash,:'SXHASH]
] repeat property(first x,'%Rename) := rest x
++ Table of opcode-expander pairs.