Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Answer to CommandShell exercise
Last updated at 3:12 pm UTC on 8 March 2018

Answer to CommandShell exercise


The fourth command will generate an error.
  1. Line one is evaluated as a complete Smalltalk expression, and succeeds.
  2. Line two is evaluated as a complete Smalltalk expression, and succeeds.
  3. Line three is evaluated as a pipeline after failing evaluation as a complete Smalltalk expression. It succeeds as a pipeline with one internal doIt proxy, and produces the same output as line one.
  4. Line four cannot be evaluated as a complete Smalltalk expression. The ";" token causes the command line to be evaluated as two pipelines. The expression for the first pipeline does not have a trailing "!" token, so it is assumed to be an external command, and fails. The second pipeline is evaluated as a doIt on the string 'cr!', which fails as an invalid Smalltalk expression. The error messages for both failures are accumulated on the shared error pipe, and are displayed in the terminal window.
  5. Line five is evaluated successfully as two pipelines, each consisting of one doIt proxy. The output is the same as for line two.