at:tutorial:appendix
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
at:tutorial:appendix [2008/07/10 17:27] – added tvcutsem | at:tutorial:appendix [2008/07/10 17:41] – added tvcutsem | ||
---|---|---|---|
Line 617: | Line 617: | ||
==== Object Inspector ==== | ==== Object Inspector ==== | ||
+ | |||
+ | The module ''/ | ||
+ | |||
+ | < | ||
+ | import / | ||
+ | inspect(o); | ||
+ | </ | ||
+ | |||
+ | This will pop up a graphical inspector on the object, listing the object' | ||
==== Symbiosis Utilities ==== | ==== Symbiosis Utilities ==== | ||
+ | |||
+ | The module ''/ | ||
+ | |||
+ | < | ||
+ | long(anAmbientTalkNumber) -> aJavaLong | ||
+ | short(anAmbientTalkNumber) -> aJavaShort | ||
+ | float(anAmbientTalkFraction) -> aJavaFloat | ||
+ | byte(anAmbientTalkNumber) -> aJavaByte | ||
+ | </ | ||
+ | |||
+ | The module also defines the following function: | ||
+ | < | ||
+ | cast: obj into: Interface | ||
+ | </ | ||
+ | |||
+ | The '' | ||
==== Miscellaneous ==== | ==== Miscellaneous ==== | ||
+ | |||
+ | The module ''/ | ||
+ | |||
+ | === Random Numbers === | ||
+ | |||
+ | The utility module defines functions for easily generating random numbers. Its implementation uses the random number generators from the underlying JVM. The following functions are the most useful: | ||
+ | |||
+ | < | ||
+ | // generate a random integer in the interval [min, max[ | ||
+ | def randomNumberBetween(min, | ||
+ | // generate a random fraction in the interval [min, max[ | ||
+ | def randomFractionBetween(min, | ||
+ | </ | ||
+ | |||
+ | === Custom Object Serialization === | ||
+ | |||
+ | The method '' | ||
+ | |||
+ | < | ||
+ | //inside a mirror | ||
+ | def instancevar := ...; | ||
+ | def pass() { | ||
+ | uponArrivalBecome: | ||
+ | // return object to become here | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The function plays a role similar to '' |
at/tutorial/appendix.txt · Last modified: 2021/09/24 10:28 by elisag