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

Mark Bratcher <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <CAH7b3yBA1wSvs8PPhhnK+W1kh5ygD9OMPO3QoeeobLAbG3zTVw@mail.gmail.com>
Holger

I think that using `basicNew` is reasonable pattern for a solution in this
case. Thank you!

Mark

On Mon, Aug 31, 2015 at 8:17 AM, Holger Freyther <[email protected]> wrote:

>
> > 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.