Browse Source

Merge pull request #42 from socinian/fixed_reflection_lesson_slide

Fixed reflection lesson slide.
Nicolas Petton 10 years ago
parent
commit
d7f9a99937
2 changed files with 5 additions and 2 deletions
  1. 1 1
      trysmalltalk/js/TrySmalltalk.js
  2. 4 1
      trysmalltalk/st/TrySmalltalk.st

+ 1 - 1
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: [],

+ 4 - 1
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!!"