Next: 10 Miscellaneous
Up: Differences between Sather-1.0 and
Previous: 8 Iterators/Streams
In S1, there are no predefined methods in every class. In SK, there
are a variety. In general, the S1 policy was to place suspect methods
in the class so they would be easily noticed (as in
Oberon).
Built-in Methods:
- : In SK, the predefined dumps all fields of the
object, including private attributes. However, it may
be redefined. In S1, must be defined by the
class as an ordinary routine; a debugger or reflective
methods in must be used
for getting at private attributes. In SK is often
used for debugging.
- : In SK, the predefined computes object
equality for reference types and recursively for all
attributes for value types. However, it may be
redefined. = is sugar for . In S1,
does exactly the same thing, and
containers that distinguish between object and value
equality do so by typecasing on . In S1, =
is sugar for .
- : In SK, the predefined returns a type, which
may be converted to a string by application of .
In S1, this is accomplished with and
.
- In SK, all reference objects support a built-in copy,
discussed above. It is possible to redefine .
This list is not exhaustive.
Observations for S2: both languages manage to accomplish the same
things in slightly different ways, with the exception of converting
pointers to hashable integers (important for performance).