1
0

Kernel-Transcript.st 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Smalltalk current createPackage: 'Kernel-Transcript' properties: #{}!
  2. Object subclass: #Transcript
  3. instanceVariableNames: 'textarea'
  4. category: 'Kernel-Transcript'!
  5. Transcript class instanceVariableNames: 'current'!
  6. !Transcript class methodsFor: 'instance creation'!
  7. open
  8. self current open
  9. !
  10. new
  11. self shouldNotImplement
  12. !
  13. current
  14. ^current
  15. !
  16. register: aTranscript
  17. current := aTranscript
  18. ! !
  19. !Transcript class methodsFor: 'printing'!
  20. show: anObject
  21. self current show: anObject
  22. !
  23. cr
  24. self current show: String cr
  25. !
  26. clear
  27. self current clear
  28. ! !
  29. Object subclass: #ConsoleTranscript
  30. instanceVariableNames: 'textarea'
  31. category: 'Kernel-Transcript'!
  32. !ConsoleTranscript methodsFor: 'actions'!
  33. open
  34. ! !
  35. !ConsoleTranscript methodsFor: 'printing'!
  36. clear
  37. "no op"
  38. !
  39. cr
  40. "no op"
  41. !
  42. show: anObject
  43. | string |
  44. string := anObject asString.
  45. <console.log(String(string))>
  46. ! !
  47. !ConsoleTranscript class methodsFor: 'initialization'!
  48. initialize
  49. Transcript register: self new
  50. ! !