Skip to content

Commit

Permalink
Fixed reflection lesson slide. Changed #load:forClass: to #install:fo…
Browse files Browse the repository at this point in the history
…rClass:category: since #load:forClass: doesn't exist.
  • Loading branch information
Darius Clarke committed May 31, 2014
1 parent d13f1b4 commit 6cc6310
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion trysmalltalk/js/TrySmalltalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
5 changes: 4 additions & 1 deletion trysmalltalk/st/TrySmalltalk.st
Original file line number Diff line number Diff line change
Expand Up @@ -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!!"
Expand Down

2 comments on commit 6cc6310

@mandorman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I suggest something? It is about a naming conventions of the compiler object itself. Maybe the selector "install:" is a bit disafortunate, isn't it?

I don't know, but maybe should be better change to other name, perhaps "process:" or "parse:" (PD). Maybe for this reason is the key of the bug.

Whatever the decision you take is welcome. Thanks other time!

PD:
Compiler new
+ parse: ''goToNextLesson ProfStef next.''
+ forClass: ProfStef
+ category: ''navigation''.

@mandorman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see Herby,

Thanks for explanation, now makes more sense for me.

Please sign in to comment.