I'm porting the ical package to Gemstone 3.1.0.1/GLASS 1.0beta9 using
GemTools 1.0b7. One of the issues I'm having is that I can't seem to signal a Notification without getting a CorruptObj (2261) error. The identical code works fine in Squeak/Pharo so I'm guessing there is something I don't understand about Gemstone. If you have a subclass of Notification called MyNotification and it only defines this method MyNotification>>defaultAction self resume: 2 Then when I printIt/doIt/inspectIt this line MyNotification signal I get a CorruptObj error. In Squeak/Pharo if I printIt I get a 2. Is this a gemstone bug or is there something else I should try? The ical package uses the resume value of the notification in parsing ical files. Thanks Paul |
Paul,
I've reproduced the error and I'm checking into it ... Dale ----- Original Message ----- | From: "Paul DeBruicker" <[hidden email]> | To: "GemStone Seaside beta discussion" <[hidden email]> | Sent: Thursday, February 21, 2013 6:13:57 AM | Subject: [GS/SS Beta] CorruptObj error when signalling a Notification | | I'm porting the ical package to Gemstone 3.1.0.1/GLASS 1.0beta9 using | GemTools 1.0b7. One of the issues I'm having is that I can't seem to | signal a Notification without getting a CorruptObj (2261) error. The | identical code works fine in Squeak/Pharo so I'm guessing there is | something I don't understand about Gemstone. | | | If you have a subclass of Notification called MyNotification and it only | defines this method | | MyNotification>>defaultAction | self resume: 2 | | | Then when I printIt/doIt/inspectIt this line | | MyNotification signal | | | I get a CorruptObj error. In Squeak/Pharo if I printIt I get a 2. Is | this a gemstone bug or is there something else I should try? The ical | package uses the resume value of the notification in parsing ical files. | | | Thanks | | Paul | |
In reply to this post by Paul DeBruicker
Paul,
It turns out that using #resume:, #return:, etc. in a default action is explicitly called out as illegal in the ANSI standard, so GemStone comforms to the standard by throwing an error in this case ... we're wrong to throw a CorrupttObj ... we should signal something a lot less dramatic. The right answer (i.e., conforming to the ANSI standard) is to change #defaultAction to explicitly return 2: MyNotification>>defaultAction ^2 Using this style produces the correct behavior in Pharo and GemStone (and VW)... Dale ----- Original Message ----- | From: "Paul DeBruicker" <[hidden email]> | To: "GemStone Seaside beta discussion" <[hidden email]> | Sent: Thursday, February 21, 2013 6:13:57 AM | Subject: [GS/SS Beta] CorruptObj error when signalling a Notification | | I'm porting the ical package to Gemstone 3.1.0.1/GLASS 1.0beta9 using | GemTools 1.0b7. One of the issues I'm having is that I can't seem to | signal a Notification without getting a CorruptObj (2261) error. The | identical code works fine in Squeak/Pharo so I'm guessing there is | something I don't understand about Gemstone. | | | If you have a subclass of Notification called MyNotification and it only | defines this method | | MyNotification>>defaultAction | self resume: 2 | | | Then when I printIt/doIt/inspectIt this line | | MyNotification signal | | | I get a CorruptObj error. In Squeak/Pharo if I printIt I get a 2. Is | this a gemstone bug or is there something else I should try? The ical | package uses the resume value of the notification in parsing ical files. | | | Thanks | | Paul | |
Just for grins, here's the relevant passage from the standard:
5.5.4.5 Message: resume Synopsis Return from the message that signaled the receiver. .. Errors It is erroneous to directly or indirectly send this message from within a #defaultAction method to the receiver of the #defaultAction method. .. ----- Original Message ----- | From: "Dale Henrichs" <[hidden email]> | To: "GemStone Seaside beta discussion" <[hidden email]> | Sent: Thursday, February 21, 2013 12:02:18 PM | Subject: Re: [GS/SS Beta] CorruptObj error when signalling a Notification | | Paul, | | It turns out that using #resume:, #return:, etc. in a default action is | explicitly called out as illegal in the ANSI standard, so GemStone comforms | to the standard by throwing an error in this case ... we're wrong to throw a | CorrupttObj ... we should signal something a lot less dramatic. | | The right answer (i.e., conforming to the ANSI standard) is to change | #defaultAction to explicitly return 2: | | MyNotification>>defaultAction | ^2 | | Using this style produces the correct behavior in Pharo and GemStone (and | VW)... | | Dale | | ----- Original Message ----- | | From: "Paul DeBruicker" <[hidden email]> | | To: "GemStone Seaside beta discussion" <[hidden email]> | | Sent: Thursday, February 21, 2013 6:13:57 AM | | Subject: [GS/SS Beta] CorruptObj error when signalling a Notification | | | | I'm porting the ical package to Gemstone 3.1.0.1/GLASS 1.0beta9 using | | GemTools 1.0b7. One of the issues I'm having is that I can't seem to | | signal a Notification without getting a CorruptObj (2261) error. The | | identical code works fine in Squeak/Pharo so I'm guessing there is | | something I don't understand about Gemstone. | | | | | | If you have a subclass of Notification called MyNotification and it only | | defines this method | | | | MyNotification>>defaultAction | | self resume: 2 | | | | | | Then when I printIt/doIt/inspectIt this line | | | | MyNotification signal | | | | | | I get a CorruptObj error. In Squeak/Pharo if I printIt I get a 2. Is | | this a gemstone bug or is there something else I should try? The ical | | package uses the resume value of the notification in parsing ical files. | | | | | | Thanks | | | | Paul | | | |
Free forum by Nabble | Edit this page |