Differences From Artifact [6911dbe256744186]:
- File
polemy/runtime.d
- 2010-11-24 12:32:01 - part of checkin [c75f0d5f1e] on branch trunk - Enriched the runtime. a.b is now runtime error, not undefined value if the field b does not exist. Added rand(n) and gensym(). (user: kinaba) [annotate]
To Artifact [f71ff7dc6628e423]:
- File
polemy/runtime.d
- 2010-11-25 03:32:41 - part of checkin [474c4facf0] on branch trunk - Introduced makefile to build documents. sample/macro.pmy is fully reformed. print(x) now returns x, not 0. (user: kinaba) [annotate]
78 78 t2.set(s.data, ValueLayer, v);
79 79 return t2;
80 80 });
81 81 e.addPrimitive("{}", ValueLayer, (){
82 82 return new Table;
83 83 });
84 84 // IO and others
85 - e.addPrimitive("print", ValueLayer, (Value a){ writeln(a); return new IntValue(0); });
85 + e.addPrimitive("print", ValueLayer, (Value a){ writeln(a); return a; });
86 86 e.addPrimitive("gensym", ValueLayer, (){ return new StrValue(freshVarName()); });
87 87 auto rand = Mt19937(unpredictableSeed);
88 88 e.addPrimitive("rand", ValueLayer, (IntValue n){
89 89 return new IntValue( uniform(0,cast(int)n.data.toInt(),rand) );
90 90 });
91 91 }