[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Subclassing dictionary
From: |
Tim Felgentreff |
Subject: |
[Help-smalltalk] Subclassing dictionary |
Date: |
Sun, 20 Jun 2010 18:23:53 +0200 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
Trying to port the Squeak JSON package I came across rather strange behaviour.
One of the classes, JsonObject, is a subclass of dictionary. I noticed that
subclassing Dictionary would throw an error:
st> Dictionary subclass: JsonObject [
st> ]
st> JsonObject new
Object: JsonObject error: should not be implemented in this class, use
#basicNew instead
SystemExceptions.WrongMessageSent(Exception)>>signal (ExcHandling.st:254)
SystemExceptions.WrongMessageSent class>>signalOn:useInstead:
(SysExcept.st:1248)
JsonObject class(Behavior)>>basicNew: (Builtins.st:84)
JsonObject class(HashedCollection class)>>primNew: (HashedColl.st:44)
JsonObject class(HashedCollection class)>>new: (HashedColl.st:62)
JsonObject class(Dictionary class)>>new (Dictionary.st:70)
UndefinedObject>>executeStatements (a String:1)
nil
"Dictionary new" works as expected:
st> Dictionary new
Dictionary new (
)
st>
I don't understand the problem here, can somebody please shed some light on
this?
Thanks
Tim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
iEYEARECAAYFAkweQJkACgkQLbWJItnd6CwHewCgh+hp8oVie3ilYu5eV8duCIpV
CMkAmwUueUm6OYnCPLBanVLCV3zg153u
=IFIX
-----END PGP SIGNATURE-----
- [Help-smalltalk] Subclassing dictionary,
Tim Felgentreff <=