aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/c-util.boot12
-rw-r--r--src/interp/compiler.boot6
3 files changed, 16 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6ebef4bb..eb9daa09 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-08 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * interp/c-util.boot (almostPure?): New.
+ (foldExportedFunctionReferences): Use it.
+
2013-05-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
* algebra/vector.spad.pamphlet (LinearElement) [corodinates]: Tidy.
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 5a07644d..b6e253c3 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1421,6 +1421,16 @@ expandableDefinition?(vars,body) ==
['XLAM,vars',body]
nil
+++ A list of routines for diagnostic reports. These functions, in an
+++ abstract sense, have type: forall T: Type . String -> T, so they
+++ can be used in T-returning functions, for any T.
+$coreDiagnosticFunctions ==
+ '(error userError systemError)
+
+almostPure? x ==
+ ops := [:$coreDiagnosticFunctions,:$VMsideEffectFreeOperators]
+ semiSimpleRelativeTo?(x,ops)
+
++ `defs' is a list of function definitions from the current domain.
++ Walk that list and replace references to unconditional operations
++ with their corresponding linkage names.
@@ -1433,7 +1443,7 @@ foldExportedFunctionReferences defs ==
form := expandableDefinition?(vars,body) =>
registerFunctionReplacement(name,form)
second(fun) := ["LAMBDA",vars,["DECLARE",["IGNORE",last vars]],body]
- if sideEffectFree? body then
+ if almostPure? body then
registerRedexForm(name,vars,body)
lamex.absBody := body
defs
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index ef8859cb..ebc3711a 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -76,12 +76,6 @@ reshapeArgumentList: (%Form,%Sig) -> %Form
applyMapping: (%Form,%Mode,%Env,%List %Mode) -> %Maybe %Triple
-++ A list of routines for diagnostic reports. These functions, in an
-++ abstract sense, have type: forall T: Type . String -> T, so they
-++ can be used in T-returning functions, for any T.
-$coreDiagnosticFunctions ==
- '(error userError systemError)
-
$IOFormDomains ==
[$InputForm,$OutputForm,$Syntax]