Skip to content

Fixed reflection lesson slide. #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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\x0aprotocol: ''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
protocol: ''navigation''.
ProfStef class addCompiledMethod: newMethod

"Wow!! I can''t wait to use my new method!!"
Expand Down