Browse Source

missing examples directory

Nicolas Petton 12 years ago
parent
commit
448b7fa504
47 changed files with 29949 additions and 0 deletions
  1. 4 0
      examples/README
  2. 9 0
      examples/nodejs/README
  3. 161 0
      examples/nodejs/benchfib/Benchfib.js
  4. 124 0
      examples/nodejs/benchfib/Benchfib.st
  5. 8 0
      examples/nodejs/benchfib/Makefile
  6. 6409 0
      examples/nodejs/benchfib/Program.js
  7. 1 0
      examples/nodejs/benchfib/benchfib
  8. 18 0
      examples/nodejs/hello/Hello.js
  9. 9 0
      examples/nodejs/hello/Hello.st
  10. 8 0
      examples/nodejs/hello/Makefile
  11. 6409 0
      examples/nodejs/hello/Program.js
  12. 13 0
      examples/nodejs/hello/README
  13. 1 0
      examples/nodejs/hello/hello
  14. 8 0
      examples/nodejs/meta/Makefile
  15. 30 0
      examples/nodejs/meta/MyScript.js
  16. 23 0
      examples/nodejs/meta/MyScript.st
  17. 6409 0
      examples/nodejs/meta/Program.js
  18. 1 0
      examples/nodejs/meta/meta
  19. 8 0
      examples/nodejs/pystone/Makefile
  20. 6409 0
      examples/nodejs/pystone/Program.js
  21. 232 0
      examples/nodejs/pystone/Pystone.js
  22. 306 0
      examples/nodejs/pystone/Pystone.st
  23. 1 0
      examples/nodejs/pystone/pystone
  24. 8 0
      examples/nodejs/trivialserver/Makefile
  25. 51 0
      examples/nodejs/trivialserver/TrivialServer.st
  26. 1 0
      examples/nodejs/trivialserver/trivial
  27. 826 0
      examples/trysmalltalk/TrySmalltalk.deploy.js
  28. 1118 0
      examples/trysmalltalk/TrySmalltalk.js
  29. 958 0
      examples/trysmalltalk/TrySmalltalk.st
  30. 11 0
      examples/webos/README
  31. BIN
      examples/webos/eris/DuckQwaq.wav
  32. 36 0
      examples/webos/eris/EnyoJtalk.st
  33. 0 0
      examples/webos/eris/Eris.css
  34. 86 0
      examples/webos/eris/Eris.st
  35. 37 0
      examples/webos/eris/Makefile
  36. 3 0
      examples/webos/eris/README
  37. 10 0
      examples/webos/eris/appinfo.json
  38. 4 0
      examples/webos/eris/depends.js
  39. 12 0
      examples/webos/eris/index.html
  40. 36 0
      examples/webos/hellojtalk/EnyoJtalk.st
  41. 0 0
      examples/webos/hellojtalk/HelloJtalk.css
  42. 86 0
      examples/webos/hellojtalk/HelloJtalk.st
  43. 38 0
      examples/webos/hellojtalk/Makefile
  44. 1 0
      examples/webos/hellojtalk/README
  45. 10 0
      examples/webos/hellojtalk/appinfo.json
  46. 4 0
      examples/webos/hellojtalk/depends.js
  47. 12 0
      examples/webos/hellojtalk/index.html

+ 4 - 0
examples/README

@@ -0,0 +1,4 @@
+Here you will find examples for command line usage of Jtalk
+that you can typically make and run using "make run".
+
+Sub directories are for different target platforms.

+ 9 - 0
examples/nodejs/README

@@ -0,0 +1,9 @@
+JTalk + Node.js = Awesomeness
+=============================
+These are some experiments of using JTalk together with Node.js:
+
+hello           - Hello world example with a simple Makefile.
+benchfib        - Port of tinybenchmarks from Squeak.
+trivialserver   - A slightly larger example.
+
+You will need "node" in your path to try all the above.

+ 161 - 0
examples/nodejs/benchfib/Benchfib.js

