diff --git a/trysmalltalk/js/TrySmalltalk.js b/trysmalltalk/js/TrySmalltalk.js index dce34d6..e353fa1 100644 --- a/trysmalltalk/js/TrySmalltalk.js +++ b/trysmalltalk/js/TrySmalltalk.js @@ -604,7 +604,7 @@ var self=this; function $Lesson(){return globals.Lesson||(typeof Lesson=="undefined"?nil:Lesson)} return smalltalk.withContext(function($ctx1) { var $1; -$1=_st($Lesson())._title_contents_("Reflection","\x22You can inspect and change the system at runtime.\x0a\x0aTake a look at the source code of the method #and: of the class Boolean:\x22\x0a\x0a(Boolean methodDictionary at: 'and:') source.\x0a\x0a\x22Or all the methods it sends:\x22\x0a\x0a(Boolean methodDictionary at: 'and:') messageSends.\x0a\x0a\x22Here's all the methods I implement:\x22\x0a\x0aProfStef methodDictionary.\x0a\x0a\x22Let's create a new method to go to the next lesson:\x22\x0a\x0a|newMethod|\x0anewMethod := Compiler new load: 'goToNextLesson ProfStef next.' forClass: ProfStef.\x0aProfStef class addCompiledMethod: newMethod\x0a\x0a\x22Wow! I can't wait to use my new method!\x22\x0a\x0aProfStef goToNextLesson."); +$1=_st($Lesson())._title_contents_("Reflection","\x22You can inspect and change the system at runtime.\x0a\x0aTake a look at the source code of the method #and: of the class Boolean:\x22\x0a\x0a(Boolean methodDictionary at: 'and:') source.\x0a\x0a\x22Or all the methods it sends:\x22\x0a\x0a(Boolean methodDictionary at: 'and:') messageSends.\x0a\x0a\x22Here's all the methods I implement:\x22\x0a\x0aProfStef methodDictionary.\x0a\x0a\x22Let's create a new method to go to the next lesson:\x22\x0a\x0a|newMethod|\x0anewMethod := Compiler new \x0ainstall: ''goToNextLesson ProfStef next.''\x0aforClass: ProfStef\x0acategory: ''navigation''.\x0a\x0aProfStef class addCompiledMethod: newMethod\x0a\x0a\x22Wow! I can't wait to use my new method!\x22\x0a\x0aProfStef goToNextLesson."); return $1; }, function($ctx1) {$ctx1.fill(self,"reflection",{},globals.SmalltalkSyntaxTutorial)})}, args: [], diff --git a/trysmalltalk/st/TrySmalltalk.st b/trysmalltalk/st/TrySmalltalk.st index d3528d3..45659e8 100644 --- a/trysmalltalk/st/TrySmalltalk.st +++ b/trysmalltalk/st/TrySmalltalk.st @@ -679,7 +679,10 @@ ProfStef methodDictionary. "Let''s create a new method to go to the next lesson:" |newMethod| -newMethod := Compiler new load: ''goToNextLesson ProfStef next.'' forClass: ProfStef. +newMethod := Compiler new + install: ''goToNextLesson ProfStef next.'' + forClass: ProfStef + category: ''navigation''. ProfStef class addCompiledMethod: newMethod "Wow!! I can''t wait to use my new method!!"