home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 116.lha / SmallTalk / Sources / MUNIX.ST < prev    next >
Encoding:
Text File  |  1986-11-20  |  830 b   |  32 lines

  1. *
  2. * Little Smalltalk, version 2
  3. * Written by Tim Budd, Oregon State University, July 1987
  4. *
  5. * unix specific routines for the multiprocess front end
  6. *
  7. *
  8. Class Smalltalk
  9.     commandLoop        | string |
  10.         self openFiles.
  11.         scheduler new.
  12.         [ string <- stdin getPrompt: '>    '. string notNil ]
  13.             whileTrue: [ (string size strictlyPositive)
  14.                     ifTrue: [ self doIt: string ] ]
  15. |
  16.     doIt: aString        | method |
  17.         method <- Method new.
  18.         method text: ( 'proceed ', aString ).
  19.         (method compileWithClass: Object)
  20.             ifTrue: [ method executeWith: #( 1 ). 
  21.                   scheduler run ]
  22. |
  23.     error: aString        | process |
  24.         stderr print: 'Error: ', aString.
  25.         scheduler critical:
  26.             [ process <- scheduler currentProcess.
  27.               scheduler removeProcess: process].
  28.         " flush out current process "
  29.         scheduler currentProcess yield.
  30.         " could we do traceback here?"
  31. ]
  32.