Example Group (Eg)
Last updated at 6:56 pm UTC on 11 June 2003
Goals
Provide examples for most of the classes.
Vision
If we had examples everywhere, it would be much easier to
- test code
- understand code
- type check code
- compose new code in a test-driven style
Howto
- Create a category on the class-side called example-objects
- Create your example there, stored in a method
exampleFoo
- Send the changeset to the list either as
- an enhancement [ENH][EG]whatever
- or as a part of a [TEST]
Example
TextUrl class >> exampleSqueak
^self new url: 'http://www.squeak.org'
Text class >> exampleSqueakLink
^self string: 'Squeak!' attribute: TextURL exampleSqueak
TextMorph class >> exampleSqueakLink
"self exampleSqueakLink openInWorld"
^self new contents: Text exampleSqueakLink
Examples made and sent
- TextURL
- Text
- TextMorph
- PopUpMenu
- exampleOneEntry
- exampleTwoEntries
Questions
- How do I send an example of drag and drop repel in Morph it involves defining methods and at least two classes?
- I think a class in a class category named Eg-example-objects-Morphic (dgd)
- Sounds like a test to me, where you use examples (mga)
People