Re: DBI.Connection call yields "Object: nil error: did not understand #atEnd" in ST 3.2.91-b98173d

Holger Freyther <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
> On 31 Aug 2015, at 14:08, Mark Bratcher <[email protected]> wrote:
> 
> Thank you, Holger.
> 
> I understand the pragmatics of the decision. One could argue that, in the current bug case, the `(self new) stream: aStream ; initialize` statement is a bit "off-pattern". :) I think it's a little unfortunate that Pharo deviated from Smalltalk-80 in a small, but fundamental way. I think it means that if I want to write more portable Smalltalk code, I might avoid using "initialize" since its behavior will be different in Pharo (and now GNU) versus other implementations. Such avoidance would be necessary in cases where one wants instance initialization to be deferred after instance creation. 

Yes, it is unfortunate. But if you look at the diff that introduced this behavior then
you see that it was used a lot already. In both Pharo and GST there is >>#basicNew
as well but I don’t know if this is in an ANSI protocol.

So e.g. this could fix the issue you have debugged:

diff --git a/packages/dbd-mysql/Connection.st b/packages/dbd-mysql/Connection.st
index b97dc89..ef5ac65 100644
--- a/packages/dbd-mysql/Connection.st
+++ b/packages/dbd-mysql/Connection.st
@@ -237,7 +237,7 @@ Object subclass: MySQLPacket [
 
     MySQLPacket class >> on: aStream [
        <category: 'instance creation'>
-       ^(self new)
+       ^(self basicNew)
            stream: aStream;
            initialize
     ]



_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.