help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] DBI.Connection call yields "Object: nil error: did


From: Mark Bratcher
Subject: Re: [Help-smalltalk] DBI.Connection call yields "Object: nil error: did not understand #atEnd" in ST 3.2.91-b98173d
Date: Mon, 31 Aug 2015 09:11:38 -0400

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 <address@hidden> wrote:

>
> > On 31 Aug 2015, at 14:08, Mark Bratcher <address@hidden> 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
>      ]
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]