Class.st
changeset 357 82091a50055d
parent 356 6c5ce0e1e7a8
child 359 b8df66983eff
equal deleted inserted replaced
356:6c5ce0e1e7a8 357:82091a50055d
    19 
    19 
    20 Class comment:'
    20 Class comment:'
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    22 	      All Rights Reserved
    22 	      All Rights Reserved
    23 
    23 
    24 $Header: /cvs/stx/stx/libbasic/Class.st,v 1.44 1995-05-24 12:41:53 claus Exp $
    24 $Header: /cvs/stx/stx/libbasic/Class.st,v 1.45 1995-06-06 03:53:27 claus Exp $
    25 '!
    25 '!
    26 
    26 
    27 !Class class methodsFor:'documentation'!
    27 !Class class methodsFor:'documentation'!
    28 
    28 
    29 copyright
    29 copyright
    40 "
    40 "
    41 !
    41 !
    42 
    42 
    43 version
    43 version
    44 "
    44 "
    45 $Header: /cvs/stx/stx/libbasic/Class.st,v 1.44 1995-05-24 12:41:53 claus Exp $
    45 $Header: /cvs/stx/stx/libbasic/Class.st,v 1.45 1995-06-06 03:53:27 claus Exp $
    46 "
    46 "
    47 !
    47 !
    48 
    48 
    49 documentation
    49 documentation
    50 "
    50 "
   580     "return the primitiveSpec or nil"
   580     "return the primitiveSpec or nil"
   581 
   581 
   582     ^  primitiveSpec
   582     ^  primitiveSpec
   583 !
   583 !
   584 
   584 
       
   585 primitiveSpec:anArrayOf3ElementsOrNil
       
   586     "set the primitiveSpec or nil"
       
   587 
       
   588     primitiveSpec := anArrayOf3ElementsOrNil
       
   589 !
       
   590 
   585 primitiveDefinitionsString
   591 primitiveDefinitionsString
   586     "return the primitiveDefinition string or nil"
   592     "return the primitiveDefinition string or nil"
   587 
   593 
   588     ^ self primitiveSpecs:1
   594     ^ self getPrimitiveSpecsAt:1
   589 
   595 
   590     "
   596     "
   591      Object primitiveDefinitionsString 
   597      Object primitiveDefinitionsString 
   592      String primitiveDefinitionsString
   598      String primitiveDefinitionsString
   593     "
   599     "
   594 !
   600 !
   595 
   601 
   596 primitiveVariablesString
   602 primitiveVariablesString
   597     "return the primitiveVariables string or nil"
   603     "return the primitiveVariables string or nil"
   598 
   604 
   599     ^ self primitiveSpecs:2 
   605     ^ self getPrimitiveSpecsAt:2 
   600 !
   606 !
   601 
   607 
   602 primitiveFunctionsString
   608 primitiveFunctionsString
   603     "return the primitiveFunctions string or nil"
   609     "return the primitiveFunctions string or nil"
   604 
   610 
   605     ^ self primitiveSpecs:3 
   611     ^ self getPrimitiveSpecsAt:3 
   606 !
   612 !
   607 
   613 
   608 primitiveDefinitions:aString
   614 primitiveDefinitions:aString
   609     "set the primitiveDefinition string"
   615     "set the primitiveDefinition string"
   610 
   616 
   611     ^ self setPrimitiveSpecs:1 to:aString
   617     ^ self setPrimitiveSpecsAt:1 to:aString
   612 !
   618 !
   613 
   619 
   614 primitiveVariables:aString
   620 primitiveVariables:aString
   615     "set the primitiveVariable string"
   621     "set the primitiveVariable string"
   616 
   622 
   617     ^ self setPrimitiveSpecs:2 to:aString
   623     ^ self setPrimitiveSpecsAt:2 to:aString
   618 !
   624 !
   619 
   625 
   620 primitiveFunctions:aString
   626 primitiveFunctions:aString
   621     "set the primitiveFunction string"
   627     "set the primitiveFunction string"
   622 
   628 
   623     ^ self setPrimitiveSpecs:3 to:aString
   629     ^ self setPrimitiveSpecsAt:3 to:aString
   624 !
   630 !
   625 
   631 
   626 classFilename
   632 classFilename
   627     "return the name of the file from which the class was compiled.
   633     "return the name of the file from which the class was compiled.
   628      This is currently NOT used."
   634      This is currently NOT used."
  1412 	superclass addAllCategoriesTo:aCollection
  1418 	superclass addAllCategoriesTo:aCollection
  1413     ].
  1419     ].
  1414     self addCategoriesTo:aCollection
  1420     self addCategoriesTo:aCollection
  1415 !
  1421 !
  1416 
  1422 
  1417 primitiveSpecs:index
  1423 getPrimitiveSpecsAt:index
  1418     "return a primitiveSpecification component as string or nil"
  1424     "return a primitiveSpecification component as string or nil"
  1419 
  1425 
  1420     |pos stream string|
  1426     |pos stream string|
  1421 
  1427 
  1422     primitiveSpec isNil ifTrue:[^ nil].
  1428     primitiveSpec isNil ifTrue:[^ nil].
  1439 	^ nil
  1445 	^ nil
  1440     ].
  1446     ].
  1441     ^ pos
  1447     ^ pos
  1442 !
  1448 !
  1443 
  1449 
  1444 setPrimitiveSpecs:index to:aString
  1450 setPrimitiveSpecsAt:index to:aString
  1445     "set a primitiveSpecification component to aString"
  1451     "set a primitiveSpecification component to aString"
  1446 
  1452 
  1447     primitiveSpec isNil ifTrue:[
  1453     primitiveSpec isNil ifTrue:[
  1448 	primitiveSpec := Array new:3
  1454 	primitiveSpec := Array new:3
  1449     ].
  1455     ].
  2024     "
  2030     "
  2025      if file exists, copy the existing to a .sav-file,
  2031      if file exists, copy the existing to a .sav-file,
  2026      create the new file as XXX.new-file,
  2032      create the new file as XXX.new-file,
  2027      and, if that worked rename afterwards ...
  2033      and, if that worked rename afterwards ...
  2028     "
  2034     "
  2029     fileName asFilename exists ifTrue:[
  2035     (fileName asFilename exists 
       
  2036     and:[classFilename notNil]) ifTrue:[
  2030 	"
  2037 	"
  2031 	 check for overwriting my current source file
  2038 	 check for overwriting my current source file
  2032 	 this is not allowed, since it would clobber my methods source
  2039 	 this is not allowed, since it would clobber my methods source
  2033 	 file ... you have to save it to some other place.
  2040 	 file ... you have to save it to some other place.
  2034 	 This happens if you ask for a fileOut into the source-directory
  2041 	 This happens if you ask for a fileOut into the source-directory