home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_200 / 232_01 / class.st < prev    next >
Text File  |  1987-06-17  |  1KB  |  50 lines

  1. Class Class
  2. [
  3.     edit
  4.         <ClassEdit self>
  5. |
  6.     list
  7.         <ClassList self>
  8. |
  9.      new        | superclass newinstance |
  10.         superclass <- <SuperClass self>.
  11.         <RespondsToNew superclass >
  12.             ifTrue: [newinstance <- superclass new ].
  13.         newinstance <- <ClassNew self newinstance >.
  14.         <RespondsTo self #new >
  15.             ifTrue: [newinstance <- newinstance new].
  16.         ^ newinstance
  17. |
  18.      new: aValue         | superclass newinstance |
  19.         superclass <- <SuperClass self>.
  20.         <RespondsToNew superclass >
  21.             ifTrue: [newinstance <- superclass new ].
  22.         newinstance <- <ClassNew self newinstance >.
  23.         <RespondsTo self #new: >
  24.             ifTrue: [newinstance <- newinstance new: aValue ].
  25.         ^ newinstance
  26. |
  27.      printString
  28.         ^ <ClassName self >
  29. |
  30.     respondsTo
  31.         <PrintMessages self>
  32. |
  33.     respondsTo: aSymbol        | aClass |
  34.         aClass <- self.
  35.         [aClass notNil] whileTrue:
  36.             [ <RespondsTo aClass aSymbol> ifTrue: [ ^ true ].
  37.              aClass <- aClass superClass ].
  38.         ^ false
  39. |
  40.     superClass
  41.         ^ <SuperClass self>
  42.  
  43. |
  44.     variables
  45.         ^ <Variables self>
  46. |
  47.     view
  48.         <ClassView self>
  49. ]
  50.