Browse Source

Smalltalk documentation

Nicolas Petton 12 years ago
parent
commit
64e76f4b1d
2 changed files with 27 additions and 0 deletions
  1. 1 0
      js/Kernel-Objects.js
  2. 26 0
      st/Kernel-Objects.st

+ 1 - 0
js/Kernel-Objects.js

@@ -891,6 +891,7 @@ smalltalk.Object.klass);
 
 
 smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
+smalltalk.Smalltalk.comment=unescape('Smalltalk%20has%20only%20one%20instance%2C%20accessed%20with%20%60Smalltalk%20current%60.%20%0AIt%20represents%20the%20global%20JavaScript%20variable%20%60smalltalk%60%20declared%20in%20%60js/boot.js%60.%0A%0AThe%20%60smalltalk%60%20object%20holds%20all%20class%20and%20packages%20defined%20in%20the%20system.%0A%0A%23%23%20Classes%0A%0AClasses%20can%20be%20accessed%20using%20the%20following%20methods%3A%0A%0A-%20%60%23classes%60%20answers%20the%20full%20list%20of%20Smalltalk%20classes%20in%20the%20system%0A-%20%60%23at%3A%60%20answers%20a%20specific%20class%20of%20%60nil%60%0A%0A%23%23%20Packages%0A%0APackages%20can%20be%20accessed%20using%20the%20following%20methods%3A%0A%0A-%20%60%23packages%60%20answers%20the%20full%20list%20of%20packages%0A-%20%60%23packageAt%3A%60%20answers%20a%20specific%20class%20of%20%60nil%60%0A%0A__note%3A__%20classes%20and%20packages%20are%20accessed%20using%20strings%2C%20not%20symbols%0A%0A%23%23%20Parsing%0A%0AThe%20%60%23parse%3A%60%20method%20is%20used%20to%20parse%20Smalltalk%20source%20code.%20%0AIt%20requires%20the%20%60Compiler%60%20package%20and%20the%20%60js/parser.js%60%20parser%20file%20in%20order%20to%20work')
 smalltalk.addMethod(
 unescape('_classes'),
 smalltalk.method({

+ 26 - 0
st/Kernel-Objects.st

@@ -315,6 +315,32 @@ initialize
 Object subclass: #Smalltalk
 	instanceVariableNames: ''
 	category: 'Kernel-Objects'!
+!Smalltalk commentStamp!
+Smalltalk has only one instance, accessed with `Smalltalk current`. 
+It represents the global JavaScript variable `smalltalk` declared in `js/boot.js`.
+
+The `smalltalk` object holds all class and packages defined in the system.
+
+## Classes
+
+Classes can be accessed using the following methods:
+
+- `#classes` answers the full list of Smalltalk classes in the system
+- `#at:` answers a specific class of `nil`
+
+## Packages
+
+Packages can be accessed using the following methods:
+
+- `#packages` answers the full list of packages
+- `#packageAt:` answers a specific class of `nil`
+
+__note:__ classes and packages are accessed using strings, not symbols
+
+## Parsing
+
+The `#parse:` method is used to parse Smalltalk source code. 
+It requires the `Compiler` package and the `js/parser.js` parser file in order to work!
 
 !Smalltalk methodsFor: 'accessing'!