Workspace variables and scope.
jhouchin at texoma.net
Thu Feb 20 15:00:51 UTC 2003
I've been playing with ConnectionHandler code in the workspace.
Similar to this:
|output listener rfile fname fdir |
fdir := FileDirectory default fullName.
fname := fdir, '/hello25k.html'.
rfile := FileStream readOnlyFileNamed: fname.
rfile := rfile contentsOfEntireFile.
output _( 'HTTP/1.0 200 OK\Content-Type: text/html\\',rfile contents)
listener _ ConnectionHandler
handler: [:s | s getData; sendData: output; closeAndDestroy]
priority: Processor highIOPriority.
I will often copy and paste again in the Workspace.
I will modify the "onPort:" line and then 'doit'.
Questions I have when doing such are:
Do I need to change the variable names?
Or is the scope of the variable names only when 'selected' and executed?
Or am I playing with the code in a poor manner and I really should be
playing with such in a code browser?
Thanks for any suggestions or enlightenment.
More information about the Squeak-dev