Kernel-Helpers.st 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Smalltalk createPackage: 'Kernel-Helpers'!
  2. Trait named: #TSubclassable
  3. package: 'Kernel-Helpers'!
  4. !TSubclassable methodsFor: 'class creation'!
  5. subclass: aString
  6. "Kept for file-in compatibility."
  7. ^ self subclass: aString instanceVariableNames: '' package: nil
  8. !
  9. subclass: aString instanceVariableNames: anotherString
  10. "Kept for file-in compatibility."
  11. ^ self subclass: aString instanceVariableNames: anotherString package: nil
  12. !
  13. subclass: aString instanceVariableNames: aString2 category: aString3
  14. "Kept for file-in compatibility."
  15. ^ self subclass: aString instanceVariableNames: aString2 package: aString3
  16. !
  17. subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3
  18. "Kept for file-in compatibility. ignores class variables and pools."
  19. ^ self subclass: aString instanceVariableNames: aString2 package: aString3
  20. !
  21. subclass: aString instanceVariableNames: aString2 package: aString3
  22. ^ ClassBuilder new
  23. superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3
  24. !
  25. subclass: aString uses: aTraitCompositionDescription
  26. "Kept for file-in compatibility."
  27. ^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: '' package: nil
  28. !
  29. subclass: aString uses: aTraitCompositionDescription instanceVariableNames: anotherString
  30. "Kept for file-in compatibility."
  31. ^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: anotherString package: nil
  32. !
  33. subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 category: aString3
  34. "Kept for file-in compatibility."
  35. ^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3
  36. !
  37. subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3
  38. "Kept for file-in compatibility. ignores class variables and pools."
  39. ^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3
  40. !
  41. subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3
  42. | cls |
  43. cls := self subclass: aString instanceVariableNames: aString2 package: aString3.
  44. cls setTraitComposition: aTraitCompositionDescription asTraitComposition.
  45. ^ cls
  46. ! !