Workspace variables and scope.

Jimmie Houchin jhouchin at
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) 
withCRs withInternetLineEndings.
listener _ ConnectionHandler
           onPort: 8000
           handler: [:s | s getData; sendData: output; closeAndDestroy]
           priority: Processor highIOPriority.
listener start.

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.

Jimmie Houchin

More information about the Squeak-dev mailing list