Differences From Artifact [eb7f695558db6c0f]:
- File
polemy/runtime.d
- 2010-11-07 14:34:29 - part of checkin [0569f7b8c2] on branch trunk - - Added function literal evaluator (i.e., closure). - Workaround for d2stacktrace's infinite-loop bug. (when std.demangle.demangle use exception inside it, it will go into an infinite loop. to avoid this, I choose to unset TraceHandler during stacktrace generation. This is far from the complete solution, but at least it should work as expected under single-thread environment...) (user: kinaba) [annotate]
To Artifact [2eb228662dba6e2d]:
- File
polemy/runtime.d
- 2010-11-07 15:03:38 - part of checkin [820e7198cc] on branch trunk - Made helloworld work. (user: kinaba) [annotate]
18 18 {
19 19 }
20 20
21 21 class UndefinedValue : Value
22 22 {
23 23 mixin SimpleConstructor;
24 24 mixin SimpleCompare;
25 + override string toString() const { return "(undefined)"; }
25 26 }
26 27
27 28 class IntValue : Value
28 29 {
29 30 BigInt data;
30 31 mixin SimpleConstructor;
31 32 mixin SimpleCompare;
33 + override string toString() const {
34 + const(char)[] cs; data.toString((const(char)[] s){cs=s;}, null);
35 + return to!string(cs);
36 + }
32 37 }
33 38
34 39 class StrValue : Value
35 40 {
36 41 string data;
37 42 mixin SimpleConstructor;
38 43 mixin SimpleCompare;
44 + override string toString() const { return data; }
39 45 }
40 46
41 47 class FunValue : Value
42 48 {
43 49 Value delegate(immutable LexPosition pos, Value[]) data;
44 50 mixin SimpleConstructor;
45 51 Value call(immutable LexPosition pos, Value[] args) { return data(pos,args); }
52 + override string toString() const { return sprintf!"(function:%s:%s)"(data.ptr,data.funcptr); }
46 53 }
47 54 import std.stdio;
48 55 class Context
49 56 {
50 57 Context parent;
51 58 Value[string] table;
52 59 this(Context parent = null) { this.parent = parent; }