summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-03-13 15:33:17 +0000
committerpaltherr <paltherr@epfl.ch>2003-03-13 15:33:17 +0000
commit7c50acd7bc54a16c54996be5c7b86406c94c8b49 (patch)
tree42f4273816bfef016a4417607cac012b87afddb4 /sources
parentb8ae1b5fd81eeab34a628b0a4da75f56a5f89e2e (diff)
downloadscala-7c50acd7bc54a16c54996be5c7b86406c94c8b49.tar.gz
scala-7c50acd7bc54a16c54996be5c7b86406c94c8b49.tar.bz2
scala-7c50acd7bc54a16c54996be5c7b86406c94c8b49.zip
- Updated evaluator to cope with module singlet...
- Updated evaluator to cope with module singleton initialization in module constructor
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/scalai/Evaluator.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/sources/scala/tools/scalai/Evaluator.java b/sources/scala/tools/scalai/Evaluator.java
index 07b5b025f8..25a0553843 100644
--- a/sources/scala/tools/scalai/Evaluator.java
+++ b/sources/scala/tools/scalai/Evaluator.java
@@ -358,6 +358,9 @@ public class Evaluator {
// !!! System.out.println("!!! store Context: level = " + level + ", index = " + index);
return variables[level][index] = value;
+ case Module(_, _):
+ return ((Variable.Module)variable).value = value;
+
case Member(int index):
// !!! handle case where object is null
// !!! System.out.println("!!! store Member: index = " + index + ", length = " + getScalaObject(object).variables.length);
@@ -405,12 +408,10 @@ public class Evaluator {
return variables[level][index];
case Module(CodePromise body, Object value):
- if (value == null) {
- // !!!
- ((Variable.Module)variable).value = value = evaluate(body.force().code);
- ((Variable.Module)variable).body = null;
- }
- return value;
+ if (value != null) return value;
+ ((Variable.Module)variable).body = null;
+ evaluate(body.force().code);
+ return load(object, variable);
case Member(int index):
// !!! handle case where object is null