@@ -0,0 +1,161 @@
+smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
+
+smalltalk.addMethod(
+'_main',
+smalltalk.method({
+selector: 'main',
+category: 'not yet classified',
+fn: function (){
+var self=this;
+var result=nil;
+result=smalltalk.send((0), "_tinyBenchmarks", []);
+smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("0%20tinyBenchmarks%20%3D%3E%20"), "__comma", [smalltalk.send(result, "_asString", [])])]);
+result=smalltalk.send((0), "_jstinyBenchmarks", []);
+smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("0%20jstinyBenchmarks%20%3D%3E%20"), "__comma", [smalltalk.send(result, "_asString", [])])]);
+return self;},
+source: unescape('main%0A%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%200%20tinyBenchmarks.%0A%09console%20log%3A%20%270%20tinyBenchmarks%20%3D%3E%20%27%20%2C%20result%20asString.%0A%09result%20%3A%3D%200%20jstinyBenchmarks.%0A%09console%20log%3A%20%270%20jstinyBenchmarks%20%3D%3E%20%27%20%2C%20result%20asString'),
+messageSends: ["tinyBenchmarks", "log:", unescape("%2C"), "asString", "jstinyBenchmarks"],
+referencedClasses: []
+}),
+smalltalk.Benchfib.klass);
+
+
+smalltalk.addMethod(
+'_benchFib',
+smalltalk.method({
+selector: 'benchFib',
+category: '*Benchfib',
+fn: function (){
+var self=this;
+return (($receiver = self < (2)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (1);})() : (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (1);}), (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
+return self;},
+source: unescape('benchFib%0A%09%22Handy%20send-heavy%20benchmark%22%0A%09%22%28result%20//%20seconds%20to%20run%29%20%3D%20approx%20calls%20per%20second%22%0A%09%22%20%7C%20r%20t%20%7C%0A%09%20%20t%20%3A%3D%20Time%20millisecondsToRun%3A%20%5Br%20%3A%3D%2026%20benchFib%5D.%0A%09%20%20%28r%20*%201000%29%20//%20t%22%0A%09%22138000%20on%20a%20Mac%208100/100%22%0A%09%5E%20self%20%3C%202%0A%09%09ifTrue%3A%20%5B1%5D%20%0A%09%09ifFalse%3A%20%5B%28self-1%29%20benchFib%20+%20%28self-2%29%20benchFib%20+%201%5D'),
+messageSends: ["ifTrue:ifFalse:", unescape("%3C"), unescape("+"), "benchFib", unescape("-")],
+referencedClasses: []
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+'_benchmark',
+smalltalk.method({
+selector: 'benchmark',
+category: '*Benchfib',
+fn: function (){
+var self=this;
+var size=nil;
+var flags=nil;
+var prime=nil;
+var k=nil;
+var count=nil;
+size=(8190);
+smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send((smalltalk.Array || Array), "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return (($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);})]);})]);
+return count;
+return self;},
+source: unescape('benchmark%20%20%22Handy%20bytecode-heavy%20benchmark%22%0A%09%22%28500000%20//%20time%20to%20run%29%20%3D%20approx%20bytecodes%20per%20second%22%0A%09%225000000%20//%20%28Time%20millisecondsToRun%3A%20%5B10%20benchmark%5D%29%20*%201000%22%0A%09%223059000%20on%20a%20Mac%208100/100%22%0A%20%20%20%20%7C%20size%20flags%20prime%20k%20count%20%7C%0A%20%20%20%20size%20%3A%3D%208190.%0A%20%20%20%201%20to%3A%20self%20do%3A%0A%20%20%20%20%20%20%20%20%5B%3Aiter%20%7C%0A%20%20%20%20%20%20%20%20count%20%3A%3D%200.%0A%20%20%20%20%20%20%20%20flags%20%3A%3D%20Array%20new.%0A%20%20%20%20%20%20%20%20size%20timesRepeat%3A%20%5B%20flags%20add%3A%20true%5D.%0A%20%20%20%20%20%20%20%201%20to%3A%20size%20do%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%5B%3Ai%20%7C%20%28flags%20at%3A%20i%29%20ifTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bprime%20%3A%3D%20i+1.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20i%20+%20prime.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bk%20%3C%3D%20size%5D%20whileTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bflags%20at%3A%20k%20put%3A%20false.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20k%20+%20prime%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20count%20%3A%3D%20count%20+%201%5D%5D%5D.%0A%20%20%20%20%5E%20count'),
+messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "at:", unescape("+"), "whileTrue:", unescape("%3C%3D"), "at:put:"],
+referencedClasses: [smalltalk.Array]
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+'_tinyBenchmarks',
+smalltalk.method({
+selector: 'tinyBenchmarks',
+category: '*Benchfib',
+fn: function (){
+var self=this;
+var t1=nil;
+var t2=nil;
+var r=nil;
+var n1=nil;
+var n2=nil;
+n1=(1);
+(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
+n2=(28);
+(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
+return self;},
+source: unescape('tinyBenchmarks%0A%09%22Report%20the%20results%20of%20running%20the%20two%20tiny%20Squeak%20benchmarks.%0A%09ar%209/10/1999%3A%20Adjusted%20to%20run%20at%20least%201%20sec%20to%20get%20more%20stable%20results%22%0A%09%220%20tinyBenchmarks%22%0A%09%22On%20a%20292%20MHz%20G3%20Mac%3A%2022727272%20bytecodes/sec%3B%20984169%20sends/sec%22%0A%09%22On%20a%20400%20MHz%20PII/Win98%3A%20%2018028169%20bytecodes/sec%3B%201081272%20sends/sec%22%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20benchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2028.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20benchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23benchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
+messageSends: ["whileTrue:", "millisecondsToRun:", "benchmark", unescape("%3C"), unescape("*"), "benchFib", unescape("+"), unescape("%2C"), "printString", unescape("/")],
+referencedClasses: [smalltalk.Date]
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+'_jsbenchFib',
+smalltalk.method({
+selector: 'jsbenchFib',
+category: '*Benchfib',
+fn: function (){
+var self=this;
+if (this < 2) {
+return 1;
+} else {
+return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
+return self;},
+source: unescape('jsbenchFib%0A%20%0A%09%3Cif%20%28this%20%3C%202%29%20%7B%0Areturn%201%3B%0A%7D%20else%20%7B%0Areturn%20%28this-1%29._jsbenchFib%28%29%20+%20%28this-2%29._jsbenchFib%28%29%20+%201%3B%7D%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+'_jsbenchmark',
+smalltalk.method({
+selector: 'jsbenchmark',
+category: '*Benchfib',
+fn: function (){
+var self=this;
+
+var size = 8190;
+var count;
+for (var z=0;z<this;z++) {
+  count = 0;
+  var flags = new Array();
+  for (var p=0; p<size; p++) {
+    flags[p] = true;
+  }
+  for (var i=1;i<=size;i++) {
+    if (flags[i-1]) {
+      var prime = i+1;
+      var k = i + prime;
+      while (k <= size) {
+        flags[k-1] = false;
+        k = k + prime;
+      }
+      count = count + 1;
+    }
+  }
+}
+return count;
+return self;},
+source: unescape('jsbenchmark%0A%0A%3C%0Avar%20size%20%3D%208190%3B%0Avar%20count%3B%0Afor%20%28var%20z%3D0%3Bz%3Cthis%3Bz++%29%20%7B%0A%20%20count%20%3D%200%3B%0A%20%20var%20flags%20%3D%20new%20Array%28%29%3B%0A%20%20for%20%28var%20p%3D0%3B%20p%3Csize%3B%20p++%29%20%7B%0A%20%20%20%20flags%5Bp%5D%20%3D%20true%3B%0A%20%20%7D%0A%20%20for%20%28var%20i%3D1%3Bi%3C%3Dsize%3Bi++%29%20%7B%0A%20%20%20%20if%20%28flags%5Bi-1%5D%29%20%7B%0A%20%20%20%20%20%20var%20prime%20%3D%20i+1%3B%0A%20%20%20%20%20%20var%20k%20%3D%20i%20+%20prime%3B%0A%20%20%20%20%20%20while%20%28k%20%3C%3D%20size%29%20%7B%0A%20%20%20%20%20%20%20%20flags%5Bk-1%5D%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20k%20%3D%20k%20+%20prime%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20count%20%3D%20count%20+%201%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0Areturn%20count%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+'_jstinyBenchmarks',
+smalltalk.method({
+selector: 'jstinyBenchmarks',
+category: '*Benchfib',
+fn: function (){
+var self=this;
+var t1=nil;
+var t2=nil;
+var r=nil;
+var n1=nil;
+var n2=nil;
+n1=(1);
+(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
+n2=(28);
+(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
+return self;},
+source: unescape('jstinyBenchmarks%0A%09%220%20jstinyBenchmarks%22%0A%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20jsbenchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2028.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20jsbenchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23jsbenchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
+messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", unescape("%3C"), unescape("*"), "jsbenchFib", unescape("+"), unescape("%2C"), "printString", unescape("/")],
+referencedClasses: [smalltalk.Date]
+}),
+smalltalk.Number);
+

+ 124 - 0
examples/nodejs/benchfib/Benchfib.st

@@ -0,0 +1,124 @@
+Object subclass: #Benchfib
+	instanceVariableNames: ''
+	category: 'Benchfib'!
+
+!Benchfib class methodsFor: 'not yet classified'!
+
+main
+
+	| result |
+	result := 0 tinyBenchmarks.
+	console log: '0 tinyBenchmarks => ' , result asString.
+	result := 0 jstinyBenchmarks.
+	console log: '0 jstinyBenchmarks => ' , result asString
+! !
+
+!Number methodsFor: '*Benchfib'!
+
+benchFib
+	"Handy send-heavy benchmark"
+	"(result // seconds to run) = approx calls per second"
+	" | r t |
+	  t := Time millisecondsToRun: [r := 26 benchFib].
+	  (r * 1000) // t"
+	"138000 on a Mac 8100/100"
+	^ self < 2
+		ifTrue: [1] 
+		ifFalse: [(self-1) benchFib + (self-2) benchFib + 1]
+!
+
+benchmark  "Handy bytecode-heavy benchmark"
+	"(500000 // time to run) = approx bytecodes per second"
+	"5000000 // (Time millisecondsToRun: [10 benchmark]) * 1000"
+	"3059000 on a Mac 8100/100"
+    | size flags prime k count |
+    size := 8190.
+    1 to: self do:
+        [:iter |
+        count := 0.
+        flags := Array new.
+        size timesRepeat: [ flags add: true].
+        1 to: size do:
+            [:i | (flags at: i) ifTrue:
+                [prime := i+1.
+                k := i + prime.
+                [k <= size] whileTrue:
+                    [flags at: k put: false.
+                    k := k + prime].
+                count := count + 1]]].
+    ^ count
+!
+
+tinyBenchmarks
+	"Report the results of running the two tiny Squeak benchmarks.
+	ar 9/10/1999: Adjusted to run at least 1 sec to get more stable results"
+	"0 tinyBenchmarks"
+	"On a 292 MHz G3 Mac: 22727272 bytecodes/sec; 984169 sends/sec"
+	"On a 400 MHz PII/Win98:  18028169 bytecodes/sec; 1081272 sends/sec"
+	| t1 t2 r n1 n2 |
+	n1 := 1.
+	[t1 := Date millisecondsToRun: [n1 benchmark].
+	t1 < 1000] whileTrue:[n1 := n1 * 2]. "Note: #benchmark's runtime is about O(n)"
+
+	n2 := 28.
+	[t2 := Date millisecondsToRun: [r := n2 benchFib].
+	t2 < 1000] whileTrue:[n2 := n2 + 1]. 
+	"Note: #benchFib's runtime is about O(k^n),
+		where k is the golden number = (1 + 5 sqrt) / 2 = 1.618...."
+
+	^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',
+	  ((r * 1000) / t2) printString, ' sends/sec'
+!
+
+jsbenchFib
+ 
+	<if (this < 2) {
+return 1;
+} else {
+return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;}>
+!
+
+jsbenchmark
+
+<
+var size = 8190;
+var count;
+for (var z=0;z<this;z++) {
+  count = 0;
+  var flags = new Array();
+  for (var p=0; p<size; p++) {
+    flags[p] = true;
+  }
+  for (var i=1;i<=size;i++) {
+    if (flags[i-1]) {
+      var prime = i+1;
+      var k = i + prime;
+      while (k <= size) {
+        flags[k-1] = false;
+        k = k + prime;
+      }
+      count = count + 1;
+    }
+  }
+}
+return count>
+!
+
+jstinyBenchmarks
+	"0 jstinyBenchmarks"
+
+	| t1 t2 r n1 n2 |
+	n1 := 1.
+	[t1 := Date millisecondsToRun: [n1 jsbenchmark].
+	t1 < 1000] whileTrue:[n1 := n1 * 2]. "Note: #benchmark's runtime is about O(n)"
+
+	n2 := 28.
+	[t2 := Date millisecondsToRun: [r := n2 jsbenchFib].
+	t2 < 1000] whileTrue:[n2 := n2 + 1]. 
+	"Note: #jsbenchFib's runtime is about O(k^n),
+		where k is the golden number = (1 + 5 sqrt) / 2 = 1.618...."
+
+	^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',
+	  ((r * 1000) / t2) printString, ' sends/sec'
+! !
+

+ 8 - 0
examples/nodejs/benchfib/Makefile

@@ -0,0 +1,8 @@
+Program.js: Benchfib.st
+	../../../bin/jtalkc -m Benchfib Benchfib.st Program
+
+run: Program.js
+	./benchfib
+
+clean:
+	rm -f Program.js* Benchfib.js

File diff suppressed because it is too large
+ 6409 - 0
examples/nodejs/benchfib/Program.js


+ 1 - 0
examples/nodejs/benchfib/benchfib

@@ -0,0 +1 @@
+time node Program.js $@

+ 18 - 0
examples/nodejs/hello/Hello.js

@@ -0,0 +1,18 @@
+smalltalk.addClass('Hello', smalltalk.Object, [], 'Hello');
+
+smalltalk.addMethod(
+'_main',
+smalltalk.method({
+selector: 'main',
+category: 'main',
+fn: function (){
+var self=this;
+smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", ["Hello world from JTalk in Node.js"]);
+return self;},
+source: unescape('main%0A%09console%20log%3A%20%27Hello%20world%20from%20JTalk%20in%20Node.js%27'),
+messageSends: ["log:"],
+referencedClasses: []
+}),
+smalltalk.Hello.klass);
+
+

+ 9 - 0
examples/nodejs/hello/Hello.st

@@ -0,0 +1,9 @@
+Object subclass: #Hello
+        instanceVariableNames: ''
+        category: 'Hello'!
+
+!Hello class methodsFor: 'main'!
+
+main
+	console log: 'Hello world from JTalk in Node.js'
+! ! 

+ 8 - 0
examples/nodejs/hello/Makefile

@@ -0,0 +1,8 @@
+Program.js: Hello.st
+	../../../bin/jtalkc -m Hello Hello.st Program
+
+run: Program.js
+	./hello
+
+clean:
+	rm -f Program.js Hello.js

File diff suppressed because it is too large
+ 6409 - 0
examples/nodejs/hello/Program.js


+ 13 - 0
examples/nodejs/hello/README

@@ -0,0 +1,13 @@
+Trivial Node.js example in JTalk that also uses the Google Closure compiler
+if ~/compiler.jar is present.
+
+Hello.st - source code.
+hello    - trivial bash script to run resulting program.
+Makefile - trivial makefile, read it.
+
+Hello.js - produced when you run make. Contains JTalk + Hello.st + a main call
+
+To play, do this:
+
+make
+./hello

+ 1 - 0
examples/nodejs/hello/hello

@@ -0,0 +1 @@
+node Program.js $@

+ 8 - 0
examples/nodejs/meta/Makefile

@@ -0,0 +1,8 @@
+Program.js: MyScript.st
+	../../../bin/jtalkc -L COMPILER -m MyScript MyScript.st Program
+
+run: Program.js
+	node Program.js
+
+clean:
+	rm -f Program.js MyScript.js

+ 30 - 0
examples/nodejs/meta/MyScript.js

@@ -0,0 +1,30 @@
+smalltalk.addClass('MyScript', smalltalk.Object, [], 'MyScript');
+
+smalltalk.addMethod(
+'_main',
+smalltalk.method({
+selector: 'main',
+category: 'main',
+fn: function (){
+var self=this;
+var class=nil;
+var compiler=nil;
+var method=nil;
+smalltalk.send((smalltalk.Object || Object), "_subclass_instanceVariableNames_category_", ["Dummy", "", "Dummy"]);
+class=smalltalk.send((typeof smalltalk == 'undefined' ? nil : smalltalk), "_at_", ["Dummy"]);
+compiler=smalltalk.send((smalltalk.Compiler || Compiler), "_new", []);
+method=smalltalk.send(compiler, "_load_forClass_", [unescape("foo%20%5E%2010"), class]);
+smalltalk.send(method, "_category_", ["foo"]);
+smalltalk.send(class, "_addCompiledMethod_", [method]);
+method=smalltalk.send(compiler, "_load_forClass_", [unescape("bar%20%5E%20self%20foo%20*%202"), class]);
+smalltalk.send(method, "_category_", ["foo"]);
+smalltalk.send(class, "_addCompiledMethod_", [method]);
+smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(smalltalk.send((smalltalk.Exporter || Exporter), "_new", []), "_exportCategory_", ["Dummy"])]);
+return self;},
+source: unescape('main%0A%09%7C%20class%20compiler%20method%20%7C%0A%09Object%20subclass%3A%20%23Dummy%20instanceVariableNames%3A%20%27%27%20category%3A%20%27Dummy%27.%0A%09class%20%3A%3D%20smalltalk%20at%3A%20%23Dummy.%09%0A%09compiler%20%3A%3D%20Compiler%20new.%0A%0A%09method%20%3A%3D%20compiler%20load%3A%20%27foo%20%5E%2010%27%20forClass%3A%20class.%0A%09method%20category%3A%20%27foo%27.%0A%09class%20addCompiledMethod%3A%20method.%0A%0A%09method%20%3A%3D%20compiler%20load%3A%20%27bar%20%5E%20self%20foo%20*%202%27%20forClass%3A%20class.%0A%09method%20category%3A%20%27foo%27.%0A%09class%20addCompiledMethod%3A%20method.%0A%0A%09console%20log%3A%20%28Exporter%20new%20exportCategory%3A%20%27Dummy%27%29'),
+messageSends: ["subclass:instanceVariableNames:category:", "at:", "new", "load:forClass:", "category:", "addCompiledMethod:", "log:", "exportCategory:"],
+referencedClasses: [smalltalk.Object,smalltalk.Compiler,smalltalk.Exporter]
+}),
+smalltalk.MyScript.klass);
+
+

+ 23 - 0
examples/nodejs/meta/MyScript.st

@@ -0,0 +1,23 @@
+Object subclass: #MyScript
+	instanceVariableNames: ''
+	category: 'MyScript'!
+
+!MyScript class methodsFor: 'main'!
+main
+	| klass compiler method |
+	Object subclass: #Dummy instanceVariableNames: '' category: 'Dummy'.
+	klass := smalltalk at: #Dummy.	
+	compiler := Compiler new.
+
+	method := compiler load: 'foo ^ 10' forClass: klass.
+	method category: 'foo'.
+	klass addCompiledMethod: method.
+
+	method := compiler load: 'bar ^ self foo * 2' forClass: klass.
+	method category: 'foo'.
+	klass addCompiledMethod: method.
+
+	console log: (Exporter new exportCategory: 'Dummy')
+! !
+
+

File diff suppressed because it is too large
+ 6409 - 0
examples/nodejs/meta/Program.js


+ 1 - 0
examples/nodejs/meta/meta

@@ -0,0 +1 @@
+node Program.js $@

+ 8 - 0
examples/nodejs/pystone/Makefile

@@ -0,0 +1,8 @@
+Program.js: Pystone.st
+	../../../bin/jtalkc -m Pystone Pystone.st Program
+
+run: Program.js
+	./pystone
+
+clean:
+	rm -f *.js

File diff suppressed because it is too large
+ 6409 - 0
examples/nodejs/pystone/Program.js


File diff suppressed because it is too large
+ 232 - 0
examples/nodejs/pystone/Pystone.js


+ 306 - 0
examples/nodejs/pystone/Pystone.st

@@ -0,0 +1,306 @@
+Object subclass: #PyStoneRecord
+	instanceVariableNames: 'ptrComp discr enumComp intComp stringComp'
+	category: 'Pystone'!
+!PyStoneRecord commentStamp!
+Record class used in Pystone benchmark.!
+
+!PyStoneRecord methodsFor: 'accessing'!
+
+discr
+	^discr
+!
+
+discr: p
+	discr := p
+!
+
+enumComp
+	^enumComp
+!
+
+enumComp: p
+	enumComp := p
+!
+
+intComp
+	^intComp
+!
+
+intComp: p
+	intComp := p
+!
+
+ptrComp
+	^ptrComp
+!
+
+ptrComp: p
+	ptrComp := p
+!
+
+stringComp
+	^stringComp
+!
+
+stringComp: p
+	stringComp := p
+! !
+
+!PyStoneRecord methodsFor: 'copying'!
+
+copy
+	^PyStoneRecord ptrComp: ptrComp discr: discr enumComp: enumComp intComp: intComp stringComp: stringComp
+! !
+
+!PyStoneRecord methodsFor: 'initialize-release'!
+
+ptrComp: p discr: d enumComp: e intComp: i stringComp: s
+
+	ptrComp := p.
+	discr := d.
+	enumComp := e.
+	intComp := i.
+	stringComp := s
+! !
+
+!PyStoneRecord class methodsFor: 'instance-creation'!
+
+new
+
+	^self ptrComp: nil discr: 0 enumComp: 0 intComp: 0 stringComp: 0
+!
+
+ptrComp: p discr: d enumComp: e intComp: i stringComp: s
+
+	^super new ptrComp: p discr: d enumComp: e intComp: i stringComp: s
+! !
+
+Object subclass: #Pystone
+	instanceVariableNames: 'nulltime ptrGlbNext ptrGlb ident1 ident3 ident2 ident4 ident5 ident6 intGlob boolGlob char1Glob char2Glob array1Glob array2Glob func3 func2 func1'
+	category: 'Pystone'!
+!Pystone commentStamp!
+This is a straight translation of pystone 1.1 from Python to Squeak. Procedures have been mapped to instance side methods, functions have been mapped to blocks. Open a transcript and run:
+
+Pystone run!
+
+!Pystone methodsFor: 'as yet unclassified'!
+
+defineFunctions
+	"Functions have been mapped to blocks, since that
+	would be natural."
+	
+	func1 := [:charPar1 :charPar2 |
+		| charLoc1 charLoc2 |
+		charLoc1 := charPar1.
+		charLoc2 := charLoc1.
+		(charLoc2 = charPar2) ifTrue: [ident2] ifFalse: [ident1]].
+
+	func2 := [:strParI1 :strParI2 |
+		| intLoc charLoc |
+		intLoc := 1.
+		[intLoc <= 1] whileTrue: [
+			((func1 value: (strParI1 at: intLoc) value: (strParI1 at: intLoc + 1)) = ident1)
+				ifTrue: [
+					charLoc := 'A'.
+					intLoc := intLoc + 1]].
+		(charLoc >= 'W' and: [charLoc <= 'Z']) ifTrue: [
+			intLoc := 7].
+		(charLoc = 'X') ifTrue: [true] ifFalse: [
+			(strParI1 > strParI2) ifTrue: [
+				intLoc := intLoc + 7.
+				true]
+			ifFalse: [
+				false]]].
+	
+	func3 := [:enumParIn |
+		| enumLoc |
+		enumLoc := enumParIn.
+		enumLoc = ident3]
+!
+
+main: loops
+	"Adaption of pystone.py version 1.9 from Python."
+
+	ident1 := 1. ident2 := 2. ident3 := 3. ident4 := 4. ident5 := 5. ident6 := 6.
+	intGlob := 0.
+	boolGlob := false.
+	char1Glob := String value: 0.
+	char2Glob := String value: 0.
+	array1Glob := Array new.
+        51 timesRepeat: [ array1Glob add: 0].
+	array2Glob := ((1 to: 51) collect: [:i | array1Glob copy]) asArray.
+
+	self defineFunctions.
+
+	self pystones: loops block: [:benchtime :stones |
+		self log: 'Pystone(1.1) time for ', loops asString, ' passes = ', benchtime asString.
+		self log: 'This machine benchmarks at ',
+			((stones / 0.1) rounded * 0.1) asString, ' pystones/second']
+!
+
+log: aString
+	(smalltalk at: #Transcript)
+		ifNotNil: [
+			Transcript show: aString;cr]
+		ifNil: [
+			console log: aString]
+!		
+
+proc0: loops block: aBlock
+	| string1Loc starttime intLoc1 intLoc2 string2Loc enumLoc intLoc3 charIndex benchtime |
+
+	loops timesRepeat: [].
+
+	benchtime := Date millisecondsToRun: [
+	ptrGlbNext := PyStoneRecord new.
+	ptrGlb := PyStoneRecord new.
+	ptrGlb ptrComp: ptrGlbNext.
+	ptrGlb discr: ident1.
+	ptrGlb enumComp: ident3.
+	ptrGlb intComp: 40.
+	ptrGlb stringComp: 'DHRYSTONE PROGRAM, SOME STRING'.
+	string1Loc := 'DHRYSTONE PROGRAM, 1''ST STRING'.
+	
+	(array2Glob at: 8) at: 7 put: 10.
+	"1 to: loops - 1 do: [:i |       Changed this to use timesRepeat: since i is not used at all in the loop"
+	loops timesRepeat: [
+		self proc5; proc4.
+		intLoc1 := 2.
+		intLoc2 := 3.
+		string2Loc := 'DHRYSTONE PROGRAM, 2''ND STRING'.
+		enumLoc := ident2.
+		boolGlob := (func2 value: string1Loc value: string2Loc) not.
+		[intLoc1 < intLoc2] whileTrue: [
+			intLoc3 := 5 * intLoc1 - intLoc2.
+			intLoc3 := self proc7: intLoc1 with: intLoc2.
+			intLoc1 := intLoc1 + 1].
+	 	self proc8:array1Glob with: array2Glob with: intLoc1 with: intLoc3.
+		ptrGlb := self proc1: ptrGlb.
+		charIndex := 'A'.
+		[charIndex <= char2Glob] whileTrue: [
+			(enumLoc = (func1 value: charIndex value: 'C'))
+					ifTrue: [enumLoc := self proc6: ident1].
+			charIndex := String value: (charIndex asciiValue + 1)].
+		intLoc3 := intLoc2 * intLoc1.
+		intLoc2 := intLoc3 / intLoc1.
+		intLoc2 := 7 * (intLoc3 - intLoc2) - intLoc1.
+		intLoc1 := self proc2: intLoc1]].
+    ^ aBlock value: (benchtime / 1000) value: (loops / benchtime) * 1000
+!
+
+proc1: ptrParIn
+	| nextRecord tmp |
+	tmp := ptrParIn.
+	nextRecord := ptrGlb copy.
+	ptrParIn ptrComp: nextRecord.
+	ptrParIn intComp: 5.
+	nextRecord intComp: ptrParIn intComp.
+	nextRecord ptrComp: ptrParIn ptrComp.
+	nextRecord ptrComp: (self proc3: nextRecord ptrComp).
+	(nextRecord discr = ident1) ifTrue: [
+		nextRecord intComp: 6.
+		nextRecord enumComp: (self proc6: ptrParIn enumComp).
+		nextRecord ptrComp: ptrGlb ptrComp.
+		nextRecord intComp: (self proc7: nextRecord intComp with: 10) ]
+	ifFalse: [
+		tmp := nextRecord copy].
+	nextRecord ptrComp: nil.
+	^tmp
+!
+
+proc2: intParIO
+	| tmp intLoc enumLoc |
+	tmp := intParIO.
+	intLoc := intParIO + 10.
+	[true] whileTrue: [
+		(char1Glob = 'A') ifTrue: [
+			intLoc := intLoc - 1.
+			tmp := intLoc - intGlob.
+			enumLoc := ident1].
+		(enumLoc = ident1) ifTrue: [
+			^ tmp]]
+!
+
+proc3: ptrParOut
+	| tmp |
+	tmp := ptrParOut.
+	ptrGlb ifNotNil: [
+		tmp := ptrGlb ptrComp]
+	ifNil: [
+		intGlob := 100].
+	ptrGlb intComp: (self proc7: 10 with: intGlob).
+	^tmp
+!
+
+proc4
+	| boolLoc |
+	boolLoc := char1Glob = 'A'.
+	boolLoc := boolLoc | boolGlob.
+	char2Glob := 'B'
+!
+
+proc5
+	char1Glob := 'A'.
+	boolGlob := false
+!
+
+proc6: enumParIn
+	| enumParOut |
+	enumParOut := enumParIn.
+	(func3 value: enumParIn) ifFalse: [
+		enumParOut := ident4].
+	(enumParIn = ident1) ifTrue: [
+		enumParOut := ident1] ifFalse: [
+	(enumParIn = ident2) ifTrue: [
+			intGlob > 100 ifTrue: [
+				enumParOut := ident1]
+			ifFalse: [
+				enumParOut := ident4]] ifFalse: [
+	(enumParIn = ident3) ifTrue: [
+		enumParOut := ident2] ifFalse: [
+	(enumParIn = ident4) ifTrue: [] ifFalse: [
+	(enumParIn = ident5) ifTrue: [
+		enumParOut := ident3]]]]].
+	^enumParOut
+!
+
+proc7: intParI1 with: intParI2
+	| intLoc intParOut |
+	intLoc := intParI1 + 2.
+	intParOut := intParI2 + intLoc.
+	^ intParOut
+!
+
+proc8: array1Par with: array2Par with: intParI1 with: intParI2
+	| intLoc |
+	intLoc := intParI1 + 5.
+	array1Par at: intLoc put: intParI2.
+	array1Par at: intLoc + 1 put: (array1Par at: intLoc).
+	array1Par at: intLoc + 30 put: intLoc.
+	intLoc to: intLoc + 1 do: [:intIndex |
+		(array2Par at: intLoc) at: intIndex put: intLoc.
+		(array2Par at: intLoc) at: intLoc - 1 put: ((array2Par at: intLoc) at: intLoc - 1) + 1.
+		(array2Par at: intLoc + 20) at: intLoc put: (array1Par at: intLoc)].
+	intGlob := 5
+!
+
+pystones: loops block: aBlock
+	^self proc0: loops block: aBlock
+! !
+
+Pystone class instanceVariableNames: 'nulltime'!
+
+!Pystone class methodsFor: 'as yet unclassified'!
+
+main
+	"self main"
+	
+	self run: 50000
+!
+
+run: loops
+	"self run: 50000"
+	
+	self new main: loops
+! !
+

+ 1 - 0
examples/nodejs/pystone/pystone

@@ -0,0 +1 @@
+node Program.js $@

+ 8 - 0
examples/nodejs/trivialserver/Makefile

@@ -0,0 +1,8 @@
+Program.js: TrivialServer.st
+	../../../bin/jtalkc -m TrivialServer TrivialServer.st Program
+
+run: Program.js
+	./trivial
+
+clean:
+	rm -f Program.js TrivialServer.js

+ 51 - 0
examples/nodejs/trivialserver/TrivialServer.st

@@ -0,0 +1,51 @@
+Object subclass: #TrivialServer
+        instanceVariableNames: 'counter'
+        category: 'TrivialServer'!
+
+!TrivialServer methodsFor: 'initializing'!
+initialize
+        counter := 0
+! !
+
+!TrivialServer methodsFor: 'processing'!
+process: aRequest
+        | hostname httpVersion stream |
+	counter := counter + 1.
+
+        "Calling a method in a js module"
+	hostname := os hostname.
+
+        "Accessing a property of js HTTP request object"
+        httpVersion := aRequest httpVersion.
+
+        stream := String new writeStream.
+	stream
+		nextPutAll: '<html><p>Request HTTP version: ', httpVersion, '</p>';
+		nextPutAll: '<p>OS hostname: ', hostname, '</p>';
+		nextPutAll: '<p>Number of requests: ', counter asString, '</p></html>'.
+	^stream contents
+!
+
+start
+        | block obj |
+        block := [:req :res || headers |
+	    headers := Dictionary with: 'content-type' -> 'text/html'.
+	    res writeHead: (Array with: 200 with: headers).
+	    res end: (self process: req)].
+
+        (http createServer: block)
+                listen: 1337 host: '127.0.0.1'.
+        console log: 'TrivialServer running at http://127.0.0.1:1337/'
+! !
+
+
+!TrivialServer class methodsFor: 'initialization'!
+initialize
+        "We require these Node modules."
+    os := require value: 'os'.
+    http := require value: 'http'.
+!
+
+main
+	self new start
+! !

+ 1 - 0
examples/nodejs/trivialserver/trivial

@@ -0,0 +1 @@
+node Program.js $@

+ 826 - 0
examples/trysmalltalk/TrySmalltalk.deploy.js

@@ -0,0 +1,826 @@
+smalltalk.addClass('TrySmalltalkWidget', smalltalk.Widget, ['workspace', 'contents', 'header'], 'TrySmalltalk');
+smalltalk.addMethod(
+'_renderOn_',
+smalltalk.method({
+selector: 'renderOn:',
+fn: function (html){
+var self=this;
+(function($rec){smalltalk.send($rec, "_class_", ["profStef"]);smalltalk.send($rec, "_with_", [(function(){return self['@header']=smalltalk.send(html, "_h2", []);})]);smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_renderOn_", [html]);})]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_renderButtonsOn_", [html]);})]);})(smalltalk.send(html, "_div", []));
+(function($rec){smalltalk.send($rec, "_widget_", [self]);return smalltalk.send($rec, "_showCurrentLesson", []);})(smalltalk.send((smalltalk.ProfStef || ProfStef), "_default", []));
+return self;}
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_workspace',
+smalltalk.method({
+selector: 'workspace',
+fn: function (){
+var self=this;
+return (($receiver = self['@workspace']) == nil || $receiver == undefined) ? (function(){return self['@workspace']=smalltalk.send((smalltalk.SourceArea || SourceArea), "_new", []);})() : $receiver;
+return self;}
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_contents_',
+smalltalk.method({
+selector: 'contents:',
+fn: function (aString){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_workspace", []), "_val_", [aString]);
+return self;}
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_contents',
+smalltalk.method({
+selector: 'contents',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_workspace", []), "_val", []);
+return self;}
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_renderButtonsOn_',
+smalltalk.method({
+selector: 'renderButtonsOn:',
+fn: function (html){
+var self=this;
+(function($rec){smalltalk.send($rec, "_with_", ["DoIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+d")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_doIt", []);})]);})(smalltalk.send(html, "_button", []));
+(function($rec){smalltalk.send($rec, "_with_", ["PrintIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+p")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_printIt", []);})]);})(smalltalk.send(html, "_button", []));
+(function($rec){smalltalk.send($rec, "_with_", ["InspectIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+i")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_inspectIt", []);})]);})(smalltalk.send(html, "_button", []));
+return self;}
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_setTitle_',
+smalltalk.method({
+selector: 'setTitle:',
+fn: function (aString){
+var self=this;
+smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [aString]);})]);
+return self;}
+}),
+smalltalk.TrySmalltalkWidget);
+
+
+
+smalltalk.addClass('AbstractTutorial', smalltalk.Object, [], 'TrySmalltalk');
+smalltalk.addMethod(
+'_indexOfLesson_',
+smalltalk.method({
+selector: 'indexOfLesson:',
+fn: function (aSelector){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_indexOf_", [aSelector]);
+return self;}
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_tableOfContents',
+smalltalk.method({
+selector: 'tableOfContents',
+fn: function (){
+var self=this;
+return ["welcome", "testLesson", "theEnd"];
+return self;}
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_welcome',
+smalltalk.method({
+selector: 'welcome',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Welcome", unescape("%22Hi%2C%20this%20is%20a%20test%20tutorial.%22")]);
+return self;}
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_testLesson',
+smalltalk.method({
+selector: 'testLesson',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Test Lesson", unescape("%22This%20lesson%20is%20a%20test%22")]);
+return self;}
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_theEnd',
+smalltalk.method({
+selector: 'theEnd',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["The End", unescape("%22And%20that%27d%20be%20pretty%20much%20it%20%3A%29%22")]);
+return self;}
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_lessonAt_',
+smalltalk.method({
+selector: 'lessonAt:',
+fn: function (anInteger){
+var self=this;
+var lessonSelector=nil;
+lessonSelector=smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_at_", [anInteger]);
+return smalltalk.send(self, "_perform_", [lessonSelector]);
+return self;}
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_size',
+smalltalk.method({
+selector: 'size',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_size", []);
+return self;}
+}),
+smalltalk.AbstractTutorial);
+
+
+
+smalltalk.addClass('Lesson', smalltalk.Object, ['title', 'contents'], 'TrySmalltalk');
+smalltalk.addMethod(
+'_contents',
+smalltalk.method({
+selector: 'contents',
+fn: function (){
+var self=this;
+return (($receiver = self['@contents']) == nil || $receiver == undefined) ? (function(){return self['@contents']="";})() : $receiver;
+return self;}
+}),
+smalltalk.Lesson);
+
+smalltalk.addMethod(
+'_contents_',
+smalltalk.method({
+selector: 'contents:',
+fn: function (aString){
+var self=this;
+self['@contents']=aString;
+return self;}
+}),
+smalltalk.Lesson);
+
+smalltalk.addMethod(
+'_title_',
+smalltalk.method({
+selector: 'title:',
+fn: function (aString){
+var self=this;
+self['@title']=aString;
+return self;}
+}),
+smalltalk.Lesson);
+
+smalltalk.addMethod(
+'_title',
+smalltalk.method({
+selector: 'title',
+fn: function (){
+var self=this;
+return (($receiver = self['@title']) == nil || $receiver == undefined) ? (function(){return self['@title']="";})() : $receiver;
+return self;}
+}),
+smalltalk.Lesson);
+
+
+smalltalk.addMethod(
+'_title_contents_',
+smalltalk.method({
+selector: 'title:contents:',
+fn: function (aTitle, someContents){
+var self=this;
+return (function($rec){smalltalk.send($rec, "_title_", [aTitle]);return smalltalk.send($rec, "_contents_", [someContents]);})(smalltalk.send(self, "_new", []));
+return self;}
+}),
+smalltalk.Lesson.klass);
+
+
+smalltalk.addClass('TutorialPlayer', smalltalk.Object, ['tutorialPosition', 'tutorial'], 'TrySmalltalk');
+smalltalk.addMethod(
+'_currentLesson',
+smalltalk.method({
+selector: 'currentLesson',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_tutorial", []), "_lessonAt_", [smalltalk.send(self, "_tutorialPosition", [])]);
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_first',
+smalltalk.method({
+selector: 'first',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_rewind", []);
+return smalltalk.send(self, "_currentLesson", []);
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_last',
+smalltalk.method({
+selector: 'last',
+fn: function (){
+var self=this;
+self['@tutorialPosition']=smalltalk.send(self, "_size", []);
+return smalltalk.send(self, "_currentLesson", []);
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_next',
+smalltalk.method({
+selector: 'next',
+fn: function (){
+var self=this;
+(($receiver = (($receiver = smalltalk.send(self, "_tutorialPosition", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(self, "_size", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(self, "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
+return smalltalk.send(self, "_currentLesson", []);
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_previous',
+smalltalk.method({
+selector: 'previous',
+fn: function (){
+var self=this;
+(($receiver = (($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver >(1) : smalltalk.send($receiver, "__gt", [(1)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);})]);
+return smalltalk.send(self, "_currentLesson", []);
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_rewind',
+smalltalk.method({
+selector: 'rewind',
+fn: function (){
+var self=this;
+self['@tutorialPosition']=(1);
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_size',
+smalltalk.method({
+selector: 'size',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_tutorial", []), "_size", []);
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_tutorial',
+smalltalk.method({
+selector: 'tutorial',
+fn: function (){
+var self=this;
+return (($receiver = self['@tutorial']) == nil || $receiver == undefined) ? (function(){return self['@tutorial']=smalltalk.send((smalltalk.SmalltalkSyntaxTutorial || SmalltalkSyntaxTutorial), "_new", []);})() : $receiver;
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_tutorial_',
+smalltalk.method({
+selector: 'tutorial:',
+fn: function (aTutorial){
+var self=this;
+self['@tutorial']=aTutorial;
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_tutorialPosition',
+smalltalk.method({
+selector: 'tutorialPosition',
+fn: function (){
+var self=this;
+return (($receiver = self['@tutorialPosition']) == nil || $receiver == undefined) ? (function(){smalltalk.send(self, "_rewind", []);return self['@tutorialPosition'];})() : $receiver;
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_tutorialPosition_',
+smalltalk.method({
+selector: 'tutorialPosition:',
+fn: function (aTutorialPosition){
+var self=this;
+self['@tutorialPosition']=aTutorialPosition;
+return self;}
+}),
+smalltalk.TutorialPlayer);
+
+
+
+smalltalk.addClass('ProfStef', smalltalk.Object, ['tutorialPlayer', 'widget'], 'TrySmalltalk');
+smalltalk.addMethod(
+'_tutorialPlayer',
+smalltalk.method({
+selector: 'tutorialPlayer',
+fn: function (){
+var self=this;
+return (($receiver = self['@tutorialPlayer']) == nil || $receiver == undefined) ? (function(){return self['@tutorialPlayer']=smalltalk.send((smalltalk.TutorialPlayer || TutorialPlayer), "_new", []);})() : $receiver;
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_first',
+smalltalk.method({
+selector: 'first',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_first", []);
+return smalltalk.send(self, "_showCurrentLesson", []);
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_progress',
+smalltalk.method({
+selector: 'progress',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_tutorialPositionString", [])]), "__comma", [unescape("/")]), "__comma", [smalltalk.send(self, "_tutorialSizeString", [])]), "__comma", [unescape("%29")]);
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_tutorialPositionString',
+smalltalk.method({
+selector: 'tutorialPositionString',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_tutorialPosition", []), "_asString", []);
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_tutorialSizeString',
+smalltalk.method({
+selector: 'tutorialSizeString',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_size", []), "_asString", []);
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_next',
+smalltalk.method({
+selector: 'next',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_next", []);
+return smalltalk.send(self, "_showCurrentLesson", []);
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_previous',
+smalltalk.method({
+selector: 'previous',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_previous", []);
+return smalltalk.send(self, "_showCurrentLesson", []);
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_widget_',
+smalltalk.method({
+selector: 'widget:',
+fn: function (aWidget){
+var self=this;
+self['@widget']=aWidget;
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_showCurrentLesson',
+smalltalk.method({
+selector: 'showCurrentLesson',
+fn: function (){
+var self=this;
+var lesson=nil;
+lesson=smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_currentLesson", []);
+smalltalk.send(self['@widget'], "_contents_", [smalltalk.send(lesson, "_contents", [])]);
+smalltalk.send(self['@widget'], "_setTitle_", [smalltalk.send(smalltalk.send(smalltalk.send(lesson, "_title", []), "__comma", [" "]), "__comma", [smalltalk.send(self, "_progress", [])])]);
+return self;}
+}),
+smalltalk.ProfStef);
+
+
+smalltalk.ProfStef.klass.iVarNames = ['instance'];
+smalltalk.addMethod(
+'_first',
+smalltalk.method({
+selector: 'first',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_default", []), "_first", []);
+return self;}
+}),
+smalltalk.ProfStef.klass);
+
+smalltalk.addMethod(
+'_default',
+smalltalk.method({
+selector: 'default',
+fn: function (){
+var self=this;
+return (($receiver = self['@instance']) == nil || $receiver == undefined) ? (function(){return self['@instance']=smalltalk.send(self, "_new", []);})() : $receiver;
+return self;}
+}),
+smalltalk.ProfStef.klass);
+
+smalltalk.addMethod(
+'_previous',
+smalltalk.method({
+selector: 'previous',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_default", []), "_previous", []);
+return self;}
+}),
+smalltalk.ProfStef.klass);
+
+smalltalk.addMethod(
+'_next',
+smalltalk.method({
+selector: 'next',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_default", []), "_next", []);
+return self;}
+}),
+smalltalk.ProfStef.klass);
+
+smalltalk.addMethod(
+'_go',
+smalltalk.method({
+selector: 'go',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_first", []);
+return self;}
+}),
+smalltalk.ProfStef.klass);
+
+
+smalltalk.addClass('SmalltalkSyntaxTutorial', smalltalk.AbstractTutorial, [], 'TrySmalltalk');
+smalltalk.addMethod(
+'_tableOfContents',
+smalltalk.method({
+selector: 'tableOfContents',
+fn: function (){
+var self=this;
+return ["welcome", "doingVSPrinting", "printing", "basicTypesNumbers", "basicTypesString", "basicTypesArray", "basicTypesDynamicArray", "messageSyntaxUnary", "messageSyntaxBinary", "messageSyntaxKeyword", "messageSyntaxExecutionOrder", "messageSyntaxExecutionOrderParentheses", "mathematicalPrecedence", "messageSyntaxCascade", "messageSyntaxCascadeShouldNotBeHere", "blocks", "blocksAssignation", "conditionals", "loops", "iterators", "instanciation", "reflection", "reflectionContinued", "theEnd"];
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesArray',
+smalltalk.method({
+selector: 'basicTypesArray',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Array", unescape("%22Literal%20arrays%20are%20created%20at%20parse%20time%3A%22%0A%0A%23%281%202%203%29.%0A%0A%23%28%201%202%203%20%23%284%205%206%29%29%20size.%0A%0A%23%281%202%204%29%20isEmpty.%0A%0A%23%281%202%203%29%20first.%0A%0A%23%28%27hello%27%20%27Javascript%27%29%20at%3A%202%20put%3A%20%27Smalltalk%27%3B%20yourself.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesCharacters',
+smalltalk.method({
+selector: 'basicTypesCharacters',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Characters", unescape("%22A%20Character%20can%20be%20instantiated%20using%20%24%20operator%3A%22%0A%0A%24A.%0A%0A%24A%20class.%0A%0A%24B%20charCode.%0A%0ACharacter%20cr.%0A%0ACharacter%20space.%0A%0A%22You%20can%20print%20all%20256%20characters%20of%20the%20ASCII%20extended%20set%3A%22%0A%0ACharacter%20allByteCharacters.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesDynamicArray',
+smalltalk.method({
+selector: 'basicTypesDynamicArray',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Dynamic Array", unescape("%22Dynamic%20Arrays%20are%20created%20at%20execution%20time%3A%22%0A%0A%7B%20%282+3%29%20.%20%286*6%29%20%7D.%0A%0A%7B%20%282+3%29%20.%20%286*6%29%20.%20%27hello%27%2C%20%27%20Stef%27%7D%20size.%0A%0A%0A%7B%20ProfStef%20%7D%20first%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesNumbers',
+smalltalk.method({
+selector: 'basicTypesNumbers',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Numbers", unescape("%22You%20now%20know%20how%20to%20execute%20Smalltalk%20code.%20%0A%0ANow%20let%27s%20talk%20about%20basic%20objects.%0A%0A1%2C%202%2C%20100%2C%202/3%20...%20are%20Numbers%2C%20and%20respond%20to%20many%20messages%20evaluating%20mathematical%20expressions.%0AEvaluate%20these%20ones%3A%22%0A%0A2.%0A%0A%281/3%29.%0A%0A%281/3%29%20+%20%284/5%29.%0A%0A%2818/5%29%20rounded.%0A%0A1%20class.%0A%0A1%20negated.%0A%0A1%20negated%20negated.%0A%0A%281%20+%203%29%20odd.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesString',
+smalltalk.method({
+selector: 'basicTypesString',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Strings", unescape("%22A%20String%20is%20a%20collection%20of%20characters.%20Use%20single%20quotes%20to%20create%20a%20String%20object.%20Print%20these%20expressions%3A%22%0A%0A%27ProfStef%27.%0A%0A%27ProfStef%27%20size.%0A%0A%27abc%27%20asUppercase.%0A%0A%27Hello%20World%27%20reversed.%20%0A%0A%22You%20can%20access%20each%20character%20using%20at%3A%20message%22%0A%0A%27ProfStef%27%20at%3A%201.%0A%0A%22String%20concatenation%20uses%20the%20comma%20operator%3A%22%0A%0A%27ProfStef%27%2C%20%27%20is%20cool%27.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesSymbol',
+smalltalk.method({
+selector: 'basicTypesSymbol',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Symbols", unescape("%22A%20Symbol%20is%20a%20String%20which%20is%20guaranteed%20to%20be%20globally%20unique.%20%0A%0AThere%20is%20one%20and%20only%20one%20Symbol%20%23ProfStef.%20There%20may%20be%20several%20%27ProfStef%27%20String%20objects.%0A%0A%28Message%20%3D%3D%20returns%20true%20if%20the%20two%20objects%20are%20the%20SAME%29%22%0A%0A%27ProfStef%27%20asSymbol.%0A%0A%23ProfStef%20asString.%0A%0A%282%20asString%29%20%3D%3D%20%282%20asString%29.%0A%0A%282%20asString%29%20asSymbol%20%3D%3D%20%282%20asString%29%20asSymbol.%0A%0A%0A%28Smalltalk%20at%3A%20%23ProfStef%29%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_blocks',
+smalltalk.method({
+selector: 'blocks',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Blocks", unescape("%22Cascade%20is%20cool%20%21%20Let%27s%20talk%20about%20blocks.%0A%0ABlocks%20are%20anonymous%20methods%20that%20can%20be%20stored%20into%20variables%20and%20executed%20on%20demand.%0A%0ABlocks%20are%20delimited%20by%20square%20brackets%3A%20%5B%5D%22%0A%0A%5BTranscript%20open%5D.%0A%0A%22does%20not%20open%20a%20Transcript%20because%20the%20block%20is%20not%20executed.%0A%0AHere%20is%20a%20block%20that%20adds%202%20to%20its%20argument%20%28its%20argument%20is%20named%20x%29%3A%22%0A%0A%5B%3Ax%20%7C%20x+2%5D.%0A%0A%22We%20can%20execute%20a%20block%20by%20sending%20it%20value%20messages.%22%0A%0A%5B%3Ax%20%7C%20x+2%5D%20value%3A%205.%0A%0A%5BTranscript%20open%5D%20value.%0A%0A%5B%3Ax%20%7C%20x+2%5D%20value%3A%2010.%0A%0A%5B%3Ax%20%3Ay%7C%20x%20+%20y%5D%20value%3A3%20value%3A5.%0A%0A%5BProfStef%20next%5D%20value.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_blocksAssignation',
+smalltalk.method({
+selector: 'blocksAssignation',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Block assignation", unescape("%22Blocks%20can%20be%20assigned%20to%20a%20variable%20then%20executed%20later.%0A%0ANote%20that%20%7Cb%7C%20is%20the%20declaration%20of%20a%20variable%20named%20%27b%27%20and%20that%20%27%3A%3D%27%20assigns%20a%20value%20to%20a%20variable.%0A%0ASelect%20the%20three%20lines%20then%20Print%20It%3A%22%0A%0A%7Cb%7C%0Ab%20%3A%3D%20%5B%3Ax%20%7C%20x+2%5D.%0Ab%20value%3A%2012.%0A%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_conditionals',
+smalltalk.method({
+selector: 'conditionals',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Conditionals", unescape("%22Conditionals%20are%20just%20messages%20sent%20to%20Boolean%20objects%22%0A%0A1%20%3C%202%0A%20%20ifTrue%3A%20%5B100%5D%0A%20%20ifFalse%3A%20%5B42%5D.%0A%0A%22Here%20the%20message%20is%20ifTrue%3AifFalse%0A%0ATry%20this%3A%22%0A%0ATranscript%20open.%0A%0A3%20%3E%2010%20%0A%09ifTrue%3A%20%5BTranscript%20show%3A%20%27maybe%20there%27%27s%20a%20bug%20....%27%5D%0A%09ifFalse%3A%20%5BTranscript%20show%3A%20%27No%20%3A%203%20is%20less%20than%2010%27%5D.%0A%0A3%20%3D%203%20ifTrue%3A%20%5BProfStef%20next%5D.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_debugger',
+smalltalk.method({
+selector: 'debugger',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Debugger", unescape("%22The%20Debugger%20may%20be%20the%20most%20famous%20tool%20of%20Smalltalk%20environments.%20It%20will%20open%20as%20soon%20as%20an%20unmanaged%20Exception%20occurs.%20%0A%0AThe%20following%20code%20will%20open%20the%20debugger.%0A%0A***This%20should%20be%20rethought%20completely***%22%0A%0A%0A%20")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_doingVSPrinting',
+smalltalk.method({
+selector: 'doingVSPrinting',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Doing VS Printing: Doing", unescape("%22Cool%20%21%20%28I%20like%20to%20say%20Cooool%20%3A%29%20%29.%20You%27ve%20just%20executed%20a%20Smalltalk%20expression.%20More%20precisely%2C%20you%20sent%20the%20message%20%27next%27%20to%0AProfStef%20class%20%28it%27s%20me%20%21%29.%0A%0ANote%20you%20can%20run%20this%20tutorial%20again%20by%20evaluating%3A%20%27ProfStef%20go%27.%20%0A%27ProfStef%20previous%27%20returns%20to%20the%20previous%20lesson.%0A%0AYou%20can%20also%20Do%20It%20using%20the%20keyboard%20shortcut%20%27CTRL%20d%27%0A%0ATry%20to%20evaluate%20this%20expression%3A%22%0A%0Awindow%20alert%3A%20%27hello%20world%21%27.%0A%0A%22Then%20go%20to%20the%20next%20lesson%3A%22%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_instanciation',
+smalltalk.method({
+selector: 'instanciation',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Instanciation", unescape("%22Objects%20are%20instances%20of%20their%20class.%20Usually%2C%20we%20send%20the%20message%20%23new%20to%20a%20class%20for%20creating%20an%20instance%20of%20this%20class.%0A%0AFor%20example%2C%20let%27s%20create%20an%20instance%20of%20the%20class%20Array%3A%22%0A%0AArray%20new%0A%09add%3A%20%27Some%20text%27%3B%0A%09add%3A%203.%3B%0A%09yourself.%0A%0A%22See%20the%20array%20we%27ve%20created%3F%20Actually%2C%20%23%28%27Some%20text%27%203%29%20is%20just%20a%20shorthand%20for%20instantiating%20arrays.%22%0A%0A%22If%20we%20use%20a%20variable%20to%20keep%20track%20of%20this%20object%2C%20we%27ll%20be%20able%20to%20do%20stuff%20with%20it.%22%0A%0A%22The%20following%20code%20must%20be%20ran%20all%20at%20one%2C%20as%20the%20%27anArray%27%20variable%20will%20cease%20to%20exist%20once%20the%20execution%20finishes%3A%22%0A%0A%7CanArray%7C%0A%0AanArray%20%3A%3D%20Array%20new%0A%09add%3A%20%27Some%20text%27%3B%0A%09add%3A%203%3B%0A%09yourself%3B%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%0AanArray%20remove%3A%203.%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%0AanArray%20add%3A%20%27Some%20more%20text%21%27.%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%09%0A%22I%27ll%20put%20myself%20in%20an%20instance%20of%20a%20class%20named%20Dictionary%20and%20go%20to%20the%20next%20lesson%3A%22%0A%0A%28%28Dictionary%20new%20add%3A%20%28%27move%20on%21%27%20-%3E%20ProfStef%29%29%20at%3A%20%27move%20on%21%27%29%20next")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_iterators',
+smalltalk.method({
+selector: 'iterators',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Iterators", unescape("%22The%20message%20do%3A%20is%20sent%20to%20a%20collection%20of%20objects%20%28Array%2C%20Dictionary%2C%20String%2C%20etc%29%2C%20evaluating%20the%20block%20for%20each%20element.%0A%0AHere%20we%20want%20to%20print%20all%20the%20numbers%20on%20the%20Transcript%20%28a%20console%29%22%0A%0A%23%2811%2038%203%20-2%2010%29%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%20Transcript%20show%3A%20each%20printString%3B%20cr%5D.%0A%0A%22Some%20other%20really%20nice%20iterators%22%0A%0A%23%2811%2038%203%20-2%2010%29%20collect%3A%20%5B%3Aeach%20%7C%20each%20negated%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20collect%3A%20%5B%3Aeach%20%7C%20each%20odd%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20select%3A%20%5B%3Aeach%20%7C%20each%20odd%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20select%3A%20%5B%3Aeach%20%7C%20each%20%3E%2010%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20reject%3A%20%5B%3Aeach%20%7C%20each%20%3E%2010%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20%0A%20%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20Transcript%20show%3A%20each%20printString%5D%0A%20%20%20%20%20separatedBy%3A%20%5BTranscript%20show%3A%20%27.%27%5D.%0A%0A%0A%28Smalltalk%20current%20classes%20select%3A%20%5B%3AeachClass%20%7C%20eachClass%20name%20%3D%20%27ProfStef%27%5D%29%20do%3A%20%5B%3AeachProfstef%20%7C%20eachProfstef%20next%5D.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_loops',
+smalltalk.method({
+selector: 'loops',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Loops", unescape("%22Loops%20are%20high-level%20collection%20iterators%2C%20implemented%20as%20regular%20methods.%22%0A%0A%22Basic%20loops%3A%0A%20%20to%3Ado%3A%0A%20%20to%3Aby%3Ado%22%0A%0A1%20to%3A%20100%20do%3A%0A%20%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%20%5D.%0A%0A1%20to%3A%20100%20by%3A%203%20do%3A%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%5D.%0A%0A100%20to%3A%200%20by%3A%20-2%20do%3A%20%0A%20%20%20%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%5D.%0A%0A1%20to%3A%201%20do%3A%20%5B%3Ai%20%7C%20ProfStef%20next%5D.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_mathematicalPrecedence',
+smalltalk.method({
+selector: 'mathematicalPrecedence',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Mathematical precedence", unescape("%22Traditional%20precedence%20rules%20from%20mathematics%20do%20not%20follow%20in%20Smalltalk.%22%0A%0A2%20*%2010%20+%202.%0A%0A%22Here%20the%20message%20*%20is%20sent%20to%202%2C%20which%20answers%2020%2C%20then%2020%20receive%20the%20message%20+%0A%0ARemember%20that%20all%20messages%20always%20follow%20a%20simple%20left-to-right%20precedence%20rule%2C%20*%20without%20exceptions%20*.%22%0A%0A2%20+%202%20*%2010.%0A%0A2%20+%20%282%20*%2010%29.%0A%0A8%20-%205%20/%202.%0A%0A%288%20-%205%29%20/%202.%0A%0A8%20-%20%285%20/%202%29.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxBinary',
+smalltalk.method({
+selector: 'messageSyntaxBinary',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Binary messages", unescape("%22Binary%20messages%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20+%20anotherObject%22%0A%0A3%20*%202.%0A%0ADate%20today%20year%20%3D%202011.%0A%0Afalse%20%7C%20false.%0A%0Atrue%20%26%20true.%0A%0Atrue%20%26%20false.%0A%0A10%20@%20100.%0A%0A10%20%3C%3D%2012.%0A%0A%27ab%27%2C%20%27cd%27.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxCascade',
+smalltalk.method({
+selector: 'messageSyntaxCascade',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Cascade", unescape("%22%3B%20is%20the%20cascade%20operator.%20It%27s%20useful%20to%20send%20message%20to%20the%20SAME%20receiver%0AOpen%20a%20Transcript%20%28console%29%3A%22%0A%0ATranscript%20open.%0A%0A%22Then%3A%22%0A%0ATranscript%20show%3A%20%27hello%27.%0ATranscript%20show%3A%20%27Smalltalk%27.%0ATranscript%20cr.%0A%0A%22is%20equivalent%20to%3A%22%0A%0ATranscript%20%0A%09%20%20%20show%3A%20%27hello%27%3B%0A%09%20%20%20show%3A%20%27Smalltalk%27%20%3B%0A%09%20%20%20cr.%0A%0A%22You%20can%20close%20the%20development%20tools%20by%20clicking%20on%20the%20red%20circle%20with%20a%20cross%20at%20the%20bottom%20left%20of%20the%20website.%0ATry%20to%20go%20to%20the%20next%20lesson%20with%20a%20cascade%20of%20two%20%27next%27%20messages%3A%22%0A%0AProfStef")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxCascadeShouldNotBeHere',
+smalltalk.method({
+selector: 'messageSyntaxCascadeShouldNotBeHere',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", [unescape("Lost%20%3F"), unescape("%22Hey%2C%20you%20should%20not%20be%20here%20%21%21%20%0A%0AGo%20back%20and%20use%20a%20cascade%20%21%22%0A%0AProfStef%20previous.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxExecutionOrder',
+smalltalk.method({
+selector: 'messageSyntaxExecutionOrder',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Execution order", unescape("%22Unary%20messages%20are%20executed%20first%2C%20then%20binary%20messages%20and%20finally%20keyword%20messages%3A%0A%20%20%20%20Unary%20%3E%20Binary%20%3E%20Keywords%22%0A%0A2.5%20+%203.8%20rounded.%0A%0A3%20max%3A%202%20+%202.%0A%20%20%0A%280@0%29%20class.%0A%0A0@0%20x%3A%20100.%0A%0A%280@0%20x%3A%20100%29%20class.%0A%0A%22Between%20messages%20of%20similar%20precedence%2C%20expressions%20are%20executed%20from%20left%20to%20right%22%0A%0A-12345%20negated%20asString%20reversed.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxExecutionOrderParentheses',
+smalltalk.method({
+selector: 'messageSyntaxExecutionOrderParentheses',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Parentheses", unescape("%22Use%20parentheses%20to%20change%20order%20of%20evaluation%22%0A%0A%282.5%20+%203.8%29%20rounded.%0A%0A%283%20max%3A%202%29%20+%202.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxKeyword',
+smalltalk.method({
+selector: 'messageSyntaxKeyword',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Keyword messages", unescape("%22Keyword%20Messages%20are%20messages%20with%20arguments.%20They%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20akey%3A%20anotherObject%20akey2%3A%20anotherObject2%22%0A%0A%27Web%20development%20is%20a%20good%20deal%20of%20pain%27%20copyFrom%3A%201%20to%3A%2030%0A%0A%22The%20message%20is%20copyFrom%3Ato%3A%20sent%20to%20the%20String%20%27Web%20development%20is%20a%20good%20deal%20of%20pain%27%22%0A%0A1%20max%3A%203.%0A%0AArray%20with%3A%20%27hello%27%20with%3A%202%20with%3A%20Smalltalk.%0A%0A%22The%20message%20is%20with%3Awith%3Awith%3A%20implemented%20on%20class%20Array.%20Note%20you%20can%20also%20write%22%0A%0AArray%0A%09with%3A%20%27Hi%20there%21%27%0A%09with%3A%202%0A%09with%3A%20Smalltalk.%0A%09%0AProfStef%20perform%3A%20%27next%27.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxUnary',
+smalltalk.method({
+selector: 'messageSyntaxUnary',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Unary messages", unescape("%22Messages%20are%20sent%20to%20objects.%20There%20are%20three%20types%20of%20message%3A%20Unary%2C%20Binary%20and%20Keyword.%0A%0AUnary%20messages%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20aMessage%20%0A%0AYou%27ve%20already%20sent%20unary%20messages.%20For%20example%3A%22%0A%0A1%20class.%0A%0Afalse%20not.%0A%0ADate%20today.%0A%0ANumber%20pi.%0A%0A%22And%20of%20course%3A%20%22%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_pharoEnvironment',
+smalltalk.method({
+selector: 'pharoEnvironment',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Pharo environment", unescape("%22Every%20Smalltalk%20system%20is%20full%20of%20objects.%20There%20are%20windows%2C%20text%2C%20numbers%2C%20dates%2C%20colors%2C%20points%20and%20much%20more.%20You%20can%20interact%20with%20objects%20in%20a%20much%20more%20direct%20way%20than%20is%20possible%20with%20other%20programming%20languages.%0A%0AEvery%20object%20understands%20the%20message%20%27explore%27.%20As%20a%20result%2C%20you%20get%20an%20Explorer%20window%20that%20shows%20details%20about%20the%20object.%22%0A%0ADate%20today%20explore.%0A%0A%22This%20shows%20that%20the%20date%20object%20consists%20of%20a%20point%20in%20time%20%28start%29%20and%20a%20duration%20%28one%20day%20long%29.%22%0A%0AProfStef%20explore.%0A%0A%22You%20see%2C%20ProfStef%20class%20has%20a%20lot%20of%20objects.%20Let%27s%20take%20a%20look%20at%20my%20code%3A%22%0A%0AProfStef%20browse.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_printing',
+smalltalk.method({
+selector: 'printing',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Doing VS Printing: Printing", unescape("%22Now%20you%27re%20a%20Do%20It%20master%20%21%20Let%27s%20talk%20about%20printing.%20It%27s%20a%20Do%20It%20which%20prints%20the%20result%20next%20to%20the%20expression%20you%27ve%20selected.%0AFor%20example%2C%20select%20the%20text%20below%2C%20and%20click%20on%20%27PrintIt%27%3A%22%0A%0A1%20+%202.%0A%0A%22As%20with%20%27DoIt%27%2C%20there%20is%20also%20a%20shortcut%20to%20execute%20this%20command.%0A%0ATry%20CTRL-p%20on%20the%20following%20expressions%3A%22%0A%0ADate%20today.%0A%0A%22The%20result%20is%20selected%2C%20so%20you%20can%20erase%20it%20using%20the%20backspace%20key.%20Try%20it%20%21%22%0A%0ADate%20today%20asDateString.%0A%0ADate%20today%20asTimeString.%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_reflection',
+smalltalk.method({
+selector: 'reflection',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Reflection", unescape("%22You%20can%20inspect%20and%20change%20the%20system%20at%20runtime.%0A%0ATake%20a%20look%20at%20the%20source%20code%20of%20the%20method%20%23and%3A%20of%20the%20class%20Boolean%3A%22%0A%0A%28Boolean%20methodDictionary%20at%3A%20%27and%3A%27%29%20source.%0A%0A%22Or%20all%20the%20methods%20it%20sends%3A%22%0A%0A%28Boolean%20methodDictionary%20at%3A%20%27and%3A%27%29%20messageSends.%0A%0A%22Here%27s%20all%20the%20methods%20I%20implement%3A%22%0A%0AProfStef%20methodDictionary.%0A%0A%22Let%27s%20create%20a%20new%20method%20to%20go%20to%20the%20next%20lesson%3A%22%0A%0A%7CnewMethod%7C%0AnewMethod%20%3A%3D%20Compiler%20new%20load%3A%20%27goToNextLesson%20ProfStef%20next.%27%20forClass%3A%20ProfStef.%0AProfStef%20class%20addCompiledMethod%3A%20newMethod%0A%0A%22Wow%21%20I%20can%27t%20wait%20to%20use%20my%20new%20method%21%22%0A%0AProfStef%20goToNextLesson.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_reflectionContinued',
+smalltalk.method({
+selector: 'reflectionContinued',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Reflection continued", unescape("%22So%20cool%2C%20isn%27t%20it%20%3F%20%20Before%20going%20further%2C%20let%27s%20remove%20this%20method%3A%22%0A%0AProfStef%20class%20methodAt%3A%20%23goToNextLesson.%0A%0AProfStef%20class%20removeCompiledMethod%3A%20%28ProfStef%20class%20methodAt%3A%20%23goToNextLesson%29.%0A%0AProfStef%20class%20methodAt%3A%20%23goToNextLesson.%0A%0A%0A%22Then%20move%20forward%3A%22%0A%0AProfStef%20perform%3A%23next")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_theEnd',
+smalltalk.method({
+selector: 'theEnd',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", [unescape("Tutorial%20done%20%21"), unescape("%22This%20tutorial%20is%20done.%20Enjoy%20programming%20Smalltalk%20with%20JTalk.%20%0A%0AYou%20can%20run%20this%20tutorial%20again%20by%20evaluating%3A%20ProfStef%20go.%0A%0ASee%20you%20soon%20%21%22%0A")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_welcome',
+smalltalk.method({
+selector: 'welcome',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Welcome", unescape("%20%22Hello%21%20I%27m%20Professor%20Stef.%20%0A%0AYou%20must%20want%20me%20to%20help%20you%20learn%20Smalltalk.%0A%0ASo%20let%27s%20go%20to%20the%20first%20lesson.%20%20Select%20the%20text%20below%20and%20click%20on%20the%20%27DoIt%27%20button%22%0A%0AProfStef%20next.")]);
+return self;}
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+
+

+ 1118 - 0
examples/trysmalltalk/TrySmalltalk.js

@@ -0,0 +1,1118 @@
+smalltalk.addClass('TrySmalltalkWidget', smalltalk.Widget, ['workspace', 'contents', 'header'], 'TrySmalltalk');
+smalltalk.addMethod(
+'_renderOn_',
+smalltalk.method({
+selector: 'renderOn:',
+category: 'rendering',
+fn: function (html){
+var self=this;
+(function($rec){smalltalk.send($rec, "_class_", ["profStef"]);smalltalk.send($rec, "_with_", [(function(){return self['@header']=smalltalk.send(html, "_h2", []);})]);smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_renderOn_", [html]);})]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_renderButtonsOn_", [html]);})]);})(smalltalk.send(html, "_div", []));
+(function($rec){smalltalk.send($rec, "_widget_", [self]);return smalltalk.send($rec, "_showCurrentLesson", []);})(smalltalk.send((smalltalk.ProfStef || ProfStef), "_default", []));
+return self;},
+source: unescape('renderOn%3A%20html%0A%09html%20div%20%0A%09%09class%3A%20%27profStef%27%3B%20%0A%09%09with%3A%20%5Bheader%20%3A%3D%20html%20h2%5D%3B%0A%09%09with%3A%20%5Bself%20workspace%20renderOn%3A%20html%5D%3B%0A%09%09with%3A%20%5Bself%20renderButtonsOn%3A%20html%5D.%0A%20%20%20%20%20%20%20%20%20%20ProfStef%20default%20%0A%09%09widget%3A%20self%3B%0A%09%09showCurrentLesson'),
+messageSends: ["class:", "with:", "h2", "renderOn:", "workspace", "renderButtonsOn:", "div", "widget:", "showCurrentLesson", "default"],
+referencedClasses: [smalltalk.nil]
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_workspace',
+smalltalk.method({
+selector: 'workspace',
+category: 'accessing',
+fn: function (){
+var self=this;
+return (($receiver = self['@workspace']) == nil || $receiver == undefined) ? (function(){return self['@workspace']=smalltalk.send((smalltalk.SourceArea || SourceArea), "_new", []);})() : $receiver;
+return self;},
+source: unescape('workspace%0A%09%5E%20workspace%20ifNil%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%09workspace%20%3A%3D%20SourceArea%20new%5D'),
+messageSends: ["ifNil:", "new"],
+referencedClasses: [smalltalk.SourceArea]
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_contents_',
+smalltalk.method({
+selector: 'contents:',
+category: 'accessing',
+fn: function (aString){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_workspace", []), "_val_", [aString]);
+return self;},
+source: unescape('contents%3A%20aString%0A%09self%20workspace%20val%3A%20aString'),
+messageSends: ["val:", "workspace"],
+referencedClasses: []
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_contents',
+smalltalk.method({
+selector: 'contents',
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_workspace", []), "_val", []);
+return self;},
+source: unescape('contents%0A%09%5Eself%20workspace%20val'),
+messageSends: ["val", "workspace"],
+referencedClasses: []
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_renderButtonsOn_',
+smalltalk.method({
+selector: 'renderButtonsOn:',
+category: 'rendering',
+fn: function (html){
+var self=this;
+(function($rec){smalltalk.send($rec, "_with_", ["DoIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+d")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_doIt", []);})]);})(smalltalk.send(html, "_button", []));
+(function($rec){smalltalk.send($rec, "_with_", ["PrintIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+p")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_printIt", []);})]);})(smalltalk.send(html, "_button", []));
+(function($rec){smalltalk.send($rec, "_with_", ["InspectIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+i")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_inspectIt", []);})]);})(smalltalk.send(html, "_button", []));
+return self;},
+source: unescape('renderButtonsOn%3A%20html%0A%20%20%20%20html%20button%0A%09with%3A%20%27DoIt%27%3B%0A%09title%3A%20%27ctrl+d%27%3B%0A%09onClick%3A%20%5Bself%20workspace%20doIt%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27PrintIt%27%3B%0A%09title%3A%20%27ctrl+p%27%3B%0A%09onClick%3A%20%5Bself%20workspace%20printIt%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27InspectIt%27%3B%0A%09title%3A%20%27ctrl+i%27%3B%0A%09onClick%3A%20%5Bself%20workspace%20inspectIt%5D'),
+messageSends: ["with:", "title:", "onClick:", "doIt", "workspace", "button", "printIt", "inspectIt"],
+referencedClasses: []
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_setTitle_',
+smalltalk.method({
+selector: 'setTitle:',
+category: 'accessing',
+fn: function (aString){
+var self=this;
+smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [aString]);})]);
+return self;},
+source: unescape('setTitle%3A%20aString%0A%09header%20contents%3A%20%5B%3Ahtml%20%7C%20html%20with%3A%20aString%5D'),
+messageSends: ["contents:", "with:"],
+referencedClasses: []
+}),
+smalltalk.TrySmalltalkWidget);
+
+
+
+smalltalk.addClass('AbstractTutorial', smalltalk.Object, [], 'TrySmalltalk');
+smalltalk.AbstractTutorial.comment=unescape('Parent%20class%20of%20all%20ProfStef%20tutorials.%0A%0ATo%20create%20your%20own%20tutorial%3A%0A-%20subclass%20AbstractTutorial%0A-%20implement%20a%20few%20methods%20which%20returns%20a%20Lesson%20instance%0A-%20implement%20tutorial%20which%20returns%20a%20Collection%20of%20selectors%20to%20the%20methods%20you%27ve%20created.')
+smalltalk.addMethod(
+'_indexOfLesson_',
+smalltalk.method({
+selector: 'indexOfLesson:',
+category: 'accessing',
+fn: function (aSelector){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_indexOf_", [aSelector]);
+return self;},
+source: unescape('indexOfLesson%3A%20aSelector%0A%09%5Eself%20tableOfContents%20indexOf%3A%20aSelector.'),
+messageSends: ["indexOf:", "tableOfContents"],
+referencedClasses: []
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_tableOfContents',
+smalltalk.method({
+selector: 'tableOfContents',
+category: 'accessing',
+fn: function (){
+var self=this;
+return ["welcome", "testLesson", "theEnd"];
+return self;},
+source: unescape('tableOfContents%0A%5E%20%23%28%0A%20%20%27welcome%27%0A%20%20%27testLesson%27%0A%20%20%27theEnd%27%0A%29'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_welcome',
+smalltalk.method({
+selector: 'welcome',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Welcome", unescape("%22Hi%2C%20this%20is%20a%20test%20tutorial.%22")]);
+return self;},
+source: unescape('welcome%0A%09%5E%20Lesson%0A%09%09title%3A%20%27Welcome%27%20%0A%09%09contents%3A%20%27%22Hi%2C%20this%20is%20a%20test%20tutorial.%22%27'),
+messageSends: ["title:contents:"],
+referencedClasses: []
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_testLesson',
+smalltalk.method({
+selector: 'testLesson',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Test Lesson", unescape("%22This%20lesson%20is%20a%20test%22")]);
+return self;},
+source: unescape('testLesson%0A%09%5E%20Lesson%0A%09%09title%3A%20%27Test%20Lesson%27%20%0A%09%09contents%3A%20%27%22This%20lesson%20is%20a%20test%22%27'),
+messageSends: ["title:contents:"],
+referencedClasses: []
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_theEnd',
+smalltalk.method({
+selector: 'theEnd',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["The End", unescape("%22And%20that%27d%20be%20pretty%20much%20it%20%3A%29%22")]);
+return self;},
+source: unescape('theEnd%0A%09%5E%20Lesson%0A%09%09title%3A%20%27The%20End%27%20%0A%09%09contents%3A%20%27%22And%20that%27%27d%20be%20pretty%20much%20it%20%3A%29%22%27'),
+messageSends: ["title:contents:"],
+referencedClasses: []
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_lessonAt_',
+smalltalk.method({
+selector: 'lessonAt:',
+category: 'accessing',
+fn: function (anInteger){
+var self=this;
+var lessonSelector=nil;
+lessonSelector=smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_at_", [anInteger]);
+return smalltalk.send(self, "_perform_", [lessonSelector]);
+return self;},
+source: unescape('lessonAt%3A%20anInteger%0A%09%7C%20lessonSelector%20%7C%0A%09lessonSelector%20%3A%3D%20self%20tableOfContents%20at%3A%20anInteger.%0A%09%5E%20self%20perform%3A%20lessonSelector.'),
+messageSends: ["at:", "tableOfContents", "perform:"],
+referencedClasses: []
+}),
+smalltalk.AbstractTutorial);
+
+smalltalk.addMethod(
+'_size',
+smalltalk.method({
+selector: 'size',
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_size", []);
+return self;},
+source: unescape('size%0A%09%5E%20self%20tableOfContents%20size'),
+messageSends: ["size", "tableOfContents"],
+referencedClasses: []
+}),
+smalltalk.AbstractTutorial);
+
+
+
+smalltalk.addClass('Lesson', smalltalk.Object, ['title', 'contents'], 'TrySmalltalk');
+smalltalk.addMethod(
+'_contents',
+smalltalk.method({
+selector: 'contents',
+category: 'accessing',
+fn: function (){
+var self=this;
+return (($receiver = self['@contents']) == nil || $receiver == undefined) ? (function(){return self['@contents']="";})() : $receiver;
+return self;},
+source: unescape('contents%0A%09%5E%20contents%20ifNil%3A%20%5Bcontents%20%3A%3D%20%27%27%5D'),
+messageSends: ["ifNil:"],
+referencedClasses: []
+}),
+smalltalk.Lesson);
+
+smalltalk.addMethod(
+'_contents_',
+smalltalk.method({
+selector: 'contents:',
+category: 'accessing',
+fn: function (aString){
+var self=this;
+self['@contents']=aString;
+return self;},
+source: unescape('contents%3A%20aString%0A%09contents%20%3A%3D%20aString'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Lesson);
+
+smalltalk.addMethod(
+'_title_',
+smalltalk.method({
+selector: 'title:',
+category: 'accessing',
+fn: function (aString){
+var self=this;
+self['@title']=aString;
+return self;},
+source: unescape('title%3A%20aString%0A%09title%20%3A%3D%20aString'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Lesson);
+
+smalltalk.addMethod(
+'_title',
+smalltalk.method({
+selector: 'title',
+category: 'accessing',
+fn: function (){
+var self=this;
+return (($receiver = self['@title']) == nil || $receiver == undefined) ? (function(){return self['@title']="";})() : $receiver;
+return self;},
+source: unescape('title%0A%09%5E%20title%20ifNil%3A%20%5Btitle%20%3A%3D%20%27%27%5D'),
+messageSends: ["ifNil:"],
+referencedClasses: []
+}),
+smalltalk.Lesson);
+
+
+smalltalk.addMethod(
+'_title_contents_',
+smalltalk.method({
+selector: 'title:contents:',
+category: 'instance creation',
+fn: function (aTitle, someContents){
+var self=this;
+return (function($rec){smalltalk.send($rec, "_title_", [aTitle]);return smalltalk.send($rec, "_contents_", [someContents]);})(smalltalk.send(self, "_new", []));
+return self;},
+source: unescape('title%3A%20aTitle%20contents%3A%20someContents%0A%09%5E%20%28self%20new%29%0A%09%09title%3A%20aTitle%3B%0A%09%09contents%3A%20someContents'),
+messageSends: ["title:", "contents:", "new"],
+referencedClasses: []
+}),
+smalltalk.Lesson.klass);
+
+
+smalltalk.addClass('TutorialPlayer', smalltalk.Object, ['tutorialPosition', 'tutorial'], 'TrySmalltalk');
+smalltalk.TutorialPlayer.comment=unescape('I%20can%20navigate%20through%20an%20AbstractTutorial%20subclass.%20With%20%23next%20and%20%23previous%20you%20can%20go%20forward%20and%20backward%20through%20the%20tutorial.%20')
+smalltalk.addMethod(
+'_currentLesson',
+smalltalk.method({
+selector: 'currentLesson',
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_tutorial", []), "_lessonAt_", [smalltalk.send(self, "_tutorialPosition", [])]);
+return self;},
+source: unescape('currentLesson%0A%09%5E%20self%20tutorial%20lessonAt%3A%20self%20tutorialPosition.'),
+messageSends: ["lessonAt:", "tutorial", "tutorialPosition"],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_first',
+smalltalk.method({
+selector: 'first',
+category: 'navigation',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_rewind", []);
+return smalltalk.send(self, "_currentLesson", []);
+return self;},
+source: unescape('first%0A%09self%20rewind.%0A%09%5E%20self%20currentLesson'),
+messageSends: ["rewind", "currentLesson"],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_last',
+smalltalk.method({
+selector: 'last',
+category: 'navigation',
+fn: function (){
+var self=this;
+self['@tutorialPosition']=smalltalk.send(self, "_size", []);
+return smalltalk.send(self, "_currentLesson", []);
+return self;},
+source: unescape('last%0A%09tutorialPosition%20%3A%3D%20self%20size.%0A%09%5E%20self%20currentLesson'),
+messageSends: ["size", "currentLesson"],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_next',
+smalltalk.method({
+selector: 'next',
+category: 'navigation',
+fn: function (){
+var self=this;
+(($receiver = (($receiver = smalltalk.send(self, "_tutorialPosition", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(self, "_size", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(self, "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
+return smalltalk.send(self, "_currentLesson", []);
+return self;},
+source: unescape('next%0A%09self%20tutorialPosition%20%3C%20self%20size%0A%09%09ifTrue%3A%20%5BtutorialPosition%20%3A%3D%20tutorialPosition%20+%201%5D.%0A%09%5E%20self%20currentLesson'),
+messageSends: ["ifTrue:", unescape("%3C"), "tutorialPosition", "size", unescape("+"), "currentLesson"],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_previous',
+smalltalk.method({
+selector: 'previous',
+category: 'navigation',
+fn: function (){
+var self=this;
+(($receiver = (($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver >(1) : smalltalk.send($receiver, "__gt", [(1)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);})]);
+return smalltalk.send(self, "_currentLesson", []);
+return self;},
+source: unescape('previous%0A%09tutorialPosition%20%3E%20%201%20ifTrue%3A%20%5BtutorialPosition%20%3A%3D%20tutorialPosition%20%20-%201%5D.%0A%09%5E%20self%20currentLesson'),
+messageSends: ["ifTrue:", unescape("%3E"), unescape("-"), "currentLesson"],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_rewind',
+smalltalk.method({
+selector: 'rewind',
+category: 'navigation',
+fn: function (){
+var self=this;
+self['@tutorialPosition']=(1);
+return self;},
+source: unescape('rewind%0A%09tutorialPosition%20%3A%3D%201.'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_size',
+smalltalk.method({
+selector: 'size',
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_tutorial", []), "_size", []);
+return self;},
+source: unescape('size%0A%09%5E%20self%20tutorial%20size'),
+messageSends: ["size", "tutorial"],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_tutorial',
+smalltalk.method({
+selector: 'tutorial',
+category: 'accessing',
+fn: function (){
+var self=this;
+return (($receiver = self['@tutorial']) == nil || $receiver == undefined) ? (function(){return self['@tutorial']=smalltalk.send((smalltalk.SmalltalkSyntaxTutorial || SmalltalkSyntaxTutorial), "_new", []);})() : $receiver;
+return self;},
+source: unescape('tutorial%0A%09%5E%20tutorial%20%20ifNil%3A%20%5Btutorial%20%3A%3D%20SmalltalkSyntaxTutorial%20new%5D'),
+messageSends: ["ifNil:", "new"],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_tutorial_',
+smalltalk.method({
+selector: 'tutorial:',
+category: 'accessing',
+fn: function (aTutorial){
+var self=this;
+self['@tutorial']=aTutorial;
+return self;},
+source: unescape('tutorial%3A%20aTutorial%0A%09tutorial%20%3A%3D%20aTutorial'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_tutorialPosition',
+smalltalk.method({
+selector: 'tutorialPosition',
+category: 'accessing',
+fn: function (){
+var self=this;
+return (($receiver = self['@tutorialPosition']) == nil || $receiver == undefined) ? (function(){smalltalk.send(self, "_rewind", []);return self['@tutorialPosition'];})() : $receiver;
+return self;},
+source: unescape('tutorialPosition%20%0A%09%5E%20tutorialPosition%20%20ifNil%3A%20%5B%0A%09%09self%20rewind.%0A%09%09tutorialPosition.%0A%09%5D.'),
+messageSends: ["ifNil:", "rewind"],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+smalltalk.addMethod(
+'_tutorialPosition_',
+smalltalk.method({
+selector: 'tutorialPosition:',
+category: 'accessing',
+fn: function (aTutorialPosition){
+var self=this;
+self['@tutorialPosition']=aTutorialPosition;
+return self;},
+source: unescape('tutorialPosition%3A%20aTutorialPosition%20%0A%09tutorialPosition%20%3A%3D%20aTutorialPosition'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.TutorialPlayer);
+
+
+
+smalltalk.addClass('ProfStef', smalltalk.Object, ['tutorialPlayer', 'widget'], 'TrySmalltalk');
+smalltalk.ProfStef.comment=unescape('A%20ProfStef%20is%20the%20Smalltalk%20teacher.%20To%20start%20the%20tutorial%2C%20evaluate%3A%0AProfStef%20go.%0A%0ATo%20go%20to%20the%20next%20lesson%20evaluate%3A%0AProfStef%20next.%0A%0ATo%20execute%20your%20own%20tutorial%3A%0AProfStef%20goOn%3A%20MyOwnTutorial%0A%0ATo%20see%20a%20table%20of%20contents%20with%20all%20defined%20tutorials%3A%0AProfStef%20contents%20')
+smalltalk.addMethod(
+'_tutorialPlayer',
+smalltalk.method({
+selector: 'tutorialPlayer',
+category: 'accessing',
+fn: function (){
+var self=this;
+return (($receiver = self['@tutorialPlayer']) == nil || $receiver == undefined) ? (function(){return self['@tutorialPlayer']=smalltalk.send((smalltalk.TutorialPlayer || TutorialPlayer), "_new", []);})() : $receiver;
+return self;},
+source: unescape('tutorialPlayer%0A%09%5E%20tutorialPlayer%20ifNil%3A%20%5BtutorialPlayer%20%3A%3D%20TutorialPlayer%20new%5D'),
+messageSends: ["ifNil:", "new"],
+referencedClasses: [smalltalk.TutorialPlayer]
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_first',
+smalltalk.method({
+selector: 'first',
+category: 'navigation',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_first", []);
+return smalltalk.send(self, "_showCurrentLesson", []);
+return self;},
+source: unescape('first%0A%09self%20tutorialPlayer%20first.%0A%09%5E%20self%20showCurrentLesson.'),
+messageSends: ["first", "tutorialPlayer", "showCurrentLesson"],
+referencedClasses: []
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_progress',
+smalltalk.method({
+selector: 'progress',
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_tutorialPositionString", [])]), "__comma", [unescape("/")]), "__comma", [smalltalk.send(self, "_tutorialSizeString", [])]), "__comma", [unescape("%29")]);
+return self;},
+source: unescape('progress%0A%09%5E%20%27%28%27%2C%20self%20tutorialPositionString%2C%20%27/%27%2C%20self%20tutorialSizeString%2C%20%27%29%27.'),
+messageSends: [unescape("%2C"), "tutorialPositionString", "tutorialSizeString"],
+referencedClasses: []
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_tutorialPositionString',
+smalltalk.method({
+selector: 'tutorialPositionString',
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_tutorialPosition", []), "_asString", []);
+return self;},
+source: unescape('tutorialPositionString%0A%09%5E%20self%20tutorialPlayer%20tutorialPosition%20asString.'),
+messageSends: ["asString", "tutorialPosition", "tutorialPlayer"],
+referencedClasses: []
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_tutorialSizeString',
+smalltalk.method({
+selector: 'tutorialSizeString',
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_size", []), "_asString", []);
+return self;},
+source: unescape('tutorialSizeString%0A%09%5E%20self%20tutorialPlayer%20size%20asString'),
+messageSends: ["asString", "size", "tutorialPlayer"],
+referencedClasses: []
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_next',
+smalltalk.method({
+selector: 'next',
+category: 'navigation',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_next", []);
+return smalltalk.send(self, "_showCurrentLesson", []);
+return self;},
+source: unescape('next%0A%09self%20tutorialPlayer%20next.%0A%09%5E%20self%20showCurrentLesson.'),
+messageSends: ["next", "tutorialPlayer", "showCurrentLesson"],
+referencedClasses: []
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_previous',
+smalltalk.method({
+selector: 'previous',
+category: 'navigation',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_previous", []);
+return smalltalk.send(self, "_showCurrentLesson", []);
+return self;},
+source: unescape('previous%0A%09self%20tutorialPlayer%20previous.%0A%09%5E%20self%20showCurrentLesson.'),
+messageSends: ["previous", "tutorialPlayer", "showCurrentLesson"],
+referencedClasses: []
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_widget_',
+smalltalk.method({
+selector: 'widget:',
+category: 'accessing',
+fn: function (aWidget){
+var self=this;
+self['@widget']=aWidget;
+return self;},
+source: unescape('widget%3A%20aWidget%0A%09widget%20%3A%3D%20aWidget'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_showCurrentLesson',
+smalltalk.method({
+selector: 'showCurrentLesson',
+category: 'accessing',
+fn: function (){
+var self=this;
+var lesson=nil;
+lesson=smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_currentLesson", []);
+smalltalk.send(self['@widget'], "_contents_", [smalltalk.send(lesson, "_contents", [])]);
+smalltalk.send(self['@widget'], "_setTitle_", [smalltalk.send(smalltalk.send(smalltalk.send(lesson, "_title", []), "__comma", [" "]), "__comma", [smalltalk.send(self, "_progress", [])])]);
+return self;},
+source: unescape('showCurrentLesson%0A%09%7C%20lesson%20%7C%0A%09lesson%20%3A%3D%20self%20tutorialPlayer%20currentLesson.%0A%09widget%20contents%3A%20lesson%20contents.%0A%09widget%20setTitle%3A%20lesson%20title%20%2C%20%27%20%27%20%2C%20self%20progress.'),
+messageSends: ["currentLesson", "tutorialPlayer", "contents:", "contents", "setTitle:", unescape("%2C"), "title", "progress"],
+referencedClasses: []
+}),
+smalltalk.ProfStef);
+
+
+smalltalk.ProfStef.klass.iVarNames = ['instance'];
+smalltalk.addMethod(
+'_first',
+smalltalk.method({
+selector: 'first',
+category: 'navigation',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_default", []), "_first", []);
+return self;},
+source: unescape('first%0A%09%5E%20self%20default%20first.'),
+messageSends: ["first", "default"],
+referencedClasses: []
+}),
+smalltalk.ProfStef.klass);
+
+smalltalk.addMethod(
+'_default',
+smalltalk.method({
+selector: 'default',
+category: 'initialize',
+fn: function (){
+var self=this;
+return (($receiver = self['@instance']) == nil || $receiver == undefined) ? (function(){return self['@instance']=smalltalk.send(self, "_new", []);})() : $receiver;
+return self;},
+source: unescape('default%20%0A%09%5E%20instance%20ifNil%3A%20%5Binstance%20%3A%3D%20self%20new%5D'),
+messageSends: ["ifNil:", "new"],
+referencedClasses: []
+}),
+smalltalk.ProfStef.klass);
+
+smalltalk.addMethod(
+'_previous',
+smalltalk.method({
+selector: 'previous',
+category: 'navigation',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_default", []), "_previous", []);
+return self;},
+source: unescape('previous%0A%09%5E%20self%20default%20previous.'),
+messageSends: ["previous", "default"],
+referencedClasses: []
+}),
+smalltalk.ProfStef.klass);
+
+smalltalk.addMethod(
+'_next',
+smalltalk.method({
+selector: 'next',
+category: 'navigation',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_default", []), "_next", []);
+return self;},
+source: unescape('next%0A%09%5E%20self%20default%20next.'),
+messageSends: ["next", "default"],
+referencedClasses: []
+}),
+smalltalk.ProfStef.klass);
+
+smalltalk.addMethod(
+'_go',
+smalltalk.method({
+selector: 'go',
+category: 'navigation',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_first", []);
+return self;},
+source: unescape('go%0A%09self%20first.'),
+messageSends: ["first"],
+referencedClasses: []
+}),
+smalltalk.ProfStef.klass);
+
+
+smalltalk.addClass('SmalltalkSyntaxTutorial', smalltalk.AbstractTutorial, [], 'TrySmalltalk');
+smalltalk.SmalltalkSyntaxTutorial.comment=unescape('The%20default%20ProfStef%20tutorial%20to%20learn%20Smalltalk%20syntax')
+smalltalk.addMethod(
+'_tableOfContents',
+smalltalk.method({
+selector: 'tableOfContents',
+category: 'contents',
+fn: function (){
+var self=this;
+return ["welcome", "doingVSPrinting", "printing", "basicTypesNumbers", "basicTypesString", "basicTypesArray", "basicTypesDynamicArray", "messageSyntaxUnary", "messageSyntaxBinary", "messageSyntaxKeyword", "messageSyntaxExecutionOrder", "messageSyntaxExecutionOrderParentheses", "mathematicalPrecedence", "messageSyntaxCascade", "messageSyntaxCascadeShouldNotBeHere", "blocks", "blocksAssignation", "conditionals", "loops", "iterators", "instanciation", "reflection", "reflectionContinued", "theEnd"];
+return self;},
+source: unescape('tableOfContents%0A%5E%20%23%28%09%27welcome%27%0A%09%27doingVSPrinting%27%0A%09%27printing%27%0A%0A%09%27basicTypesNumbers%27%0A%09%22%27basicTypesCharacters%27%22%0A%09%27basicTypesString%27%0A%09%22%27basicTypesSymbol%27%22%0A%09%27basicTypesArray%27%0A%09%27basicTypesDynamicArray%27%0A%0A%09%27messageSyntaxUnary%27%0A%09%27messageSyntaxBinary%27%0A%09%27messageSyntaxKeyword%27%0A%09%27messageSyntaxExecutionOrder%27%0A%09%27messageSyntaxExecutionOrderParentheses%27%0A%09%27mathematicalPrecedence%27%0A%09%27messageSyntaxCascade%27%0A%09%27messageSyntaxCascadeShouldNotBeHere%27%0A%0A%09%27blocks%27%0A%09%27blocksAssignation%27%0A%09%27conditionals%27%0A%09%27loops%27%0A%09%27iterators%27%0A%0A%09%27instanciation%27%0A%0A%09%27reflection%27%0A%09%27reflectionContinued%27%0A%09%22%27pharoEnvironment%27%22%0A%0A%09%22%27debugger%27%22%0A%09%27theEnd%27%20%29'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesArray',
+smalltalk.method({
+selector: 'basicTypesArray',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Array", unescape("%22Literal%20arrays%20are%20created%20at%20parse%20time%3A%22%0A%0A%23%281%202%203%29.%0A%0A%23%28%201%202%203%20%23%284%205%206%29%29%20size.%0A%0A%23%281%202%204%29%20isEmpty.%0A%0A%23%281%202%203%29%20first.%0A%0A%23%28%27hello%27%20%27Javascript%27%29%20at%3A%202%20put%3A%20%27Smalltalk%27%3B%20yourself.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('basicTypesArray%0A%09%5E%20Lesson%0Atitle%3A%20%27Basic%20types%3A%20Array%27%20%0Acontents%3A%20%0A%27%22Literal%20arrays%20are%20created%20at%20parse%20time%3A%22%0A%0A%23%281%202%203%29.%0A%0A%23%28%201%202%203%20%23%284%205%206%29%29%20size.%0A%0A%23%281%202%204%29%20isEmpty.%0A%0A%23%281%202%203%29%20first.%0A%0A%23%28%27%27hello%27%27%20%27%27Javascript%27%27%29%20at%3A%202%20put%3A%20%27%27Smalltalk%27%27%3B%20yourself.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesCharacters',
+smalltalk.method({
+selector: 'basicTypesCharacters',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Characters", unescape("%22A%20Character%20can%20be%20instantiated%20using%20%24%20operator%3A%22%0A%0A%24A.%0A%0A%24A%20class.%0A%0A%24B%20charCode.%0A%0ACharacter%20cr.%0A%0ACharacter%20space.%0A%0A%22You%20can%20print%20all%20256%20characters%20of%20the%20ASCII%20extended%20set%3A%22%0A%0ACharacter%20allByteCharacters.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('basicTypesCharacters%0A%09%5E%20Lesson%0Atitle%3A%20%27Basic%20types%3A%20Characters%27%20%0Acontents%3A%20%0A%27%22A%20Character%20can%20be%20instantiated%20using%20%24%20operator%3A%22%0A%0A%24A.%0A%0A%24A%20class.%0A%0A%24B%20charCode.%0A%0ACharacter%20cr.%0A%0ACharacter%20space.%0A%0A%22You%20can%20print%20all%20256%20characters%20of%20the%20ASCII%20extended%20set%3A%22%0A%0ACharacter%20allByteCharacters.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesDynamicArray',
+smalltalk.method({
+selector: 'basicTypesDynamicArray',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Dynamic Array", unescape("%22Dynamic%20Arrays%20are%20created%20at%20execution%20time%3A%22%0A%0A%7B%20%282+3%29%20.%20%286*6%29%20%7D.%0A%0A%7B%20%282+3%29%20.%20%286*6%29%20.%20%27hello%27%2C%20%27%20Stef%27%7D%20size.%0A%0A%0A%7B%20ProfStef%20%7D%20first%20next.")]);
+return self;},
+source: unescape('basicTypesDynamicArray%0A%09%5E%20Lesson%0Atitle%3A%20%27Basic%20types%3A%20Dynamic%20Array%27%20%0Acontents%3A%20%0A%27%22Dynamic%20Arrays%20are%20created%20at%20execution%20time%3A%22%0A%0A%7B%20%282+3%29%20.%20%286*6%29%20%7D.%0A%0A%7B%20%282+3%29%20.%20%286*6%29%20.%20%27%27hello%27%27%2C%20%27%27%20Stef%27%27%7D%20size.%0A%0A%0A%7B%20ProfStef%20%7D%20first%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesNumbers',
+smalltalk.method({
+selector: 'basicTypesNumbers',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Numbers", unescape("%22You%20now%20know%20how%20to%20execute%20Smalltalk%20code.%20%0A%0ANow%20let%27s%20talk%20about%20basic%20objects.%0A%0A1%2C%202%2C%20100%2C%202/3%20...%20are%20Numbers%2C%20and%20respond%20to%20many%20messages%20evaluating%20mathematical%20expressions.%0AEvaluate%20these%20ones%3A%22%0A%0A2.%0A%0A%281/3%29.%0A%0A%281/3%29%20+%20%284/5%29.%0A%0A%2818/5%29%20rounded.%0A%0A1%20class.%0A%0A1%20negated.%0A%0A1%20negated%20negated.%0A%0A%281%20+%203%29%20odd.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('basicTypesNumbers%0A%09%5E%20Lesson%0Atitle%3A%20%27Basic%20types%3A%20Numbers%27%20%0Acontents%3A%20%0A%27%22You%20now%20know%20how%20to%20execute%20Smalltalk%20code.%20%0A%0ANow%20let%27%27s%20talk%20about%20basic%20objects.%0A%0A1%2C%202%2C%20100%2C%202/3%20...%20are%20Numbers%2C%20and%20respond%20to%20many%20messages%20evaluating%20mathematical%20expressions.%0AEvaluate%20these%20ones%3A%22%0A%0A2.%0A%0A%281/3%29.%0A%0A%281/3%29%20+%20%284/5%29.%0A%0A%2818/5%29%20rounded.%0A%0A1%20class.%0A%0A1%20negated.%0A%0A1%20negated%20negated.%0A%0A%281%20+%203%29%20odd.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesString',
+smalltalk.method({
+selector: 'basicTypesString',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Strings", unescape("%22A%20String%20is%20a%20collection%20of%20characters.%20Use%20single%20quotes%20to%20create%20a%20String%20object.%20Print%20these%20expressions%3A%22%0A%0A%27ProfStef%27.%0A%0A%27ProfStef%27%20size.%0A%0A%27abc%27%20asUppercase.%0A%0A%27Hello%20World%27%20reversed.%20%0A%0A%22You%20can%20access%20each%20character%20using%20at%3A%20message%22%0A%0A%27ProfStef%27%20at%3A%201.%0A%0A%22String%20concatenation%20uses%20the%20comma%20operator%3A%22%0A%0A%27ProfStef%27%2C%20%27%20is%20cool%27.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('basicTypesString%0A%09%5E%20Lesson%0Atitle%3A%20%27Basic%20types%3A%20Strings%27%20%0Acontents%3A%20%0A%27%22A%20String%20is%20a%20collection%20of%20characters.%20Use%20single%20quotes%20to%20create%20a%20String%20object.%20Print%20these%20expressions%3A%22%0A%0A%27%27ProfStef%27%27.%0A%0A%27%27ProfStef%27%27%20size.%0A%0A%27%27abc%27%27%20asUppercase.%0A%0A%27%27Hello%20World%27%27%20reversed.%20%0A%0A%22You%20can%20access%20each%20character%20using%20at%3A%20message%22%0A%0A%27%27ProfStef%27%27%20at%3A%201.%0A%0A%22String%20concatenation%20uses%20the%20comma%20operator%3A%22%0A%0A%27%27ProfStef%27%27%2C%20%27%27%20is%20cool%27%27.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_basicTypesSymbol',
+smalltalk.method({
+selector: 'basicTypesSymbol',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Basic types: Symbols", unescape("%22A%20Symbol%20is%20a%20String%20which%20is%20guaranteed%20to%20be%20globally%20unique.%20%0A%0AThere%20is%20one%20and%20only%20one%20Symbol%20%23ProfStef.%20There%20may%20be%20several%20%27ProfStef%27%20String%20objects.%0A%0A%28Message%20%3D%3D%20returns%20true%20if%20the%20two%20objects%20are%20the%20SAME%29%22%0A%0A%27ProfStef%27%20asSymbol.%0A%0A%23ProfStef%20asString.%0A%0A%282%20asString%29%20%3D%3D%20%282%20asString%29.%0A%0A%282%20asString%29%20asSymbol%20%3D%3D%20%282%20asString%29%20asSymbol.%0A%0A%0A%28Smalltalk%20at%3A%20%23ProfStef%29%20next.")]);
+return self;},
+source: unescape('basicTypesSymbol%0A%09%5E%20Lesson%0Atitle%3A%20%27Basic%20types%3A%20Symbols%27%20%0Acontents%3A%20%0A%27%22A%20Symbol%20is%20a%20String%20which%20is%20guaranteed%20to%20be%20globally%20unique.%20%0A%0AThere%20is%20one%20and%20only%20one%20Symbol%20%23ProfStef.%20There%20may%20be%20several%20%27%27ProfStef%27%27%20String%20objects.%0A%0A%28Message%20%3D%3D%20returns%20true%20if%20the%20two%20objects%20are%20the%20SAME%29%22%0A%0A%27%27ProfStef%27%27%20asSymbol.%0A%0A%23ProfStef%20asString.%0A%0A%282%20asString%29%20%3D%3D%20%282%20asString%29.%0A%0A%282%20asString%29%20asSymbol%20%3D%3D%20%282%20asString%29%20asSymbol.%0A%0A%0A%28Smalltalk%20at%3A%20%23ProfStef%29%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_blocks',
+smalltalk.method({
+selector: 'blocks',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Blocks", unescape("%22Cascade%20is%20cool%20%21%20Let%27s%20talk%20about%20blocks.%0A%0ABlocks%20are%20anonymous%20methods%20that%20can%20be%20stored%20into%20variables%20and%20executed%20on%20demand.%0A%0ABlocks%20are%20delimited%20by%20square%20brackets%3A%20%5B%5D%22%0A%0A%5BTranscript%20open%5D.%0A%0A%22does%20not%20open%20a%20Transcript%20because%20the%20block%20is%20not%20executed.%0A%0AHere%20is%20a%20block%20that%20adds%202%20to%20its%20argument%20%28its%20argument%20is%20named%20x%29%3A%22%0A%0A%5B%3Ax%20%7C%20x+2%5D.%0A%0A%22We%20can%20execute%20a%20block%20by%20sending%20it%20value%20messages.%22%0A%0A%5B%3Ax%20%7C%20x+2%5D%20value%3A%205.%0A%0A%5BTranscript%20open%5D%20value.%0A%0A%5B%3Ax%20%7C%20x+2%5D%20value%3A%2010.%0A%0A%5B%3Ax%20%3Ay%7C%20x%20+%20y%5D%20value%3A3%20value%3A5.%0A%0A%5BProfStef%20next%5D%20value.")]);
+return self;},
+source: unescape('blocks%0A%09%5E%20Lesson%0Atitle%3A%20%27Blocks%27%20%0Acontents%3A%20%0A%27%22Cascade%20is%20cool%20%21%20Let%27%27s%20talk%20about%20blocks.%0A%0ABlocks%20are%20anonymous%20methods%20that%20can%20be%20stored%20into%20variables%20and%20executed%20on%20demand.%0A%0ABlocks%20are%20delimited%20by%20square%20brackets%3A%20%5B%5D%22%0A%0A%5BTranscript%20open%5D.%0A%0A%22does%20not%20open%20a%20Transcript%20because%20the%20block%20is%20not%20executed.%0A%0AHere%20is%20a%20block%20that%20adds%202%20to%20its%20argument%20%28its%20argument%20is%20named%20x%29%3A%22%0A%0A%5B%3Ax%20%7C%20x+2%5D.%0A%0A%22We%20can%20execute%20a%20block%20by%20sending%20it%20value%20messages.%22%0A%0A%5B%3Ax%20%7C%20x+2%5D%20value%3A%205.%0A%0A%5BTranscript%20open%5D%20value.%0A%0A%5B%3Ax%20%7C%20x+2%5D%20value%3A%2010.%0A%0A%5B%3Ax%20%3Ay%7C%20x%20+%20y%5D%20value%3A3%20value%3A5.%0A%0A%5BProfStef%20next%5D%20value.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_blocksAssignation',
+smalltalk.method({
+selector: 'blocksAssignation',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Block assignation", unescape("%22Blocks%20can%20be%20assigned%20to%20a%20variable%20then%20executed%20later.%0A%0ANote%20that%20%7Cb%7C%20is%20the%20declaration%20of%20a%20variable%20named%20%27b%27%20and%20that%20%27%3A%3D%27%20assigns%20a%20value%20to%20a%20variable.%0A%0ASelect%20the%20three%20lines%20then%20Print%20It%3A%22%0A%0A%7Cb%7C%0Ab%20%3A%3D%20%5B%3Ax%20%7C%20x+2%5D.%0Ab%20value%3A%2012.%0A%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('blocksAssignation%0A%09%5E%20Lesson%0Atitle%3A%20%27Block%20assignation%27%20%0Acontents%3A%20%0A%27%22Blocks%20can%20be%20assigned%20to%20a%20variable%20then%20executed%20later.%0A%0ANote%20that%20%7Cb%7C%20is%20the%20declaration%20of%20a%20variable%20named%20%27%27b%27%27%20and%20that%20%27%27%3A%3D%27%27%20assigns%20a%20value%20to%20a%20variable.%0A%0ASelect%20the%20three%20lines%20then%20Print%20It%3A%22%0A%0A%7Cb%7C%0Ab%20%3A%3D%20%5B%3Ax%20%7C%20x+2%5D.%0Ab%20value%3A%2012.%0A%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_conditionals',
+smalltalk.method({
+selector: 'conditionals',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Conditionals", unescape("%22Conditionals%20are%20just%20messages%20sent%20to%20Boolean%20objects%22%0A%0A1%20%3C%202%0A%20%20ifTrue%3A%20%5B100%5D%0A%20%20ifFalse%3A%20%5B42%5D.%0A%0A%22Here%20the%20message%20is%20ifTrue%3AifFalse%0A%0ATry%20this%3A%22%0A%0ATranscript%20open.%0A%0A3%20%3E%2010%20%0A%09ifTrue%3A%20%5BTranscript%20show%3A%20%27maybe%20there%27%27s%20a%20bug%20....%27%5D%0A%09ifFalse%3A%20%5BTranscript%20show%3A%20%27No%20%3A%203%20is%20less%20than%2010%27%5D.%0A%0A3%20%3D%203%20ifTrue%3A%20%5BProfStef%20next%5D.")]);
+return self;},
+source: unescape('conditionals%0A%09%5E%20Lesson%0Atitle%3A%20%27Conditionals%27%20%0Acontents%3A%20%0A%27%22Conditionals%20are%20just%20messages%20sent%20to%20Boolean%20objects%22%0A%0A1%20%3C%202%0A%20%20ifTrue%3A%20%5B100%5D%0A%20%20ifFalse%3A%20%5B42%5D.%0A%0A%22Here%20the%20message%20is%20ifTrue%3AifFalse%0A%0ATry%20this%3A%22%0A%0ATranscript%20open.%0A%0A3%20%3E%2010%20%0A%09ifTrue%3A%20%5BTranscript%20show%3A%20%27%27maybe%20there%27%27%27%27s%20a%20bug%20....%27%27%5D%0A%09ifFalse%3A%20%5BTranscript%20show%3A%20%27%27No%20%3A%203%20is%20less%20than%2010%27%27%5D.%0A%0A3%20%3D%203%20ifTrue%3A%20%5BProfStef%20next%5D.%27.'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_debugger',
+smalltalk.method({
+selector: 'debugger',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Debugger", unescape("%22The%20Debugger%20may%20be%20the%20most%20famous%20tool%20of%20Smalltalk%20environments.%20It%20will%20open%20as%20soon%20as%20an%20unmanaged%20Exception%20occurs.%20%0A%0AThe%20following%20code%20will%20open%20the%20debugger.%0A%0A***This%20should%20be%20rethought%20completely***%22%0A%0A%0A%20")]);
+return self;},
+source: unescape('debugger%0A%09%5E%20Lesson%0Atitle%3A%20%27Debugger%27%20%0Acontents%3A%20%27%22The%20Debugger%20may%20be%20the%20most%20famous%20tool%20of%20Smalltalk%20environments.%20It%20will%20open%20as%20soon%20as%20an%20unmanaged%20Exception%20occurs.%20%0A%0AThe%20following%20code%20will%20open%20the%20debugger.%0A%0A***This%20should%20be%20rethought%20completely***%22%0A%0A%0A%20%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_doingVSPrinting',
+smalltalk.method({
+selector: 'doingVSPrinting',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Doing VS Printing: Doing", unescape("%22Cool%20%21%20%28I%20like%20to%20say%20Cooool%20%3A%29%20%29.%20You%27ve%20just%20executed%20a%20Smalltalk%20expression.%20More%20precisely%2C%20you%20sent%20the%20message%20%27next%27%20to%0AProfStef%20class%20%28it%27s%20me%20%21%29.%0A%0ANote%20you%20can%20run%20this%20tutorial%20again%20by%20evaluating%3A%20%27ProfStef%20go%27.%20%0A%27ProfStef%20previous%27%20returns%20to%20the%20previous%20lesson.%0A%0AYou%20can%20also%20Do%20It%20using%20the%20keyboard%20shortcut%20%27CTRL%20d%27%0A%0ATry%20to%20evaluate%20this%20expression%3A%22%0A%0Awindow%20alert%3A%20%27hello%20world%21%27.%0A%0A%22Then%20go%20to%20the%20next%20lesson%3A%22%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('doingVSPrinting%20%0A%09%5E%20Lesson%0Atitle%3A%20%27Doing%20VS%20Printing%3A%20Doing%27%20%0Acontents%3A%20%0A%27%22Cool%20%21%20%28I%20like%20to%20say%20Cooool%20%3A%29%20%29.%20You%27%27ve%20just%20executed%20a%20Smalltalk%20expression.%20More%20precisely%2C%20you%20sent%20the%20message%20%27%27next%27%27%20to%0AProfStef%20class%20%28it%27%27s%20me%20%21%29.%0A%0ANote%20you%20can%20run%20this%20tutorial%20again%20by%20evaluating%3A%20%27%27ProfStef%20go%27%27.%20%0A%27%27ProfStef%20previous%27%27%20returns%20to%20the%20previous%20lesson.%0A%0AYou%20can%20also%20Do%20It%20using%20the%20keyboard%20shortcut%20%27%27CTRL%20d%27%27%0A%0ATry%20to%20evaluate%20this%20expression%3A%22%0A%0Awindow%20alert%3A%20%27%27hello%20world%21%27%27.%0A%0A%22Then%20go%20to%20the%20next%20lesson%3A%22%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_instanciation',
+smalltalk.method({
+selector: 'instanciation',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Instanciation", unescape("%22Objects%20are%20instances%20of%20their%20class.%20Usually%2C%20we%20send%20the%20message%20%23new%20to%20a%20class%20for%20creating%20an%20instance%20of%20this%20class.%0A%0AFor%20example%2C%20let%27s%20create%20an%20instance%20of%20the%20class%20Array%3A%22%0A%0AArray%20new%0A%09add%3A%20%27Some%20text%27%3B%0A%09add%3A%203.%3B%0A%09yourself.%0A%0A%22See%20the%20array%20we%27ve%20created%3F%20Actually%2C%20%23%28%27Some%20text%27%203%29%20is%20just%20a%20shorthand%20for%20instantiating%20arrays.%22%0A%0A%22If%20we%20use%20a%20variable%20to%20keep%20track%20of%20this%20object%2C%20we%27ll%20be%20able%20to%20do%20stuff%20with%20it.%22%0A%0A%22The%20following%20code%20must%20be%20ran%20all%20at%20one%2C%20as%20the%20%27anArray%27%20variable%20will%20cease%20to%20exist%20once%20the%20execution%20finishes%3A%22%0A%0A%7CanArray%7C%0A%0AanArray%20%3A%3D%20Array%20new%0A%09add%3A%20%27Some%20text%27%3B%0A%09add%3A%203%3B%0A%09yourself%3B%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%0AanArray%20remove%3A%203.%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%0AanArray%20add%3A%20%27Some%20more%20text%21%27.%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%09%0A%22I%27ll%20put%20myself%20in%20an%20instance%20of%20a%20class%20named%20Dictionary%20and%20go%20to%20the%20next%20lesson%3A%22%0A%0A%28%28Dictionary%20new%20add%3A%20%28%27move%20on%21%27%20-%3E%20ProfStef%29%29%20at%3A%20%27move%20on%21%27%29%20next")]);
+return self;},
+source: unescape('instanciation%0A%09%5E%20Lesson%0Atitle%3A%20%27Instanciation%27%20%0Acontents%3A%20%0A%27%22Objects%20are%20instances%20of%20their%20class.%20Usually%2C%20we%20send%20the%20message%20%23new%20to%20a%20class%20for%20creating%20an%20instance%20of%20this%20class.%0A%0AFor%20example%2C%20let%27%27s%20create%20an%20instance%20of%20the%20class%20Array%3A%22%0A%0AArray%20new%0A%09add%3A%20%27%27Some%20text%27%27%3B%0A%09add%3A%203.%3B%0A%09yourself.%0A%0A%22See%20the%20array%20we%27%27ve%20created%3F%20Actually%2C%20%23%28%27%27Some%20text%27%27%203%29%20is%20just%20a%20shorthand%20for%20instantiating%20arrays.%22%0A%0A%22If%20we%20use%20a%20variable%20to%20keep%20track%20of%20this%20object%2C%20we%27%27ll%20be%20able%20to%20do%20stuff%20with%20it.%22%0A%0A%22The%20following%20code%20must%20be%20ran%20all%20at%20one%2C%20as%20the%20%27%27anArray%27%27%20variable%20will%20cease%20to%20exist%20once%20the%20execution%20finishes%3A%22%0A%0A%7CanArray%7C%0A%0AanArray%20%3A%3D%20Array%20new%0A%09add%3A%20%27%27Some%20text%27%27%3B%0A%09add%3A%203%3B%0A%09yourself%3B%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%0AanArray%20remove%3A%203.%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%0AanArray%20add%3A%20%27%27Some%20more%20text%21%27%27.%0A%0ATranscript%20show%3A%20anArray%3B%20cr.%0A%09%0A%22I%27%27ll%20put%20myself%20in%20an%20instance%20of%20a%20class%20named%20Dictionary%20and%20go%20to%20the%20next%20lesson%3A%22%0A%0A%28%28Dictionary%20new%20add%3A%20%28%27%27move%20on%21%27%27%20-%3E%20ProfStef%29%29%20at%3A%20%27%27move%20on%21%27%27%29%20next%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_iterators',
+smalltalk.method({
+selector: 'iterators',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Iterators", unescape("%22The%20message%20do%3A%20is%20sent%20to%20a%20collection%20of%20objects%20%28Array%2C%20Dictionary%2C%20String%2C%20etc%29%2C%20evaluating%20the%20block%20for%20each%20element.%0A%0AHere%20we%20want%20to%20print%20all%20the%20numbers%20on%20the%20Transcript%20%28a%20console%29%22%0A%0A%23%2811%2038%203%20-2%2010%29%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%20Transcript%20show%3A%20each%20printString%3B%20cr%5D.%0A%0A%22Some%20other%20really%20nice%20iterators%22%0A%0A%23%2811%2038%203%20-2%2010%29%20collect%3A%20%5B%3Aeach%20%7C%20each%20negated%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20collect%3A%20%5B%3Aeach%20%7C%20each%20odd%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20select%3A%20%5B%3Aeach%20%7C%20each%20odd%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20select%3A%20%5B%3Aeach%20%7C%20each%20%3E%2010%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20reject%3A%20%5B%3Aeach%20%7C%20each%20%3E%2010%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20%0A%20%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20Transcript%20show%3A%20each%20printString%5D%0A%20%20%20%20%20separatedBy%3A%20%5BTranscript%20show%3A%20%27.%27%5D.%0A%0A%0A%28Smalltalk%20current%20classes%20select%3A%20%5B%3AeachClass%20%7C%20eachClass%20name%20%3D%20%27ProfStef%27%5D%29%20do%3A%20%5B%3AeachProfstef%20%7C%20eachProfstef%20next%5D.")]);
+return self;},
+source: unescape('iterators%0A%09%5E%20Lesson%0Atitle%3A%20%27Iterators%27%20%0Acontents%3A%20%0A%27%22The%20message%20do%3A%20is%20sent%20to%20a%20collection%20of%20objects%20%28Array%2C%20Dictionary%2C%20String%2C%20etc%29%2C%20evaluating%20the%20block%20for%20each%20element.%0A%0AHere%20we%20want%20to%20print%20all%20the%20numbers%20on%20the%20Transcript%20%28a%20console%29%22%0A%0A%23%2811%2038%203%20-2%2010%29%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%20Transcript%20show%3A%20each%20printString%3B%20cr%5D.%0A%0A%22Some%20other%20really%20nice%20iterators%22%0A%0A%23%2811%2038%203%20-2%2010%29%20collect%3A%20%5B%3Aeach%20%7C%20each%20negated%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20collect%3A%20%5B%3Aeach%20%7C%20each%20odd%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20select%3A%20%5B%3Aeach%20%7C%20each%20odd%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20select%3A%20%5B%3Aeach%20%7C%20each%20%3E%2010%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20reject%3A%20%5B%3Aeach%20%7C%20each%20%3E%2010%5D.%0A%0A%23%2811%2038%203%20-2%2010%29%20%0A%20%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20Transcript%20show%3A%20each%20printString%5D%0A%20%20%20%20%20separatedBy%3A%20%5BTranscript%20show%3A%20%27%27.%27%27%5D.%0A%0A%0A%28Smalltalk%20current%20classes%20select%3A%20%5B%3AeachClass%20%7C%20eachClass%20name%20%3D%20%27%27ProfStef%27%27%5D%29%20do%3A%20%5B%3AeachProfstef%20%7C%20eachProfstef%20next%5D.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_loops',
+smalltalk.method({
+selector: 'loops',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Loops", unescape("%22Loops%20are%20high-level%20collection%20iterators%2C%20implemented%20as%20regular%20methods.%22%0A%0A%22Basic%20loops%3A%0A%20%20to%3Ado%3A%0A%20%20to%3Aby%3Ado%22%0A%0A1%20to%3A%20100%20do%3A%0A%20%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%20%5D.%0A%0A1%20to%3A%20100%20by%3A%203%20do%3A%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%5D.%0A%0A100%20to%3A%200%20by%3A%20-2%20do%3A%20%0A%20%20%20%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%5D.%0A%0A1%20to%3A%201%20do%3A%20%5B%3Ai%20%7C%20ProfStef%20next%5D.")]);
+return self;},
+source: unescape('loops%0A%09%5E%20Lesson%0Atitle%3A%20%27Loops%27%20%0Acontents%3A%20%0A%27%22Loops%20are%20high-level%20collection%20iterators%2C%20implemented%20as%20regular%20methods.%22%0A%0A%22Basic%20loops%3A%0A%20%20to%3Ado%3A%0A%20%20to%3Aby%3Ado%22%0A%0A1%20to%3A%20100%20do%3A%0A%20%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%20%5D.%0A%0A1%20to%3A%20100%20by%3A%203%20do%3A%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%5D.%0A%0A100%20to%3A%200%20by%3A%20-2%20do%3A%20%0A%20%20%20%20%5B%3Ai%20%7C%20Transcript%20show%3A%20i%20asString%3B%20cr%5D.%0A%0A1%20to%3A%201%20do%3A%20%5B%3Ai%20%7C%20ProfStef%20next%5D.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_mathematicalPrecedence',
+smalltalk.method({
+selector: 'mathematicalPrecedence',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Mathematical precedence", unescape("%22Traditional%20precedence%20rules%20from%20mathematics%20do%20not%20follow%20in%20Smalltalk.%22%0A%0A2%20*%2010%20+%202.%0A%0A%22Here%20the%20message%20*%20is%20sent%20to%202%2C%20which%20answers%2020%2C%20then%2020%20receive%20the%20message%20+%0A%0ARemember%20that%20all%20messages%20always%20follow%20a%20simple%20left-to-right%20precedence%20rule%2C%20*%20without%20exceptions%20*.%22%0A%0A2%20+%202%20*%2010.%0A%0A2%20+%20%282%20*%2010%29.%0A%0A8%20-%205%20/%202.%0A%0A%288%20-%205%29%20/%202.%0A%0A8%20-%20%285%20/%202%29.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('mathematicalPrecedence%0A%09%5E%20Lesson%0Atitle%3A%20%27Mathematical%20precedence%27%0Acontents%3A%20%0A%27%22Traditional%20precedence%20rules%20from%20mathematics%20do%20not%20follow%20in%20Smalltalk.%22%0A%0A2%20*%2010%20+%202.%0A%0A%22Here%20the%20message%20*%20is%20sent%20to%202%2C%20which%20answers%2020%2C%20then%2020%20receive%20the%20message%20+%0A%0ARemember%20that%20all%20messages%20always%20follow%20a%20simple%20left-to-right%20precedence%20rule%2C%20*%20without%20exceptions%20*.%22%0A%0A2%20+%202%20*%2010.%0A%0A2%20+%20%282%20*%2010%29.%0A%0A8%20-%205%20/%202.%0A%0A%288%20-%205%29%20/%202.%0A%0A8%20-%20%285%20/%202%29.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxBinary',
+smalltalk.method({
+selector: 'messageSyntaxBinary',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Binary messages", unescape("%22Binary%20messages%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20+%20anotherObject%22%0A%0A3%20*%202.%0A%0ADate%20today%20year%20%3D%202011.%0A%0Afalse%20%7C%20false.%0A%0Atrue%20%26%20true.%0A%0Atrue%20%26%20false.%0A%0A10%20@%20100.%0A%0A10%20%3C%3D%2012.%0A%0A%27ab%27%2C%20%27cd%27.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('messageSyntaxBinary%0A%09%5E%20Lesson%0Atitle%3A%20%27Message%20syntax%3A%20Binary%20messages%27%20%0Acontents%3A%20%0A%27%22Binary%20messages%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20+%20anotherObject%22%0A%0A3%20*%202.%0A%0ADate%20today%20year%20%3D%202011.%0A%0Afalse%20%7C%20false.%0A%0Atrue%20%26%20true.%0A%0Atrue%20%26%20false.%0A%0A10%20@%20100.%0A%0A10%20%3C%3D%2012.%0A%0A%27%27ab%27%27%2C%20%27%27cd%27%27.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxCascade',
+smalltalk.method({
+selector: 'messageSyntaxCascade',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Cascade", unescape("%22%3B%20is%20the%20cascade%20operator.%20It%27s%20useful%20to%20send%20message%20to%20the%20SAME%20receiver%0AOpen%20a%20Transcript%20%28console%29%3A%22%0A%0ATranscript%20open.%0A%0A%22Then%3A%22%0A%0ATranscript%20show%3A%20%27hello%27.%0ATranscript%20show%3A%20%27Smalltalk%27.%0ATranscript%20cr.%0A%0A%22is%20equivalent%20to%3A%22%0A%0ATranscript%20%0A%09%20%20%20show%3A%20%27hello%27%3B%0A%09%20%20%20show%3A%20%27Smalltalk%27%20%3B%0A%09%20%20%20cr.%0A%0A%22You%20can%20close%20the%20development%20tools%20by%20clicking%20on%20the%20red%20circle%20with%20a%20cross%20at%20the%20bottom%20left%20of%20the%20website.%0ATry%20to%20go%20to%20the%20next%20lesson%20with%20a%20cascade%20of%20two%20%27next%27%20messages%3A%22%0A%0AProfStef")]);
+return self;},
+source: unescape('messageSyntaxCascade%0A%09%5E%20Lesson%0Atitle%3A%20%27Message%20syntax%3A%20Cascade%27%20%0Acontents%3A%20%0A%27%22%3B%20is%20the%20cascade%20operator.%20It%27%27s%20useful%20to%20send%20message%20to%20the%20SAME%20receiver%0AOpen%20a%20Transcript%20%28console%29%3A%22%0A%0ATranscript%20open.%0A%0A%22Then%3A%22%0A%0ATranscript%20show%3A%20%27%27hello%27%27.%0ATranscript%20show%3A%20%27%27Smalltalk%27%27.%0ATranscript%20cr.%0A%0A%22is%20equivalent%20to%3A%22%0A%0ATranscript%20%0A%09%20%20%20show%3A%20%27%27hello%27%27%3B%0A%09%20%20%20show%3A%20%27%27Smalltalk%27%27%20%3B%0A%09%20%20%20cr.%0A%0A%22You%20can%20close%20the%20development%20tools%20by%20clicking%20on%20the%20red%20circle%20with%20a%20cross%20at%20the%20bottom%20left%20of%20the%20website.%0ATry%20to%20go%20to%20the%20next%20lesson%20with%20a%20cascade%20of%20two%20%27%27next%27%27%20messages%3A%22%0A%0AProfStef%27.'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxCascadeShouldNotBeHere',
+smalltalk.method({
+selector: 'messageSyntaxCascadeShouldNotBeHere',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", [unescape("Lost%20%3F"), unescape("%22Hey%2C%20you%20should%20not%20be%20here%20%21%21%20%0A%0AGo%20back%20and%20use%20a%20cascade%20%21%22%0A%0AProfStef%20previous.")]);
+return self;},
+source: unescape('messageSyntaxCascadeShouldNotBeHere%0A%09%5E%20Lesson%0Atitle%3A%20%27Lost%20%3F%27%20%0Acontents%3A%20%0A%27%22Hey%2C%20you%20should%20not%20be%20here%20%21%21%20%0A%0AGo%20back%20and%20use%20a%20cascade%20%21%22%0A%0AProfStef%20previous.%27.'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxExecutionOrder',
+smalltalk.method({
+selector: 'messageSyntaxExecutionOrder',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Execution order", unescape("%22Unary%20messages%20are%20executed%20first%2C%20then%20binary%20messages%20and%20finally%20keyword%20messages%3A%0A%20%20%20%20Unary%20%3E%20Binary%20%3E%20Keywords%22%0A%0A2.5%20+%203.8%20rounded.%0A%0A3%20max%3A%202%20+%202.%0A%20%20%0A%280@0%29%20class.%0A%0A0@0%20x%3A%20100.%0A%0A%280@0%20x%3A%20100%29%20class.%0A%0A%22Between%20messages%20of%20similar%20precedence%2C%20expressions%20are%20executed%20from%20left%20to%20right%22%0A%0A-12345%20negated%20asString%20reversed.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('messageSyntaxExecutionOrder%0A%09%5E%20Lesson%0Atitle%3A%20%27Message%20syntax%3A%20Execution%20order%27%20%0Acontents%3A%20%0A%27%22Unary%20messages%20are%20executed%20first%2C%20then%20binary%20messages%20and%20finally%20keyword%20messages%3A%0A%20%20%20%20Unary%20%3E%20Binary%20%3E%20Keywords%22%0A%0A2.5%20+%203.8%20rounded.%0A%0A3%20max%3A%202%20+%202.%0A%20%20%0A%280@0%29%20class.%0A%0A0@0%20x%3A%20100.%0A%0A%280@0%20x%3A%20100%29%20class.%0A%0A%22Between%20messages%20of%20similar%20precedence%2C%20expressions%20are%20executed%20from%20left%20to%20right%22%0A%0A-12345%20negated%20asString%20reversed.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxExecutionOrderParentheses',
+smalltalk.method({
+selector: 'messageSyntaxExecutionOrderParentheses',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Parentheses", unescape("%22Use%20parentheses%20to%20change%20order%20of%20evaluation%22%0A%0A%282.5%20+%203.8%29%20rounded.%0A%0A%283%20max%3A%202%29%20+%202.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('messageSyntaxExecutionOrderParentheses%0A%09%5E%20Lesson%0Atitle%3A%20%27Message%20syntax%3A%20Parentheses%27%0Acontents%3A%20%0A%27%22Use%20parentheses%20to%20change%20order%20of%20evaluation%22%0A%0A%282.5%20+%203.8%29%20rounded.%0A%0A%283%20max%3A%202%29%20+%202.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxKeyword',
+smalltalk.method({
+selector: 'messageSyntaxKeyword',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Keyword messages", unescape("%22Keyword%20Messages%20are%20messages%20with%20arguments.%20They%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20akey%3A%20anotherObject%20akey2%3A%20anotherObject2%22%0A%0A%27Web%20development%20is%20a%20good%20deal%20of%20pain%27%20copyFrom%3A%201%20to%3A%2030%0A%0A%22The%20message%20is%20copyFrom%3Ato%3A%20sent%20to%20the%20String%20%27Web%20development%20is%20a%20good%20deal%20of%20pain%27%22%0A%0A1%20max%3A%203.%0A%0AArray%20with%3A%20%27hello%27%20with%3A%202%20with%3A%20Smalltalk.%0A%0A%22The%20message%20is%20with%3Awith%3Awith%3A%20implemented%20on%20class%20Array.%20Note%20you%20can%20also%20write%22%0A%0AArray%0A%09with%3A%20%27Hi%20there%21%27%0A%09with%3A%202%0A%09with%3A%20Smalltalk.%0A%09%0AProfStef%20perform%3A%20%27next%27.")]);
+return self;},
+source: unescape('messageSyntaxKeyword%0A%09%5E%20Lesson%0Atitle%3A%20%27Message%20syntax%3A%20Keyword%20messages%27%20%0Acontents%3A%20%0A%27%22Keyword%20Messages%20are%20messages%20with%20arguments.%20They%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20akey%3A%20anotherObject%20akey2%3A%20anotherObject2%22%0A%0A%27%27Web%20development%20is%20a%20good%20deal%20of%20pain%27%27%20copyFrom%3A%201%20to%3A%2030%0A%0A%22The%20message%20is%20copyFrom%3Ato%3A%20sent%20to%20the%20String%20%27%27Web%20development%20is%20a%20good%20deal%20of%20pain%27%27%22%0A%0A1%20max%3A%203.%0A%0AArray%20with%3A%20%27%27hello%27%27%20with%3A%202%20with%3A%20Smalltalk.%0A%0A%22The%20message%20is%20with%3Awith%3Awith%3A%20implemented%20on%20class%20Array.%20Note%20you%20can%20also%20write%22%0A%0AArray%0A%09with%3A%20%27%27Hi%20there%21%27%27%0A%09with%3A%202%0A%09with%3A%20Smalltalk.%0A%09%0AProfStef%20perform%3A%20%27%27next%27%27.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_messageSyntaxUnary',
+smalltalk.method({
+selector: 'messageSyntaxUnary',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Message syntax: Unary messages", unescape("%22Messages%20are%20sent%20to%20objects.%20There%20are%20three%20types%20of%20message%3A%20Unary%2C%20Binary%20and%20Keyword.%0A%0AUnary%20messages%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20aMessage%20%0A%0AYou%27ve%20already%20sent%20unary%20messages.%20For%20example%3A%22%0A%0A1%20class.%0A%0Afalse%20not.%0A%0ADate%20today.%0A%0ANumber%20pi.%0A%0A%22And%20of%20course%3A%20%22%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('messageSyntaxUnary%0A%09%5E%20Lesson%0Atitle%3A%20%27Message%20syntax%3A%20Unary%20messages%27%20%0Acontents%3A%20%0A%27%22Messages%20are%20sent%20to%20objects.%20There%20are%20three%20types%20of%20message%3A%20Unary%2C%20Binary%20and%20Keyword.%0A%0AUnary%20messages%20have%20the%20following%20form%3A%0A%20%20%20%20anObject%20aMessage%20%0A%0AYou%27%27ve%20already%20sent%20unary%20messages.%20For%20example%3A%22%0A%0A1%20class.%0A%0Afalse%20not.%0A%0ADate%20today.%0A%0ANumber%20pi.%0A%0A%22And%20of%20course%3A%20%22%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_pharoEnvironment',
+smalltalk.method({
+selector: 'pharoEnvironment',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Pharo environment", unescape("%22Every%20Smalltalk%20system%20is%20full%20of%20objects.%20There%20are%20windows%2C%20text%2C%20numbers%2C%20dates%2C%20colors%2C%20points%20and%20much%20more.%20You%20can%20interact%20with%20objects%20in%20a%20much%20more%20direct%20way%20than%20is%20possible%20with%20other%20programming%20languages.%0A%0AEvery%20object%20understands%20the%20message%20%27explore%27.%20As%20a%20result%2C%20you%20get%20an%20Explorer%20window%20that%20shows%20details%20about%20the%20object.%22%0A%0ADate%20today%20explore.%0A%0A%22This%20shows%20that%20the%20date%20object%20consists%20of%20a%20point%20in%20time%20%28start%29%20and%20a%20duration%20%28one%20day%20long%29.%22%0A%0AProfStef%20explore.%0A%0A%22You%20see%2C%20ProfStef%20class%20has%20a%20lot%20of%20objects.%20Let%27s%20take%20a%20look%20at%20my%20code%3A%22%0A%0AProfStef%20browse.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('pharoEnvironment%0A%09%5E%20Lesson%0Atitle%3A%20%27Pharo%20environment%27%20%0Acontents%3A%20%0A%27%22Every%20Smalltalk%20system%20is%20full%20of%20objects.%20There%20are%20windows%2C%20text%2C%20numbers%2C%20dates%2C%20colors%2C%20points%20and%20much%20more.%20You%20can%20interact%20with%20objects%20in%20a%20much%20more%20direct%20way%20than%20is%20possible%20with%20other%20programming%20languages.%0A%0AEvery%20object%20understands%20the%20message%20%27%27explore%27%27.%20As%20a%20result%2C%20you%20get%20an%20Explorer%20window%20that%20shows%20details%20about%20the%20object.%22%0A%0ADate%20today%20explore.%0A%0A%22This%20shows%20that%20the%20date%20object%20consists%20of%20a%20point%20in%20time%20%28start%29%20and%20a%20duration%20%28one%20day%20long%29.%22%0A%0AProfStef%20explore.%0A%0A%22You%20see%2C%20ProfStef%20class%20has%20a%20lot%20of%20objects.%20Let%27%27s%20take%20a%20look%20at%20my%20code%3A%22%0A%0AProfStef%20browse.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_printing',
+smalltalk.method({
+selector: 'printing',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Doing VS Printing: Printing", unescape("%22Now%20you%27re%20a%20Do%20It%20master%20%21%20Let%27s%20talk%20about%20printing.%20It%27s%20a%20Do%20It%20which%20prints%20the%20result%20next%20to%20the%20expression%20you%27ve%20selected.%0AFor%20example%2C%20select%20the%20text%20below%2C%20and%20click%20on%20%27PrintIt%27%3A%22%0A%0A1%20+%202.%0A%0A%22As%20with%20%27DoIt%27%2C%20there%20is%20also%20a%20shortcut%20to%20execute%20this%20command.%0A%0ATry%20CTRL-p%20on%20the%20following%20expressions%3A%22%0A%0ADate%20today.%0A%0A%22The%20result%20is%20selected%2C%20so%20you%20can%20erase%20it%20using%20the%20backspace%20key.%20Try%20it%20%21%22%0A%0ADate%20today%20asDateString.%0A%0ADate%20today%20asTimeString.%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('printing%20%0A%09%5E%20Lesson%0Atitle%3A%20%27Doing%20VS%20Printing%3A%20Printing%27%20%0Acontents%3A%20%0A%27%22Now%20you%27%27re%20a%20Do%20It%20master%20%21%20Let%27%27s%20talk%20about%20printing.%20It%27%27s%20a%20Do%20It%20which%20prints%20the%20result%20next%20to%20the%20expression%20you%27%27ve%20selected.%0AFor%20example%2C%20select%20the%20text%20below%2C%20and%20click%20on%20%27%27PrintIt%27%27%3A%22%0A%0A1%20+%202.%0A%0A%22As%20with%20%27%27DoIt%27%27%2C%20there%20is%20also%20a%20shortcut%20to%20execute%20this%20command.%0A%0ATry%20CTRL-p%20on%20the%20following%20expressions%3A%22%0A%0ADate%20today.%0A%0A%22The%20result%20is%20selected%2C%20so%20you%20can%20erase%20it%20using%20the%20backspace%20key.%20Try%20it%20%21%22%0A%0ADate%20today%20asDateString.%0A%0ADate%20today%20asTimeString.%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_reflection',
+smalltalk.method({
+selector: 'reflection',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Reflection", unescape("%22You%20can%20inspect%20and%20change%20the%20system%20at%20runtime.%0A%0ATake%20a%20look%20at%20the%20source%20code%20of%20the%20method%20%23and%3A%20of%20the%20class%20Boolean%3A%22%0A%0A%28Boolean%20methodDictionary%20at%3A%20%27and%3A%27%29%20source.%0A%0A%22Or%20all%20the%20methods%20it%20sends%3A%22%0A%0A%28Boolean%20methodDictionary%20at%3A%20%27and%3A%27%29%20messageSends.%0A%0A%22Here%27s%20all%20the%20methods%20I%20implement%3A%22%0A%0AProfStef%20methodDictionary.%0A%0A%22Let%27s%20create%20a%20new%20method%20to%20go%20to%20the%20next%20lesson%3A%22%0A%0A%7CnewMethod%7C%0AnewMethod%20%3A%3D%20Compiler%20new%20load%3A%20%27goToNextLesson%20ProfStef%20next.%27%20forClass%3A%20ProfStef.%0AProfStef%20class%20addCompiledMethod%3A%20newMethod%0A%0A%22Wow%21%20I%20can%27t%20wait%20to%20use%20my%20new%20method%21%22%0A%0AProfStef%20goToNextLesson.")]);
+return self;},
+source: unescape('reflection%0A%09%5E%20Lesson%0Atitle%3A%20%27Reflection%27%20%0Acontents%3A%20%0A%27%22You%20can%20inspect%20and%20change%20the%20system%20at%20runtime.%0A%0ATake%20a%20look%20at%20the%20source%20code%20of%20the%20method%20%23and%3A%20of%20the%20class%20Boolean%3A%22%0A%0A%28Boolean%20methodDictionary%20at%3A%20%27%27and%3A%27%27%29%20source.%0A%0A%22Or%20all%20the%20methods%20it%20sends%3A%22%0A%0A%28Boolean%20methodDictionary%20at%3A%20%27%27and%3A%27%27%29%20messageSends.%0A%0A%22Here%27%27s%20all%20the%20methods%20I%20implement%3A%22%0A%0AProfStef%20methodDictionary.%0A%0A%22Let%27%27s%20create%20a%20new%20method%20to%20go%20to%20the%20next%20lesson%3A%22%0A%0A%7CnewMethod%7C%0AnewMethod%20%3A%3D%20Compiler%20new%20load%3A%20%27%27goToNextLesson%20ProfStef%20next.%27%27%20forClass%3A%20ProfStef.%0AProfStef%20class%20addCompiledMethod%3A%20newMethod%0A%0A%22Wow%21%20I%20can%27%27t%20wait%20to%20use%20my%20new%20method%21%22%0A%0AProfStef%20goToNextLesson.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_reflectionContinued',
+smalltalk.method({
+selector: 'reflectionContinued',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Reflection continued", unescape("%22So%20cool%2C%20isn%27t%20it%20%3F%20%20Before%20going%20further%2C%20let%27s%20remove%20this%20method%3A%22%0A%0AProfStef%20class%20methodAt%3A%20%23goToNextLesson.%0A%0AProfStef%20class%20removeCompiledMethod%3A%20%28ProfStef%20class%20methodAt%3A%20%23goToNextLesson%29.%0A%0AProfStef%20class%20methodAt%3A%20%23goToNextLesson.%0A%0A%0A%22Then%20move%20forward%3A%22%0A%0AProfStef%20perform%3A%23next")]);
+return self;},
+source: unescape('reflectionContinued%0A%09%5E%20Lesson%0Atitle%3A%20%27Reflection%20continued%27%20%0Acontents%3A%20%0A%27%22So%20cool%2C%20isn%27%27t%20it%20%3F%20%20Before%20going%20further%2C%20let%27%27s%20remove%20this%20method%3A%22%0A%0AProfStef%20class%20methodAt%3A%20%23goToNextLesson.%0A%0AProfStef%20class%20removeCompiledMethod%3A%20%28ProfStef%20class%20methodAt%3A%20%23goToNextLesson%29.%0A%0AProfStef%20class%20methodAt%3A%20%23goToNextLesson.%0A%0A%0A%22Then%20move%20forward%3A%22%0A%0AProfStef%20perform%3A%23next%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_theEnd',
+smalltalk.method({
+selector: 'theEnd',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", [unescape("Tutorial%20done%20%21"), unescape("%22This%20tutorial%20is%20done.%20Enjoy%20programming%20Smalltalk%20with%20JTalk.%20%0A%0AYou%20can%20run%20this%20tutorial%20again%20by%20evaluating%3A%20ProfStef%20go.%0A%0ASee%20you%20soon%20%21%22%0A")]);
+return self;},
+source: unescape('theEnd%0A%09%5E%20Lesson%0Atitle%3A%20%27Tutorial%20done%20%21%27%20%0Acontents%3A%20%0A%27%22This%20tutorial%20is%20done.%20Enjoy%20programming%20Smalltalk%20with%20JTalk.%20%0A%0AYou%20can%20run%20this%20tutorial%20again%20by%20evaluating%3A%20ProfStef%20go.%0A%0ASee%20you%20soon%20%21%22%0A%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+smalltalk.addMethod(
+'_welcome',
+smalltalk.method({
+selector: 'welcome',
+category: 'pages',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Welcome", unescape("%20%22Hello%21%20I%27m%20Professor%20Stef.%20%0A%0AYou%20must%20want%20me%20to%20help%20you%20learn%20Smalltalk.%0A%0ASo%20let%27s%20go%20to%20the%20first%20lesson.%20%20Select%20the%20text%20below%20and%20click%20on%20the%20%27DoIt%27%20button%22%0A%0AProfStef%20next.")]);
+return self;},
+source: unescape('welcome%0A%09%5E%20Lesson%0Atitle%3A%20%27Welcome%27%20%0Acontents%3A%20%0A%27%20%22Hello%21%20I%27%27m%20Professor%20Stef.%20%0A%0AYou%20must%20want%20me%20to%20help%20you%20learn%20Smalltalk.%0A%0ASo%20let%27%27s%20go%20to%20the%20first%20lesson.%20%20Select%20the%20text%20below%20and%20click%20on%20the%20%27%27DoIt%27%27%20button%22%0A%0AProfStef%20next.%27'),
+messageSends: ["title:contents:"],
+referencedClasses: [smalltalk.Lesson]
+}),
+smalltalk.SmalltalkSyntaxTutorial);
+
+
+

+ 958 - 0
examples/trysmalltalk/TrySmalltalk.st

@@ -0,0 +1,958 @@
+Widget subclass: #TrySmalltalkWidget
+	instanceVariableNames: 'workspace contents header'
+	category: 'TrySmalltalk'!
+
+!TrySmalltalkWidget methodsFor: 'accessing'!
+
+workspace
+	^ workspace ifNil: [
+          	workspace := SourceArea new]
+!
+
+contents: aString
+	self workspace val: aString
+!
+
+contents
+	^self workspace val
+!
+
+setTitle: aString
+	header contents: [:html | html with: aString]
+! !
+
+!TrySmalltalkWidget methodsFor: 'rendering'!
+
+renderOn: html
+	html div 
+		class: 'profStef'; 
+		with: [header := html h2];
+		with: [self workspace renderOn: html];
+		with: [self renderButtonsOn: html].
+          ProfStef default 
+		widget: self;
+		showCurrentLesson
+!
+
+renderButtonsOn: html
+    html button
+	with: 'DoIt';
+	title: 'ctrl+d';
+	onClick: [self workspace doIt].
+    html button
+	with: 'PrintIt';
+	title: 'ctrl+p';
+	onClick: [self workspace printIt].
+    html button
+	with: 'InspectIt';
+	title: 'ctrl+i';
+	onClick: [self workspace inspectIt]
+! !
+
+Object subclass: #AbstractTutorial
+	instanceVariableNames: ''
+	category: 'TrySmalltalk'!
+!AbstractTutorial commentStamp!
+Parent class of all ProfStef tutorials.
+
+To create your own tutorial:
+- subclass AbstractTutorial
+- implement a few methods which returns a Lesson instance
+- implement tutorial which returns a Collection of selectors to the methods you've created.!
+
+!AbstractTutorial methodsFor: 'accessing'!
+
+indexOfLesson: aSelector
+	^self tableOfContents indexOf: aSelector.
+!
+
+tableOfContents
+^ #(
+  'welcome'
+  'testLesson'
+  'theEnd'
+)
+!
+
+lessonAt: anInteger
+	| lessonSelector |
+	lessonSelector := self tableOfContents at: anInteger.
+	^ self perform: lessonSelector.
+!
+
+size
+	^ self tableOfContents size
+! !
+
+!AbstractTutorial methodsFor: 'pages'!
+
+welcome
+	^ Lesson
+		title: 'Welcome' 
+		contents: '"Hi, this is a test tutorial."'
+!
+
+testLesson
+	^ Lesson
+		title: 'Test Lesson' 
+		contents: '"This lesson is a test"'
+!
+
+theEnd
+	^ Lesson
+		title: 'The End' 
+		contents: '"And that''d be pretty much it :)"'
+! !
+
+Object subclass: #Lesson
+	instanceVariableNames: 'title contents'
+	category: 'TrySmalltalk'!
+
+!Lesson methodsFor: 'accessing'!
+
+contents
+	^ contents ifNil: [contents := '']
+!
+
+contents: aString
+	contents := aString
+!
+
+title: aString
+	title := aString
+!
+
+title
+	^ title ifNil: [title := '']
+! !
+
+!Lesson class methodsFor: 'instance creation'!
+
+title: aTitle contents: someContents
+	^ (self new)
+		title: aTitle;
+		contents: someContents
+! !
+
+Object subclass: #TutorialPlayer
+	instanceVariableNames: 'tutorialPosition tutorial'
+	category: 'TrySmalltalk'!
+!TutorialPlayer commentStamp!
+I can navigate through an AbstractTutorial subclass. With #next and #previous you can go forward and backward through the tutorial.!
+
+!TutorialPlayer methodsFor: 'accessing'!
+
+currentLesson
+	^ self tutorial lessonAt: self tutorialPosition.
+!
+
+size
+	^ self tutorial size
+!
+
+tutorial
+	^ tutorial  ifNil: [tutorial := SmalltalkSyntaxTutorial new]
+!
+
+tutorial: aTutorial
+	tutorial := aTutorial
+!
+
+tutorialPosition 
+	^ tutorialPosition  ifNil: [
+		self rewind.
+		tutorialPosition.
+	].
+!
+
+tutorialPosition: aTutorialPosition 
+	tutorialPosition := aTutorialPosition
+! !
+
+!TutorialPlayer methodsFor: 'navigation'!
+
+first
+	self rewind.
+	^ self currentLesson
+!
+
+last
+	tutorialPosition := self size.
+	^ self currentLesson
+!
+
+next
+	self tutorialPosition < self size
+		ifTrue: [tutorialPosition := tutorialPosition + 1].
+	^ self currentLesson
+!
+
+previous
+	tutorialPosition >  1 ifTrue: [tutorialPosition := tutorialPosition  - 1].
+	^ self currentLesson
+!
+
+rewind
+	tutorialPosition := 1.
+! !
+
+Object subclass: #ProfStef
+	instanceVariableNames: 'tutorialPlayer widget'
+	category: 'TrySmalltalk'!
+!ProfStef commentStamp!
+A ProfStef is the Smalltalk teacher. To start the tutorial, evaluate:
+ProfStef go.
+
+To go to the next lesson evaluate:
+ProfStef next.
+
+To execute your own tutorial:
+ProfStef goOn: MyOwnTutorial
+
+To see a table of contents with all defined tutorials:
+ProfStef contents!
+
+!ProfStef methodsFor: 'accessing'!
+
+tutorialPlayer
+	^ tutorialPlayer ifNil: [tutorialPlayer := TutorialPlayer new]
+!
+
+progress
+	^ '(', self tutorialPositionString, '/', self tutorialSizeString, ')'.
+!
+
+tutorialPositionString
+	^ self tutorialPlayer tutorialPosition asString.
+!
+
+tutorialSizeString
+	^ self tutorialPlayer size asString
+!
+
+widget: aWidget
+	widget := aWidget
+!
+
+showCurrentLesson
+	| lesson |
+	lesson := self tutorialPlayer currentLesson.
+	widget contents: lesson contents.
+	widget setTitle: lesson title , ' ' , self progress.
+! !
+
+!ProfStef methodsFor: 'navigation'!
+
+first
+	self tutorialPlayer first.
+	^ self showCurrentLesson.
+!
+
+next
+	self tutorialPlayer next.
+	^ self showCurrentLesson.
+!
+
+previous
+	self tutorialPlayer previous.
+	^ self showCurrentLesson.
+! !
+
+ProfStef class instanceVariableNames: 'instance'!
+
+!ProfStef class methodsFor: 'initialize'!
+
+default 
+	^ instance ifNil: [instance := self new]
+! !
+
+!ProfStef class methodsFor: 'navigation'!
+
+first
+	^ self default first.
+!
+
+previous
+	^ self default previous.
+!
+
+next
+	^ self default next.
+!
+
+go
+	self first.
+! !
+
+AbstractTutorial subclass: #SmalltalkSyntaxTutorial
+	instanceVariableNames: ''
+	category: 'TrySmalltalk'!
+!SmalltalkSyntaxTutorial commentStamp!
+The default ProfStef tutorial to learn Smalltalk syntax!
+
+!SmalltalkSyntaxTutorial methodsFor: 'contents'!
+
+tableOfContents
+^ #(	'welcome'
+	'doingVSPrinting'
+	'printing'
+
+	'basicTypesNumbers'
+	"'basicTypesCharacters'"
+	'basicTypesString'
+	"'basicTypesSymbol'"
+	'basicTypesArray'
+	'basicTypesDynamicArray'
+
+	'messageSyntaxUnary'
+	'messageSyntaxBinary'
+	'messageSyntaxKeyword'
+	'messageSyntaxExecutionOrder'
+	'messageSyntaxExecutionOrderParentheses'
+	'mathematicalPrecedence'
+	'messageSyntaxCascade'
+	'messageSyntaxCascadeShouldNotBeHere'
+
+	'blocks'
+	'blocksAssignation'
+	'conditionals'
+	'loops'
+	'iterators'
+
+	'instanciation'
+
+	'reflection'
+	'reflectionContinued'
+	"'pharoEnvironment'"
+
+	"'debugger'"
+	'theEnd' )
+! !
+
+!SmalltalkSyntaxTutorial methodsFor: 'pages'!
+
+basicTypesArray
+	^ Lesson
+title: 'Basic types: Array' 
+contents: 
+'"Literal arrays are created at parse time:"
+
+#(1 2 3).
+
+#( 1 2 3 #(4 5 6)) size.
+
+#(1 2 4) isEmpty.
+
+#(1 2 3) first.
+
+#(''hello'' ''Javascript'') at: 2 put: ''Smalltalk''; yourself.
+
+ProfStef next.'
+!
+
+basicTypesCharacters
+	^ Lesson
+title: 'Basic types: Characters' 
+contents: 
+'"A Character can be instantiated using $ operator:"
+
+$A.
+
+$A class.
+
+$B charCode.
+
+Character cr.
+
+Character space.
+
+"You can print all 256 characters of the ASCII extended set:"
+
+Character allByteCharacters.
+
+ProfStef next.'
+!
+
+basicTypesDynamicArray
+	^ Lesson
+title: 'Basic types: Dynamic Array' 
+contents: 
+'"Dynamic Arrays are created at execution time:"
+
+{ (2+3) . (6*6) }.
+
+{ (2+3) . (6*6) . ''hello'', '' Stef''} size.
+
+
+{ ProfStef } first next.'
+!
+
+basicTypesNumbers
+	^ Lesson
+title: 'Basic types: Numbers' 
+contents: 
+'"You now know how to execute Smalltalk code. 
+
+Now let''s talk about basic objects.
+
+1, 2, 100, 2/3 ... are Numbers, and respond to many messages evaluating mathematical expressions.
+Evaluate these ones:"
+
+2.
+
+(1/3).
+
+(1/3) + (4/5).
+
+(18/5) rounded.
+
+1 class.
+
+1 negated.
+
+1 negated negated.
+
+(1 + 3) odd.
+
+ProfStef next.'
+!
+
+basicTypesString
+	^ Lesson
+title: 'Basic types: Strings' 
+contents: 
+'"A String is a collection of characters. Use single quotes to create a String object. Print these expressions:"
+
+''ProfStef''.
+
+''ProfStef'' size.
+
+''abc'' asUppercase.
+
+''Hello World'' reversed. 
+
+"You can access each character using at: message"
+
+''ProfStef'' at: 1.
+
+"String concatenation uses the comma operator:"
+
+''ProfStef'', '' is cool''.
+
+ProfStef next.'
+!
+
+basicTypesSymbol
+	^ Lesson
+title: 'Basic types: Symbols' 
+contents: 
+'"A Symbol is a String which is guaranteed to be globally unique. 
+
+There is one and only one Symbol #ProfStef. There may be several ''ProfStef'' String objects.
+
+(Message == returns true if the two objects are the SAME)"
+
+''ProfStef'' asSymbol.
+
+#ProfStef asString.
+
+(2 asString) == (2 asString).
+
+(2 asString) asSymbol == (2 asString) asSymbol.
+
+
+(Smalltalk at: #ProfStef) next.'
+!
+
+blocks
+	^ Lesson
+title: 'Blocks' 
+contents: 
+'"Cascade is cool !! Let''s talk about blocks.
+
+Blocks are anonymous methods that can be stored into variables and executed on demand.
+
+Blocks are delimited by square brackets: []"
+
+[Transcript open].
+
+"does not open a Transcript because the block is not executed.
+
+Here is a block that adds 2 to its argument (its argument is named x):"
+
+[:x | x+2].
+
+"We can execute a block by sending it value messages."
+
+[:x | x+2] value: 5.
+
+[Transcript open] value.
+
+[:x | x+2] value: 10.
+
+[:x :y| x + y] value:3 value:5.
+
+[ProfStef next] value.'
+!
+
+blocksAssignation
+	^ Lesson
+title: 'Block assignation' 
+contents: 
+'"Blocks can be assigned to a variable then executed later.
+
+Note that |b| is the declaration of a variable named ''b'' and that '':='' assigns a value to a variable.
+
+Select the three lines then Print It:"
+
+|b|
+b := [:x | x+2].
+b value: 12.
+
+
+ProfStef next.'
+!
+
+conditionals
+	^ Lesson
+title: 'Conditionals' 
+contents: 
+'"Conditionals are just messages sent to Boolean objects"
+
+1 < 2
+  ifTrue: [100]
+  ifFalse: [42].
+
+"Here the message is ifTrue:ifFalse
+
+Try this:"
+
+Transcript open.
+
+3 > 10 
+	ifTrue: [Transcript show: ''maybe there''''s a bug ....'']
+	ifFalse: [Transcript show: ''No : 3 is less than 10''].
+
+3 = 3 ifTrue: [ProfStef next].'.
+!
+
+debugger
+	^ Lesson
+title: 'Debugger' 
+contents: '"The Debugger may be the most famous tool of Smalltalk environments. It will open as soon as an unmanaged Exception occurs. 
+
+The following code will open the debugger.
+
+***This should be rethought completely***"
+
+
+ '
+!
+
+doingVSPrinting 
+	^ Lesson
+title: 'Doing VS Printing: Doing' 
+contents: 
+'"Cool !! (I like to say Cooool :) ). You''ve just executed a Smalltalk expression. More precisely, you sent the message ''next'' to
+ProfStef class (it''s me !!).
+
+Note you can run this tutorial again by evaluating: ''ProfStef go''. 
+''ProfStef previous'' returns to the previous lesson.
+
+You can also Do It using the keyboard shortcut ''CTRL d''
+
+Try to evaluate this expression:"
+
+window alert: ''hello world!!''.
+
+"Then go to the next lesson:"
+
+ProfStef next.'
+!
+
+instanciation
+	^ Lesson
+title: 'Instanciation' 
+contents: 
+'"Objects are instances of their class. Usually, we send the message #new to a class for creating an instance of this class.
+
+For example, let''s create an instance of the class Array:"
+
+Array new
+	add: ''Some text'';
+	add: 3.;
+	yourself.
+
+"See the array we''ve created? Actually, #(''Some text'' 3) is just a shorthand for instantiating arrays."
+
+"If we use a variable to keep track of this object, we''ll be able to do stuff with it."
+
+"The following code must be ran all at one, as the ''anArray'' variable will cease to exist once the execution finishes:"
+
+|anArray|
+
+anArray := Array new
+	add: ''Some text'';
+	add: 3;
+	yourself;
+
+Transcript show: anArray; cr.
+
+anArray remove: 3.
+
+Transcript show: anArray; cr.
+
+anArray add: ''Some more text!!''.
+
+Transcript show: anArray; cr.
+	
+"I''ll put myself in an instance of a class named Dictionary and go to the next lesson:"
+
+((Dictionary new add: (''move on!!'' -> ProfStef)) at: ''move on!!'') next'
+!
+
+iterators
+	^ Lesson
+title: 'Iterators' 
+contents: 
+'"The message do: is sent to a collection of objects (Array, Dictionary, String, etc), evaluating the block for each element.
+
+Here we want to print all the numbers on the Transcript (a console)"
+
+#(11 38 3 -2 10) do: [:each |
+     Transcript show: each printString; cr].
+
+"Some other really nice iterators"
+
+#(11 38 3 -2 10) collect: [:each | each negated].
+
+#(11 38 3 -2 10) collect: [:each | each odd].
+
+#(11 38 3 -2 10) select: [:each | each odd].
+
+#(11 38 3 -2 10) select: [:each | each > 10].
+
+#(11 38 3 -2 10) reject: [:each | each > 10].
+
+#(11 38 3 -2 10) 
+     do: [:each | Transcript show: each printString]
+     separatedBy: [Transcript show: ''.''].
+
+
+(Smalltalk current classes select: [:eachClass | eachClass name = ''ProfStef'']) do: [:eachProfstef | eachProfstef next].'
+!
+
+loops
+	^ Lesson
+title: 'Loops' 
+contents: 
+'"Loops are high-level collection iterators, implemented as regular methods."
+
+"Basic loops:
+  to:do:
+  to:by:do"
+
+1 to: 100 do:
+  [:i | Transcript show: i asString; cr ].
+
+1 to: 100 by: 3 do: [:i | Transcript show: i asString; cr].
+
+100 to: 0 by: -2 do: 
+    [:i | Transcript show: i asString; cr].
+
+1 to: 1 do: [:i | ProfStef next].'
+!
+
+mathematicalPrecedence
+	^ Lesson
+title: 'Mathematical precedence'
+contents: 
+'"Traditional precedence rules from mathematics do not follow in Smalltalk."
+
+2 * 10 + 2.
+
+"Here the message * is sent to 2, which answers 20, then 20 receive the message +
+
+Remember that all messages always follow a simple left-to-right precedence rule, * without exceptions *."
+
+2 + 2 * 10.
+
+2 + (2 * 10).
+
+8 - 5 / 2.
+
+(8 - 5) / 2.
+
+8 - (5 / 2).
+
+ProfStef next.'
+!
+
+messageSyntaxBinary
+	^ Lesson
+title: 'Message syntax: Binary messages' 
+contents: 
+'"Binary messages have the following form:
+    anObject + anotherObject"
+
+3 * 2.
+
+Date today year = 2011.
+
+false | false.
+
+true & true.
+
+true & false.
+
+10 @ 100.
+
+10 <= 12.
+
+''ab'', ''cd''.
+
+ProfStef next.'
+!
+
+messageSyntaxCascade
+	^ Lesson
+title: 'Message syntax: Cascade' 
+contents: 
+'"; is the cascade operator. It''s useful to send message to the SAME receiver
+Open a Transcript (console):"
+
+Transcript open.
+
+"Then:"
+
+Transcript show: ''hello''.
+Transcript show: ''Smalltalk''.
+Transcript cr.
+
+"is equivalent to:"
+
+Transcript 
+	   show: ''hello'';
+	   show: ''Smalltalk'' ;
+	   cr.
+
+"You can close the development tools by clicking on the red circle with a cross at the bottom left of the website.
+Try to go to the next lesson with a cascade of two ''next'' messages:"
+
+ProfStef'.
+!
+
+messageSyntaxCascadeShouldNotBeHere
+	^ Lesson
+title: 'Lost ?' 
+contents: 
+'"Hey, you should not be here !!!! 
+
+Go back and use a cascade !!"
+
+ProfStef previous.'.
+!
+
+messageSyntaxExecutionOrder
+	^ Lesson
+title: 'Message syntax: Execution order' 
+contents: 
+'"Unary messages are executed first, then binary messages and finally keyword messages:
+    Unary > Binary > Keywords"
+
+2.5 + 3.8 rounded.
+
+3 max: 2 + 2.
+  
+(0@0) class.
+
+0@0 x: 100.
+
+(0@0 x: 100) class.
+
+"Between messages of similar precedence, expressions are executed from left to right"
+
+-12345 negated asString reversed.
+
+ProfStef next.'
+!
+
+messageSyntaxExecutionOrderParentheses
+	^ Lesson
+title: 'Message syntax: Parentheses'
+contents: 
+'"Use parentheses to change order of evaluation"
+
+(2.5 + 3.8) rounded.
+
+(3 max: 2) + 2.
+
+ProfStef next.'
+!
+
+messageSyntaxKeyword
+	^ Lesson
+title: 'Message syntax: Keyword messages' 
+contents: 
+'"Keyword Messages are messages with arguments. They have the following form:
+    anObject akey: anotherObject akey2: anotherObject2"
+
+''Web development is a good deal of pain'' copyFrom: 1 to: 30
+
+"The message is copyFrom:to: sent to the String ''Web development is a good deal of pain''"
+
+1 max: 3.
+
+Array with: ''hello'' with: 2 with: Smalltalk.
+
+"The message is with:with:with: implemented on class Array. Note you can also write"
+
+Array
+	with: ''Hi there!!''
+	with: 2
+	with: Smalltalk.
+	
+ProfStef perform: ''next''.'
+!
+
+messageSyntaxUnary
+	^ Lesson
+title: 'Message syntax: Unary messages' 
+contents: 
+'"Messages are sent to objects. There are three types of message: Unary, Binary and Keyword.
+
+Unary messages have the following form:
+    anObject aMessage 
+
+You''ve already sent unary messages. For example:"
+
+1 class.
+
+false not.
+
+Date today.
+
+Number pi.
+
+"And of course: "
+
+ProfStef next.'
+!
+
+pharoEnvironment
+	^ Lesson
+title: 'Pharo environment' 
+contents: 
+'"Every Smalltalk system is full of objects. There are windows, text, numbers, dates, colors, points and much more. You can interact with objects in a much more direct way than is possible with other programming languages.
+
+Every object understands the message ''explore''. As a result, you get an Explorer window that shows details about the object."
+
+Date today explore.
+
+"This shows that the date object consists of a point in time (start) and a duration (one day long)."
+
+ProfStef explore.
+
+"You see, ProfStef class has a lot of objects. Let''s take a look at my code:"
+
+ProfStef browse.
+
+ProfStef next.'
+!
+
+printing 
+	^ Lesson
+title: 'Doing VS Printing: Printing' 
+contents: 
+'"Now you''re a Do It master !! Let''s talk about printing. It''s a Do It which prints the result next to the expression you''ve selected.
+For example, select the text below, and click on ''PrintIt'':"
+
+1 + 2.
+
+"As with ''DoIt'', there is also a shortcut to execute this command.
+
+Try CTRL-p on the following expressions:"
+
+Date today.
+
+"The result is selected, so you can erase it using the backspace key. Try it !!"
+
+Date today asDateString.
+
+Date today asTimeString.
+
+ProfStef next.'
+!
+
+reflection
+	^ Lesson
+title: 'Reflection' 
+contents: 
+'"You can inspect and change the system at runtime.
+
+Take a look at the source code of the method #and: of the class Boolean:"
+
+(Boolean methodDictionary at: ''and:'') source.
+
+"Or all the methods it sends:"
+
+(Boolean methodDictionary at: ''and:'') messageSends.
+
+"Here''s all the methods I implement:"
+
+ProfStef methodDictionary.
+
+"Let''s create a new method to go to the next lesson:"
+
+|newMethod|
+newMethod := Compiler new load: ''goToNextLesson ProfStef next.'' forClass: ProfStef.
+ProfStef class addCompiledMethod: newMethod
+
+"Wow!! I can''t wait to use my new method!!"
+
+ProfStef goToNextLesson.'
+!
+
+reflectionContinued
+	^ Lesson
+title: 'Reflection continued' 
+contents: 
+'"So cool, isn''t it ?  Before going further, let''s remove this method:"
+
+ProfStef class methodAt: #goToNextLesson.
+
+ProfStef class removeCompiledMethod: (ProfStef class methodAt: #goToNextLesson).
+
+ProfStef class methodAt: #goToNextLesson.
+
+
+"Then move forward:"
+
+ProfStef perform:#next'
+!
+
+theEnd
+	^ Lesson
+title: 'Tutorial done !!' 
+contents: 
+'"This tutorial is done. Enjoy programming Smalltalk with JTalk. 
+
+You can run this tutorial again by evaluating: ProfStef go.
+
+See you soon !!"
+'
+!
+
+welcome
+	^ Lesson
+title: 'Welcome' 
+contents: 
+' "Hello!! I''m Professor Stef. 
+
+You must want me to help you learn Smalltalk.
+
+So let''s go to the first lesson.  Select the text below and click on the ''DoIt'' button"
+
+ProfStef next.'
+! !
+

+ 11 - 0
examples/webos/README

@@ -0,0 +1,11 @@
+These are examples that can be run in webOS 3.0 using Enyo - the new UI framework that was released with 3.0.
+
+You can play with them:
+
+- In a real device (a Touchpad or Pre 3 at the moment), but then you would first need to install the webOS SDK 3.0. With your device connected through USB you should be able to do "make run" and it should get installed and started on your device!
+
+- In the emulator included in the SDK. Just start "palm-emulator" and then do "make run" in any of the examples.
+
+- In a WebKit based browser, like Chromium (on Linux, do "make chromium") or Safari on the Mac (yes, it works). But first you would need to ensure that you have a copy of the enyo directory (normally you find it in /opt/PalmSDK/0.1/share/refcode/framework/enyo on Linux, just copy that whole directory into the directory in which you have the jtalk clone from github. Then the relative path in the index.html file referencing Enyo should work.
+
+

BIN
examples/webos/eris/DuckQwaq.wav


+ 36 - 0
examples/webos/eris/EnyoJtalk.st

@@ -0,0 +1,36 @@
+"This is a base class for Jtalk Enyo UI classes. We keep track of an optional sister kind
+in Enyo and typically an instance of it, or an instance without a kind, called ui.
+
+NOTE: Inheritance of ivars seems broken, I need to use #ui: in subclass to set it"
+
+Object subclass: #EnyoFriend
+        instanceVariableNames: 'ui kind'
+        category: 'EnyoJtalk'!
+
+!EnyoFriend methodsFor: 'accessing'!
+
+ui
+	^ui
+!
+
+ui: aUI
+	ui := aUI
+!
+
+dollar
+	"Return the $ of ui for easy access to the components of the UI."
+	<return this['@ui'].$>
+!
+
+kind
+	^kind
+! !
+
+!EnyoFriend methodsFor: 'initializing'!
+initialize
+	"We make sure our JS functions can be used transparently from Jtalk,
+	at this moment we do not use it - trying to create Enyo kinds that are
+	at the same time Jtalk classes failed for me."
+	super initialize.
+	<this.allowJavaScriptCalls = true>
+! !

+ 0 - 0
examples/webos/eris/Eris.css


+ 86 - 0
examples/webos/eris/Eris.st

@@ -0,0 +1,86 @@
+EnyoFriend subclass: #Eris
+        instanceVariableNames: ''
+        category: 'Eris'!
+
+!Eris methodsFor: 'actions'!
+
+doIt
+    | result |
+    [ result := self eval: self dollar richText getValue ]
+	on: Error
+	do: [:ex |
+		^self warn: ex messageText title: 'Error' button: 'Ooops...'].
+    ^result
+!
+
+clear
+	self dollar richText setValue: ''
+!
+
+eval: aString
+    | compiler node |
+    compiler := Compiler new.
+    node := compiler parseExpression: aString.
+    node isParseFailure ifTrue: [
+	^self warn: 'Ehrm, you are a Smalltalk n00b, right? That is not valid syntax.' title: 'Parsing Error' button: 'Okidoki...'].
+    ^compiler loadExpression: aString.
+!
+
+printString
+	^''
+!
+
+warn: aString title: aTitle button: caption
+	| block popup |
+	block := [popup close].
+	<props = {kind: 'ModalDialog', caption: aTitle, components: [
+			{kind: 'Control', content: aString, className: 'enyo-text-error warning-icon'},
+			{kind: 'Button', caption: caption, onclick: 'closePopup', style: 'margin-top:10px'}],
+		 closePopup: block}>.
+	popup := enyo create: props.
+	popup openAtCenter
+!
+
+print: aString
+    self dollar richText setValue: (self dollar richText getValue), ' ', aString
+!
+
+quack
+	"(self kind: 'Sound'; src: 'DuckQwaq.wav'; create) play"
+	(enyo create: (Dictionary new at: 'kind' put: 'Sound'; at: 'src' put: 'DuckQwaq.wav'; yourself)) play
+!
+
+printIt
+    self print: self doIt printString
+! !
+
+!Eris methodsFor: 'initialization'!
+initialize
+	| props doItBlock printItBlock quackBlock clearBlock |
+	super initialize.
+	doItBlock := [self doIt].
+	printItBlock := [self printIt].
+	quackBlock := [self quack].
+	clearBlock := [self clear].
+
+	<props = {kind: 'VFlexBox', components: [
+			{kind: 'PageHeader', content: 'Eris'},
+ 			{kind: 'RowGroup', caption: 'Workspace', components: [
+				{kind: 'RichText', richContent: false,
+					value: 'Put some funky Jtalk code here...',
+					autoWordComplete: false, spellcheck: false, autocorrect: false,
+					autoCapitalize: 'lowercase', alwaysLooksFocused: true
+				},
+				{kind: 'Toolbar', components: [
+					{caption: 'Do it', onclick: 'doit'},
+					{caption: 'Print it', onclick: 'printit'},
+					{caption: 'Clear', onclick: 'clear'},
+					{kind: 'Spacer'},
+					{caption: 'Quack!!', onclick: 'quack'}]}]}],
+		doit: doItBlock,
+		printit: printItBlock,
+		quack: quackBlock,
+		clear: clearBlock}>.
+	ui := enyo create: props.
+! !
+

+ 37 - 0
examples/webos/eris/Makefile

@@ -0,0 +1,37 @@
+#
+# If you copy this file for an Enyo/Jtalk project, just
+# modify these first three lines
+# and then add .st files as you please. This Makefile
+# should pick them all up and compile into Program.js.
+#
+PACKAGE  := jtalk.eris
+VERSION  := 0.0.1
+FLAGS    := -L COMPILER
+
+IPK      := $(PACKAGE)_$(VERSION)_all.ipk
+FILE     := Program
+SOURCES  := $(wildcard *.st)
+OBJECTS  := $(patsubst %.st,%.js,$(wildcard *.st))
+FILEJS   := $(FILE).js
+
+$(FILEJS): $(SOURCES)
+	../../../bin/jtalkc $(FLAGS) $(SOURCES) $(FILE)
+
+$(IPK): $(FILEJS)
+	palm-package .
+
+clean:
+	rm -f $(FILEJS) $(OBJECTS) $(IPK)
+	palm-install -r $(PACKAGE)
+
+install: $(IPK)
+	palm-install $(IPK)
+
+# If you want to run it in the emulator, start the emulator first with palm-emulator
+run:    $(IPK)
+	palm-install $(IPK)
+	palm-launch $(PACKAGE)
+
+# This should fire it up in Chromium (at least under Ubuntu)
+chromium: $(FILEJS)
+	chromium-browser --allow-file-access-from-files index.html

+ 3 - 0
examples/webos/eris/README

@@ -0,0 +1,3 @@
+This is an example that was shown at ESUG 2011 running on a HP Touhpad with webOS 3.0.2.
+It shows the minimal beginning of a Jtalk development environment that dynamically can run and build Enyo applications.
+

+ 10 - 0
examples/webos/eris/appinfo.json

@@ -0,0 +1,10 @@
+{
+	"id": "jtalk.eris",
+	"version": "0.0.1",
+	"vendor": "Krampe Dynamic Development",
+	"type": "web",
+	"main": "index.html",
+	"title": "Eris",
+	"icon": "icon.png",
+	"uiRevision": 2
+}

+ 4 - 0
examples/webos/eris/depends.js

@@ -0,0 +1,4 @@
+enyo.depends(
+	"Program.js",
+	"Eris.css"
+);

+ 12 - 0
examples/webos/eris/index.html

@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+<head>
+	<title>Eris</title>
+	<script src="../../../../enyo/1.0/framework/enyo.js" type="text/javascript"></script>
+</head>
+<body>
+<script type="text/javascript">
+	smalltalk.Eris._new()._ui().renderInto(document.body);
+</script>
+</body>
+</html>

+ 36 - 0
examples/webos/hellojtalk/EnyoJtalk.st

@@ -0,0 +1,36 @@
+"This is a base class for Jtalk Enyo UI classes. We keep track of an optional sister kind
+in Enyo and typically an instance of it, or an instance without a kind, called ui.
+
+NOTE: Inheritance of ivars seems broken, I need to use #ui: in subclass to set it"
+
+Object subclass: #EnyoFriend
+        instanceVariableNames: 'ui kind'
+        category: 'EnyoJtalk'!
+
+!EnyoFriend methodsFor: 'accessing'!
+
+ui
+	^ui
+!
+
+ui: aUI
+	ui := aUI
+!
+
+dollar
+	"Return the $ of ui for easy access to the components of the UI."
+	<return this['@ui'].$>
+!
+
+kind
+	^kind
+! !
+
+!EnyoFriend methodsFor: 'initializing'!
+initialize
+	"We make sure our JS functions can be used transparently from Jtalk,
+	at this moment we do not use it - trying to create Enyo kinds that are
+	at the same time Jtalk classes failed for me."
+	super initialize.
+	<this.allowJavaScriptCalls = true>
+! !

+ 0 - 0
examples/webos/hellojtalk/HelloJtalk.css


+ 86 - 0
examples/webos/hellojtalk/HelloJtalk.st

@@ -0,0 +1,86 @@
+EnyoFriend subclass: #HelloJtalk
+        instanceVariableNames: 'count popup'
+        category: 'HelloJtalk'!
+
+!HelloJtalk methodsFor: 'accessing'!
+count
+	^count
+! !
+
+!HelloJtalk methodsFor: 'actions'!
+buttonClicked
+	count := count + 1.
+	self dollar input setValue: (self dollar input getValue, 'You clicked the button ', count asString, ' times so far').
+
+	"Okidoki, why not throw up a popup?"
+	popup openAtCenter
+!
+
+popupSelected: value
+	"The user picked a value in the popup."
+	self dollar input setValue: (self dollar input getValue, ' ', value)
+! !
+
+!HelloJtalk methodsFor: 'initialization'!
+initialize
+	"Create Enyo stuff and hook in callback blocks calling our action methods,
+	very similar to how Seaside does it.
+	Creating the templates for component construction
+	is clearly simpler to do in js. Yes, we can use
+	method temps inside the js code and ivars are accessed
+	using this syntax:
+
+		this['@ivarname']
+
+	We can not easily mix in arbitrary Jtalk expressions in the js code, thus
+	we use method temps for holding the blocks instead of embedding the blocks
+	directly. Blocks are js functions which is really neat. And we can use:
+
+		this._jtalkMessage()
+
+	to send messages to self for embedding the result."
+
+	| props block block2 |
+	super initialize.
+	count := 0.
+
+	"Create a callback block to embed below."
+	block := [self buttonClicked].
+
+	"We need to go through a method temp (props) for doing js, just inlining it
+	after 'enyo create:' does not work so js escaping is on the statement level
+	and not on the expression level."
+	<props = {
+		kind: 'VFlexBox',
+		components: [
+			{kind: 'PageHeader', content: 'Jtalk Live'},
+ 			{kind: "RowGroup", caption: "Rock on", components: [
+				{kind: 'Input', components: [
+					{kind: 'Button', caption: 'Click me', onclick: 'ablock'}]
+				}]
+			}],
+		ablock: block}>.
+	self ui: (enyo create: props).
+
+	"If we like we can create a kind for the UI (then the props need a name EnyoHelloJtalk),
+	but we do not have to in this case so this is commented out."
+	"self kind: (enyo kind: props).
+	<this['@ui'] = new EnyoHelloJtalk()>"
+
+	"This Enyo popup instance is created and held in an ivar for later use."
+	block2 := [:sender :value :old | self popupSelected: value].
+
+	<props = {kind: "Popup", components: [
+	    		{content: "Pick something you like a lot"},
+	    		{kind: "ListSelector", onChange: "popupSelected", value: "Foo", items: ["Foo", "Bar", "Bot"]
+			}],
+		popupSelected: block2}>.
+	popup := enyo create: props
+	
+! !
+
+!HelloJtalk class methodsFor: 'initialization'!
+initialize
+
+	enyo log: 'Class initialized'
+! !

+ 38 - 0
examples/webos/hellojtalk/Makefile

@@ -0,0 +1,38 @@
+#
+# If you copy this file for an Enyo/Jtalk project, just
+# modify these first two lines
+# and then add .st files as you please. This Makefile
+# should pick them all up and compile into Program.js.
+#
+PACKAGE  := jtalk.hellojtalk
+VERSION  := 1.0.0
+
+# -O for Closure optimization of js code.
+FLAGS    := -O
+IPK      := $(PACKAGE)_$(VERSION)_all.ipk
+FILE     := Program
+SOURCES  := $(wildcard *.st)
+OBJECTS  := $(patsubst %.st,%.js,$(wildcard *.st))
+FILEJS   := $(FILE).js
+
+$(FILEJS): $(SOURCES)
+	../../../bin/jtalkc $(FLAGS) $(SOURCES) $(FILE)
+
+$(IPK): $(FILEJS)
+	palm-package .
+
+clean:
+	rm -f $(FILEJS) $(OBJECTS) $(IPK)
+	palm-install -r $(PACKAGE)
+
+install: $(IPK)
+	palm-install $(IPK)
+
+# If you want to run it in the emulator, start the emulator first with palm-emulator
+run:    $(IPK)
+	palm-install $(IPK)
+	palm-launch $(PACKAGE)
+
+# This should fire it up in Chromium (at least under Ubuntu)
+chromium: $(FILEJS)
+	chromium-browser --allow-file-access-from-files index.html

+ 1 - 0
examples/webos/hellojtalk/README

@@ -0,0 +1 @@
+This is just a first kinda messy experiment with Enyo, doesn't do anything sensible.

+ 10 - 0
examples/webos/hellojtalk/appinfo.json

@@ -0,0 +1,10 @@
+{
+	"id": "jtalk.hellojtalk",
+	"version": "1.0.0",
+	"vendor": "Krampe Dynamic Development",
+	"type": "web",
+	"main": "index.html",
+	"title": "Enyo Hello Jtalk",
+	"icon": "icon.png",
+	"uiRevision": 2
+}

+ 4 - 0
examples/webos/hellojtalk/depends.js

@@ -0,0 +1,4 @@
+enyo.depends(
+	"Program.js",
+	"HelloJtalk.css"
+);

+ 12 - 0
examples/webos/hellojtalk/index.html

@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+<head>
+	<title>Enyo Jtalk HelloWorld</title>
+	<script src="../../../enyo/1.0/framework/enyo.js" type="text/javascript"></script>
+</head>
+<body>
+<script type="text/javascript">
+	smalltalk.HelloJtalk._new()._ui().renderInto(document.body);
+</script>
+</body>
+</html>

Some files were not shown because too many files changed in this diff