TrySmalltalk.deploy.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. smalltalk.addClass('TrySmalltalkWidget', smalltalk.Widget, ['workspace'], 'TrySmalltalk');
  2. smalltalk.addMethod(
  3. '_renderOn_',
  4. smalltalk.method({
  5. selector: 'renderOn:',
  6. fn: function (html){
  7. var self=this;
  8. (function($rec){smalltalk.send($rec, "_id_", ["title"]);return smalltalk.send($rec, "_with_", [unescape("Try%20Smalltalk%21%21")]);})(smalltalk.send(html, "_h1", []));
  9. smalltalk.send(smalltalk.send(html, "_div", []), "_id_", ["profStefWorkspace"]);
  10. smalltalk.send(self, "_appendWorkspace", []);
  11. return self;}
  12. }),
  13. smalltalk.TrySmalltalkWidget);
  14. smalltalk.addMethod(
  15. '_workspace',
  16. smalltalk.method({
  17. selector: 'workspace',
  18. fn: function (){
  19. var self=this;
  20. return (($receiver = self['@workspace']) == nil || $receiver == undefined) ? (function(){self['@workspace']=smalltalk.send((smalltalk.ProfStefWorkspace || ProfStefWorkspace), "_new", []);smalltalk.send(smalltalk.send((smalltalk.ProfStef || ProfStef), "_default", []), "_widget_", [self]);return self['@workspace'];})() : $receiver;
  21. return self;}
  22. }),
  23. smalltalk.TrySmalltalkWidget);
  24. smalltalk.addMethod(
  25. '_appendWorkspace',
  26. smalltalk.method({
  27. selector: 'appendWorkspace',
  28. fn: function (){
  29. var self=this;
  30. smalltalk.send(smalltalk.send(self, "_workspace", []), "_appendToJQuery_", [smalltalk.send(unescape("%23profStefWorkspace"), "_asJQuery", [])]);
  31. smalltalk.send(smalltalk.send((smalltalk.ProfStef || ProfStef), "_default", []), "_showCurrentLesson", []);
  32. return self;}
  33. }),
  34. smalltalk.TrySmalltalkWidget);
  35. smalltalk.addClass('AbstractTutorial', smalltalk.Object, [], 'TrySmalltalk');
  36. smalltalk.addMethod(
  37. '_indexOfLesson_',
  38. smalltalk.method({
  39. selector: 'indexOfLesson:',
  40. fn: function (aSelector){
  41. var self=this;
  42. return smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_indexOf_", [aSelector]);
  43. return self;}
  44. }),
  45. smalltalk.AbstractTutorial);
  46. smalltalk.addMethod(
  47. '_tableOfContents',
  48. smalltalk.method({
  49. selector: 'tableOfContents',
  50. fn: function (){
  51. var self=this;
  52. return ["welcome", "testLesson", "theEnd"];
  53. return self;}
  54. }),
  55. smalltalk.AbstractTutorial);
  56. smalltalk.addMethod(
  57. '_welcome',
  58. smalltalk.method({
  59. selector: 'welcome',
  60. fn: function (){
  61. var self=this;
  62. return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Welcome", unescape("%22Hi%2C%20this%20is%20a%20test%20tutorial.%22")]);
  63. return self;}
  64. }),
  65. smalltalk.AbstractTutorial);
  66. smalltalk.addMethod(
  67. '_testLesson',
  68. smalltalk.method({
  69. selector: 'testLesson',
  70. fn: function (){
  71. var self=this;
  72. return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Test Lesson", unescape("%22This%20lesson%20is%20a%20test%22")]);
  73. return self;}
  74. }),
  75. smalltalk.AbstractTutorial);
  76. smalltalk.addMethod(
  77. '_theEnd',
  78. smalltalk.method({
  79. selector: 'theEnd',
  80. fn: function (){
  81. var self=this;
  82. return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["The End", unescape("%22And%20that%27d%20be%20pretty%20much%20it%20%3A%29%22")]);
  83. return self;}
  84. }),
  85. smalltalk.AbstractTutorial);
  86. smalltalk.addMethod(
  87. '_lessonAt_',
  88. smalltalk.method({
  89. selector: 'lessonAt:',
  90. fn: function (anInteger){
  91. var self=this;
  92. var lessonSelector=nil;
  93. lessonSelector=smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_at_", [anInteger]);
  94. return smalltalk.send(self, "_perform_", [lessonSelector]);
  95. return self;}
  96. }),
  97. smalltalk.AbstractTutorial);
  98. smalltalk.addMethod(
  99. '_size',
  100. smalltalk.method({
  101. selector: 'size',
  102. fn: function (){
  103. var self=this;
  104. return smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_size", []);
  105. return self;}
  106. }),
  107. smalltalk.AbstractTutorial);
  108. smalltalk.addClass('Lesson', smalltalk.Object, ['title', 'contents'], 'TrySmalltalk');
  109. smalltalk.addMethod(
  110. '_contents',
  111. smalltalk.method({
  112. selector: 'contents',
  113. fn: function (){
  114. var self=this;
  115. return (($receiver = self['@contents']) == nil || $receiver == undefined) ? (function(){return self['@contents']="";})() : $receiver;
  116. return self;}
  117. }),
  118. smalltalk.Lesson);
  119. smalltalk.addMethod(
  120. '_contents_',
  121. smalltalk.method({
  122. selector: 'contents:',
  123. fn: function (aString){
  124. var self=this;
  125. self['@contents']=aString;
  126. return self;}
  127. }),
  128. smalltalk.Lesson);
  129. smalltalk.addMethod(
  130. '_title_',
  131. smalltalk.method({
  132. selector: 'title:',
  133. fn: function (aString){
  134. var self=this;
  135. self['@title']=aString;
  136. return self;}
  137. }),
  138. smalltalk.Lesson);
  139. smalltalk.addMethod(
  140. '_title',
  141. smalltalk.method({
  142. selector: 'title',
  143. fn: function (){
  144. var self=this;
  145. return (($receiver = self['@title']) == nil || $receiver == undefined) ? (function(){return self['@title']="";})() : $receiver;
  146. return self;}
  147. }),
  148. smalltalk.Lesson);
  149. smalltalk.addMethod(
  150. '_title_contents_',
  151. smalltalk.method({
  152. selector: 'title:contents:',
  153. fn: function (aTitle, someContents){
  154. var self=this;
  155. return (function($rec){smalltalk.send($rec, "_title_", [aTitle]);return smalltalk.send($rec, "_contents_", [someContents]);})(smalltalk.send(self, "_new", []));
  156. return self;}
  157. }),
  158. smalltalk.Lesson.klass);
  159. smalltalk.addClass('TutorialPlayer', smalltalk.Object, ['tutorialPosition', 'tutorial'], 'TrySmalltalk');
  160. smalltalk.addMethod(
  161. '_currentLesson',
  162. smalltalk.method({
  163. selector: 'currentLesson',
  164. fn: function (){
  165. var self=this;
  166. return smalltalk.send(smalltalk.send(self, "_tutorial", []), "_lessonAt_", [smalltalk.send(self, "_tutorialPosition", [])]);
  167. return self;}
  168. }),
  169. smalltalk.TutorialPlayer);
  170. smalltalk.addMethod(
  171. '_first',
  172. smalltalk.method({
  173. selector: 'first',
  174. fn: function (){
  175. var self=this;
  176. smalltalk.send(self, "_rewind", []);
  177. return smalltalk.send(self, "_currentLesson", []);
  178. return self;}
  179. }),
  180. smalltalk.TutorialPlayer);
  181. smalltalk.addMethod(
  182. '_last',
  183. smalltalk.method({
  184. selector: 'last',
  185. fn: function (){
  186. var self=this;
  187. self['@tutorialPosition']=smalltalk.send(self, "_size", []);
  188. return smalltalk.send(self, "_currentLesson", []);
  189. return self;}
  190. }),
  191. smalltalk.TutorialPlayer);
  192. smalltalk.addMethod(
  193. '_next',
  194. smalltalk.method({
  195. selector: 'next',
  196. fn: function (){
  197. var self=this;
  198. (($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)]);})]);
  199. return smalltalk.send(self, "_currentLesson", []);
  200. return self;}
  201. }),
  202. smalltalk.TutorialPlayer);
  203. smalltalk.addMethod(
  204. '_previous',
  205. smalltalk.method({
  206. selector: 'previous',
  207. fn: function (){
  208. var self=this;
  209. (($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)]);})]);
  210. return smalltalk.send(self, "_currentLesson", []);
  211. return self;}
  212. }),
  213. smalltalk.TutorialPlayer);
  214. smalltalk.addMethod(
  215. '_rewind',
  216. smalltalk.method({
  217. selector: 'rewind',
  218. fn: function (){
  219. var self=this;
  220. self['@tutorialPosition']=(1);
  221. return self;}
  222. }),
  223. smalltalk.TutorialPlayer);
  224. smalltalk.addMethod(
  225. '_size',
  226. smalltalk.method({
  227. selector: 'size',
  228. fn: function (){
  229. var self=this;
  230. return smalltalk.send(smalltalk.send(self, "_tutorial", []), "_size", []);
  231. return self;}
  232. }),
  233. smalltalk.TutorialPlayer);
  234. smalltalk.addMethod(
  235. '_tutorial',
  236. smalltalk.method({
  237. selector: 'tutorial',
  238. fn: function (){
  239. var self=this;
  240. return (($receiver = self['@tutorial']) == nil || $receiver == undefined) ? (function(){return self['@tutorial']=smalltalk.send((smalltalk.SmalltalkSyntaxTutorial || SmalltalkSyntaxTutorial), "_new", []);})() : $receiver;
  241. return self;}
  242. }),
  243. smalltalk.TutorialPlayer);
  244. smalltalk.addMethod(
  245. '_tutorial_',
  246. smalltalk.method({
  247. selector: 'tutorial:',
  248. fn: function (aTutorial){
  249. var self=this;
  250. self['@tutorial']=aTutorial;
  251. return self;}
  252. }),
  253. smalltalk.TutorialPlayer);
  254. smalltalk.addMethod(
  255. '_tutorialPosition',
  256. smalltalk.method({
  257. selector: 'tutorialPosition',
  258. fn: function (){
  259. var self=this;
  260. return (($receiver = self['@tutorialPosition']) == nil || $receiver == undefined) ? (function(){smalltalk.send(self, "_rewind", []);return self['@tutorialPosition'];})() : $receiver;
  261. return self;}
  262. }),
  263. smalltalk.TutorialPlayer);
  264. smalltalk.addMethod(
  265. '_tutorialPosition_',
  266. smalltalk.method({
  267. selector: 'tutorialPosition:',
  268. fn: function (aTutorialPosition){
  269. var self=this;
  270. self['@tutorialPosition']=aTutorialPosition;
  271. return self;}
  272. }),
  273. smalltalk.TutorialPlayer);
  274. smalltalk.addClass('ProfStef', smalltalk.Object, ['tutorialPlayer', 'widget'], 'TrySmalltalk');
  275. smalltalk.addMethod(
  276. '_tutorialPlayer',
  277. smalltalk.method({
  278. selector: 'tutorialPlayer',
  279. fn: function (){
  280. var self=this;
  281. return (($receiver = self['@tutorialPlayer']) == nil || $receiver == undefined) ? (function(){return self['@tutorialPlayer']=smalltalk.send((smalltalk.TutorialPlayer || TutorialPlayer), "_new", []);})() : $receiver;
  282. return self;}
  283. }),
  284. smalltalk.ProfStef);
  285. smalltalk.addMethod(
  286. '_first',
  287. smalltalk.method({
  288. selector: 'first',
  289. fn: function (){
  290. var self=this;
  291. smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_first", []);
  292. return smalltalk.send(self, "_showCurrentLesson", []);
  293. return self;}
  294. }),
  295. smalltalk.ProfStef);
  296. smalltalk.addMethod(
  297. '_progress',
  298. smalltalk.method({
  299. selector: 'progress',
  300. fn: function (){
  301. var self=this;
  302. 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")]);
  303. return self;}
  304. }),
  305. smalltalk.ProfStef);
  306. smalltalk.addMethod(
  307. '_tutorialPositionString',
  308. smalltalk.method({
  309. selector: 'tutorialPositionString',
  310. fn: function (){
  311. var self=this;
  312. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_tutorialPosition", []), "_asString", []);
  313. return self;}
  314. }),
  315. smalltalk.ProfStef);
  316. smalltalk.addMethod(
  317. '_tutorialSizeString',
  318. smalltalk.method({
  319. selector: 'tutorialSizeString',
  320. fn: function (){
  321. var self=this;
  322. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_size", []), "_asString", []);
  323. return self;}
  324. }),
  325. smalltalk.ProfStef);
  326. smalltalk.addMethod(
  327. '_next',
  328. smalltalk.method({
  329. selector: 'next',
  330. fn: function (){
  331. var self=this;
  332. smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_next", []);
  333. return smalltalk.send(self, "_showCurrentLesson", []);
  334. return self;}
  335. }),
  336. smalltalk.ProfStef);
  337. smalltalk.addMethod(
  338. '_previous',
  339. smalltalk.method({
  340. selector: 'previous',
  341. fn: function (){
  342. var self=this;
  343. smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_previous", []);
  344. return smalltalk.send(self, "_showCurrentLesson", []);
  345. return self;}
  346. }),
  347. smalltalk.ProfStef);
  348. smalltalk.addMethod(
  349. '_widget_',
  350. smalltalk.method({
  351. selector: 'widget:',
  352. fn: function (aWidget){
  353. var self=this;
  354. self['@widget']=aWidget;
  355. return self;}
  356. }),
  357. smalltalk.ProfStef);
  358. smalltalk.addMethod(
  359. '_showCurrentLesson',
  360. smalltalk.method({
  361. selector: 'showCurrentLesson',
  362. fn: function (){
  363. var self=this;
  364. var lesson=nil;
  365. lesson=smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_currentLesson", []);
  366. smalltalk.send(smalltalk.send(self['@widget'], "_workspace", []), "_contents_", [smalltalk.send(lesson, "_contents", [])]);
  367. smalltalk.send(smalltalk.send(self['@widget'], "_workspace", []), "_title_", [smalltalk.send(smalltalk.send(smalltalk.send(lesson, "_title", []), "__comma", [" "]), "__comma", [smalltalk.send(self, "_progress", [])])]);
  368. return self;}
  369. }),
  370. smalltalk.ProfStef);
  371. smalltalk.ProfStef.klass.iVarNames = ['instance'];
  372. smalltalk.addMethod(
  373. '_first',
  374. smalltalk.method({
  375. selector: 'first',
  376. fn: function (){
  377. var self=this;
  378. return smalltalk.send(smalltalk.send(self, "_default", []), "_first", []);
  379. return self;}
  380. }),
  381. smalltalk.ProfStef.klass);
  382. smalltalk.addMethod(
  383. '_default',
  384. smalltalk.method({
  385. selector: 'default',
  386. fn: function (){
  387. var self=this;
  388. return (($receiver = self['@instance']) == nil || $receiver == undefined) ? (function(){return self['@instance']=smalltalk.send(self, "_new", []);})() : $receiver;
  389. return self;}
  390. }),
  391. smalltalk.ProfStef.klass);
  392. smalltalk.addMethod(
  393. '_previous',
  394. smalltalk.method({
  395. selector: 'previous',
  396. fn: function (){
  397. var self=this;
  398. return smalltalk.send(smalltalk.send(self, "_default", []), "_previous", []);
  399. return self;}
  400. }),
  401. smalltalk.ProfStef.klass);
  402. smalltalk.addMethod(
  403. '_next',
  404. smalltalk.method({
  405. selector: 'next',
  406. fn: function (){
  407. var self=this;
  408. return smalltalk.send(smalltalk.send(self, "_default", []), "_next", []);
  409. return self;}
  410. }),
  411. smalltalk.ProfStef.klass);
  412. smalltalk.addMethod(
  413. '_go',
  414. smalltalk.method({
  415. selector: 'go',
  416. fn: function (){
  417. var self=this;
  418. smalltalk.send(self, "_first", []);
  419. return self;}
  420. }),
  421. smalltalk.ProfStef.klass);
  422. smalltalk.addClass('SmalltalkSyntaxTutorial', smalltalk.AbstractTutorial, [], 'TrySmalltalk');
  423. smalltalk.addMethod(
  424. '_tableOfContents',
  425. smalltalk.method({
  426. selector: 'tableOfContents',
  427. fn: function (){
  428. var self=this;
  429. return ["welcome", "doingVSPrinting", "printing", "basicTypesNumbers", "basicTypesString", "basicTypesArray", "messageSyntaxUnary", "messageSyntaxBinary", "messageSyntaxKeyword", "messageSyntaxExecutionOrder", "messageSyntaxExecutionOrderParentheses", "mathematicalPrecedence", "messageSyntaxCascade", "messageSyntaxCascadeShouldNotBeHere", "blocks", "blocksAssignation", "conditionals", "loops", "iterators", "instanciation", "reflection", "reflectionContinued", "debugger", "theEnd"];
  430. return self;}
  431. }),
  432. smalltalk.SmalltalkSyntaxTutorial);
  433. smalltalk.addMethod(
  434. '_basicTypesArray',
  435. smalltalk.method({
  436. selector: 'basicTypesArray',
  437. fn: function (){
  438. var self=this;
  439. 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.")]);
  440. return self;}
  441. }),
  442. smalltalk.SmalltalkSyntaxTutorial);
  443. smalltalk.addMethod(
  444. '_basicTypesCharacters',
  445. smalltalk.method({
  446. selector: 'basicTypesCharacters',
  447. fn: function (){
  448. var self=this;
  449. 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.")]);
  450. return self;}
  451. }),
  452. smalltalk.SmalltalkSyntaxTutorial);
  453. smalltalk.addMethod(
  454. '_basicTypesDynamicArray',
  455. smalltalk.method({
  456. selector: 'basicTypesDynamicArray',
  457. fn: function (){
  458. var self=this;
  459. 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.")]);
  460. return self;}
  461. }),
  462. smalltalk.SmalltalkSyntaxTutorial);
  463. smalltalk.addMethod(
  464. '_basicTypesNumbers',
  465. smalltalk.method({
  466. selector: 'basicTypesNumbers',
  467. fn: function (){
  468. var self=this;
  469. 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.")]);
  470. return self;}
  471. }),
  472. smalltalk.SmalltalkSyntaxTutorial);
  473. smalltalk.addMethod(
  474. '_basicTypesString',
  475. smalltalk.method({
  476. selector: 'basicTypesString',
  477. fn: function (){
  478. var self=this;
  479. 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.")]);
  480. return self;}
  481. }),
  482. smalltalk.SmalltalkSyntaxTutorial);
  483. smalltalk.addMethod(
  484. '_basicTypesSymbol',
  485. smalltalk.method({
  486. selector: 'basicTypesSymbol',
  487. fn: function (){
  488. var self=this;
  489. 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.")]);
  490. return self;}
  491. }),
  492. smalltalk.SmalltalkSyntaxTutorial);
  493. smalltalk.addMethod(
  494. '_blocks',
  495. smalltalk.method({
  496. selector: 'blocks',
  497. fn: function (){
  498. var self=this;
  499. 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.")]);
  500. return self;}
  501. }),
  502. smalltalk.SmalltalkSyntaxTutorial);
  503. smalltalk.addMethod(
  504. '_blocksAssignation',
  505. smalltalk.method({
  506. selector: 'blocksAssignation',
  507. fn: function (){
  508. var self=this;
  509. 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.")]);
  510. return self;}
  511. }),
  512. smalltalk.SmalltalkSyntaxTutorial);
  513. smalltalk.addMethod(
  514. '_conditionals',
  515. smalltalk.method({
  516. selector: 'conditionals',
  517. fn: function (){
  518. var self=this;
  519. 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.")]);
  520. return self;}
  521. }),
  522. smalltalk.SmalltalkSyntaxTutorial);
  523. smalltalk.addMethod(
  524. '_debugger',
  525. smalltalk.method({
  526. selector: 'debugger',
  527. fn: function (){
  528. var self=this;
  529. 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")]);
  530. return self;}
  531. }),
  532. smalltalk.SmalltalkSyntaxTutorial);
  533. smalltalk.addMethod(
  534. '_doingVSPrinting',
  535. smalltalk.method({
  536. selector: 'doingVSPrinting',
  537. fn: function (){
  538. var self=this;
  539. 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.")]);
  540. return self;}
  541. }),
  542. smalltalk.SmalltalkSyntaxTutorial);
  543. smalltalk.addMethod(
  544. '_instanciation',
  545. smalltalk.method({
  546. selector: 'instanciation',
  547. fn: function (){
  548. var self=this;
  549. 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")]);
  550. return self;}
  551. }),
  552. smalltalk.SmalltalkSyntaxTutorial);
  553. smalltalk.addMethod(
  554. '_iterators',
  555. smalltalk.method({
  556. selector: 'iterators',
  557. fn: function (){
  558. var self=this;
  559. 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.")]);
  560. return self;}
  561. }),
  562. smalltalk.SmalltalkSyntaxTutorial);
  563. smalltalk.addMethod(
  564. '_loops',
  565. smalltalk.method({
  566. selector: 'loops',
  567. fn: function (){
  568. var self=this;
  569. 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.")]);
  570. return self;}
  571. }),
  572. smalltalk.SmalltalkSyntaxTutorial);
  573. smalltalk.addMethod(
  574. '_mathematicalPrecedence',
  575. smalltalk.method({
  576. selector: 'mathematicalPrecedence',
  577. fn: function (){
  578. var self=this;
  579. 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.")]);
  580. return self;}
  581. }),
  582. smalltalk.SmalltalkSyntaxTutorial);
  583. smalltalk.addMethod(
  584. '_messageSyntaxBinary',
  585. smalltalk.method({
  586. selector: 'messageSyntaxBinary',
  587. fn: function (){
  588. var self=this;
  589. 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.")]);
  590. return self;}
  591. }),
  592. smalltalk.SmalltalkSyntaxTutorial);
  593. smalltalk.addMethod(
  594. '_messageSyntaxCascade',
  595. smalltalk.method({
  596. selector: 'messageSyntaxCascade',
  597. fn: function (){
  598. var self=this;
  599. 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")]);
  600. return self;}
  601. }),
  602. smalltalk.SmalltalkSyntaxTutorial);
  603. smalltalk.addMethod(
  604. '_messageSyntaxCascadeShouldNotBeHere',
  605. smalltalk.method({
  606. selector: 'messageSyntaxCascadeShouldNotBeHere',
  607. fn: function (){
  608. var self=this;
  609. 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.")]);
  610. return self;}
  611. }),
  612. smalltalk.SmalltalkSyntaxTutorial);
  613. smalltalk.addMethod(
  614. '_messageSyntaxExecutionOrder',
  615. smalltalk.method({
  616. selector: 'messageSyntaxExecutionOrder',
  617. fn: function (){
  618. var self=this;
  619. 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.")]);
  620. return self;}
  621. }),
  622. smalltalk.SmalltalkSyntaxTutorial);
  623. smalltalk.addMethod(
  624. '_messageSyntaxExecutionOrderParentheses',
  625. smalltalk.method({
  626. selector: 'messageSyntaxExecutionOrderParentheses',
  627. fn: function (){
  628. var self=this;
  629. 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%0A%280@0%20extent%3A%20100@200%29%20bottomRight.%0A%0AProfStef%20next.")]);
  630. return self;}
  631. }),
  632. smalltalk.SmalltalkSyntaxTutorial);
  633. smalltalk.addMethod(
  634. '_messageSyntaxKeyword',
  635. smalltalk.method({
  636. selector: 'messageSyntaxKeyword',
  637. fn: function (){
  638. var self=this;
  639. 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.")]);
  640. return self;}
  641. }),
  642. smalltalk.SmalltalkSyntaxTutorial);
  643. smalltalk.addMethod(
  644. '_messageSyntaxUnary',
  645. smalltalk.method({
  646. selector: 'messageSyntaxUnary',
  647. fn: function (){
  648. var self=this;
  649. 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.")]);
  650. return self;}
  651. }),
  652. smalltalk.SmalltalkSyntaxTutorial);
  653. smalltalk.addMethod(
  654. '_pharoEnvironment',
  655. smalltalk.method({
  656. selector: 'pharoEnvironment',
  657. fn: function (){
  658. var self=this;
  659. 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.")]);
  660. return self;}
  661. }),
  662. smalltalk.SmalltalkSyntaxTutorial);
  663. smalltalk.addMethod(
  664. '_printing',
  665. smalltalk.method({
  666. selector: 'printing',
  667. fn: function (){
  668. var self=this;
  669. 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.")]);
  670. return self;}
  671. }),
  672. smalltalk.SmalltalkSyntaxTutorial);
  673. smalltalk.addMethod(
  674. '_reflection',
  675. smalltalk.method({
  676. selector: 'reflection',
  677. fn: function (){
  678. var self=this;
  679. 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.")]);
  680. return self;}
  681. }),
  682. smalltalk.SmalltalkSyntaxTutorial);
  683. smalltalk.addMethod(
  684. '_reflectionContinued',
  685. smalltalk.method({
  686. selector: 'reflectionContinued',
  687. fn: function (){
  688. var self=this;
  689. 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")]);
  690. return self;}
  691. }),
  692. smalltalk.SmalltalkSyntaxTutorial);
  693. smalltalk.addMethod(
  694. '_theEnd',
  695. smalltalk.method({
  696. selector: 'theEnd',
  697. fn: function (){
  698. var self=this;
  699. 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")]);
  700. return self;}
  701. }),
  702. smalltalk.SmalltalkSyntaxTutorial);
  703. smalltalk.addMethod(
  704. '_welcome',
  705. smalltalk.method({
  706. selector: 'welcome',
  707. fn: function (){
  708. var self=this;
  709. 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.")]);
  710. return self;}
  711. }),
  712. smalltalk.SmalltalkSyntaxTutorial);