Class.st
changeset 656 8b7e135d0272
parent 655 aaac1967bed4
child 657 449935f15b9e
equal deleted inserted replaced
655:aaac1967bed4 656:8b7e135d0272
   104     WARNING: layout known by compiler and runtime system
   104     WARNING: layout known by compiler and runtime system
   105 "
   105 "
   106 !
   106 !
   107 
   107 
   108 version
   108 version
   109 ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.86 1995-11-25 18:18:20 cg Exp $'! !
   109 ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.87 1995-11-25 19:10:38 cg Exp $'! !
   110 
   110 
   111 !Class class methodsFor:'initialization'!
   111 !Class class methodsFor:'initialization'!
   112 
   112 
   113 initialize
   113 initialize
   114     "the classvariable 'UpdatingChanges' controls if changes are put
   114     "the classvariable 'UpdatingChanges' controls if changes are put
  2861      nil is returned."
  2861      nil is returned."
  2862 
  2862 
  2863     |cls meta m src val|
  2863     |cls meta m src val|
  2864 
  2864 
  2865     self isMeta ifTrue:[
  2865     self isMeta ifTrue:[
  2866 	meta := self. cls := meta soleInstance
  2866 	meta := self. cls := self soleInstance
  2867     ] ifFalse:[
  2867     ] ifFalse:[
  2868 	cls := self. meta := self class
  2868 	cls := self. meta := self class
  2869     ].
  2869     ].
  2870 
  2870 
  2871     m := meta compiledMethodAt:#version.
  2871     m := meta compiledMethodAt:#version.
  2872     m isNil ifTrue:[^ nil].
  2872     m isNil ifTrue:[
       
  2873 	m := cls compiledMethodAt:#version.
       
  2874 	m isNil ifTrue:[^ nil].
       
  2875     ].
  2873 
  2876 
  2874     "/ if its a method returning the string,
  2877     "/ if its a method returning the string,
  2875     val := cls version.
  2878     val := cls version.
  2876     val isString ifTrue:[^ val].
  2879     val isString ifTrue:[^ val].
  2877 
  2880 
  2896     "extract a revision string from a methods source string"
  2899     "extract a revision string from a methods source string"
  2897 
  2900 
  2898     |lines idx val|
  2901     |lines idx val|
  2899 
  2902 
  2900     lines := aMethodSourceString asCollectionOfLines.
  2903     lines := aMethodSourceString asCollectionOfLines.
  2901     idx := lines findFirst:[:l |
  2904     lines do:[:l |
  2902 	l withoutSpaces startsWith:'$Header'
  2905 	|i|
  2903     ].
  2906 
  2904     idx == 0 ifTrue:[^ nil].
  2907 	i := l indexOfSubCollection:'$Header: '.
  2905     ^ lines at:idx.
  2908 	i ~~ 0 ifTrue:[
  2906 
  2909 	    ^ l copyFrom:i
  2907     "Created: 15.11.1995 / 15:01:19 / cg"
  2910 	]
       
  2911     ].
       
  2912     ^ nil
  2908 !
  2913 !
  2909 
  2914 
  2910 setPrimitiveSpecsAt:index to:aString
  2915 setPrimitiveSpecsAt:index to:aString
  2911     "set a primitiveSpecification component to aString"
  2916     "set a primitiveSpecification component to aString"
  2912 
  2917