Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
June 2019
- 52 participants
- 138 messages
Re: [Pharo-users] ODBCDriver
by Tomaž Turk
I see - thanks!
Best wishes,
Tomaz
------ Original Message ------
From: "Julián Maestri" <serpi90(a)gmail.com>
To: "Tomaž Turk" <tomaz.turk(a)ef.uni-lj.si>; "Any question about pharo is
welcome" <pharo-users(a)lists.pharo.org>
Sent: 3.6.2019 16:03:25
Subject: Re: [Pharo-users] ODBCDriver
>As far as I know, he just started porting it to Pharo 7.
>
>On Sun, Jun 2, 2019, 13:51 Tomaž Turk <tomaz.turk(a)ef.uni-lj.si> wrote:
>>I just found this marvel: https://github.com/apiorno/ODBCDriver.
>>
>>But when I try to
>>
>>| con |
>>con := ODBCConnection dsn:'myDSN' user:'usr' password:'pwd'.
>>
>>it responds with an error "Instance of ODBCLibrary class did not
>>understand #sqlAllocEnv":
>>
>>
>>running on Win 10 and Pharo 7.0.3. I'd appreciate any help.
>>
>>Best wishes,
>>Tomaz
>>
>>
June 3, 2019
Re: [Pharo-users] Find after in strings?
by Tim Mackinnon
Would it be really bad to use the deprecation feature in Pharo to gently migrate to a more common name in stream? There are 101 senders of match: (in my P7 image - presumably some of them my usage), and a lot of them actually referring to string regex match:. Its big but not immense.
#match: normally has the connotation with the String regex matching, not stream skipping, so it might not be too bad (in my mind, and hence why I was a bit caught out - although having some equivalent in a string would be handy too). The deprecation mechanism over time would begin to convert them over from sheer usage wouldnât it?
How do we decide such things? Is there some proposal mechanism?
Tim
> On 3 Jun 2019, at 15:47, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
> To each his own opinion, #match: is not that bad a name, IMHO.
>
> There is much more bloat than the mixing of reading and writing.
>
> The concept of being positionable is bad too: it makes no sense for network and other non-collection backed streams.
>
> There is also all the binary, encoding and converting API that assumes a specific type of element, an assumption that is not always correct.
>
> Yes, Traits could help, but all this is a lot of work.
>
> And I feel like this is a lost battle: everybody keeps on asking to put his/her favourite methods back.
>
>> On 3 Jun 2019, at 00:20, Richard O'Keefe <raoknz(a)gmail.com> wrote:
>>
>> The issue is that #skipToAll: is the de facto standard name for the
>> operation EXCEPT in Squeak and Pharo. It's not that an alias should
>> be added. What should *really* be done is that #match: should be
>> *renamed* to #skipToAll:. This will
>> - improve compatibility
>> - reduce confusion
>> - improve navigability
>>
>> At the moment, for example, it is much harder to discover the
>> consequences of renaming the #match: method than it should be
>> because not just people but the system itself confuses #match:
>> with #match:.
>>
>> The *real* API bloat in PositionableStream is that it covers
>> both positionable input streams (which can implement #skipToAll:)
>> and positionable output streams (which cannot), so that there
>> are way too many methods in the interface of a WriteStream that
>> cannot possibly work in any state of the receiver.
>>
>> With Trait support in Pharo, it is long past time that ReadStreams
>> (and files opened for input only) did not respondTo: #nextPut: and
>> that WriteStreams (and files opened for output only) did not
>> respondTo: #next.
>>
>> THAT bloat dwarfs a compatibility method.
>>
>>
>> On Mon, 3 Jun 2019 at 03:04, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>> Why add an alias ? The API is too wide as it is already.
>>
>> Note that most current implementations of #upToAll: already use words like match, so #match: is not that crazy.
>>
>> Yes it should be possible to talk about naming, but just adding aliases, no.
>>
>> My opinion, of course.
>>
>>> On 2 Jun 2019, at 04:33, Richard O'Keefe <raoknz(a)gmail.com> wrote:
>>>
>>> skipToAll: aCollection
>>> "Set the receiver's position to just after the next occurrence of aCollection
>>> in the receiver's future values and answer true. If there is no such
>>> occurrence, answer false. In either case, left the postion where #upToAll:
>>> would have left it."
>>> ^self match: aCollection
>>>
>>> Sorry about the incomplete message.
>>> #match: is such a bad name for this operation that the method comment has to
>>> go to some trouble to explain that it is nothing like #match: for Strings.
>>>
>>>
>>> On Sun, 2 Jun 2019 at 14:29, Richard O'Keefe <raoknz(a)gmail.com> wrote:
>>> To get #skipToAll: in Pharo, add this to PositionableStream.
>>>
>>> skipToAll: aCollection
>>> "Set the receiver's to just after the next occcurrence of aCollection
>>> in the receiver's future values and answer true. If there is no such
>>>
>>>
>>> On Sun, 2 Jun 2019 at 07:50, Tim Mackinnon <tim(a)testit.works> wrote:
>>> Interesting - there is no #skipToAll: in pharo, I wonder why not? It sounds like what I was looking for - and Iâm surprised its not there. There is #skipTo: for an object (which sounds right, just not the string equivalent).
>>>
>>> Iâm not doing anything special, just want to take some lines from the end of a class comment and use them in an exercism exercise - but its not different than many applications - find some tag and use the text after it. Iâm kind of surprised its not in Pharo.
>>>
>>> Tim
>>>
>>>
>>>> On 1 Jun 2019, at 12:25, Richard O'Keefe <raoknz(a)gmail.com> wrote:
>>>>
>>>> If you want to move around in strings, you might want to use a ReadStream.
>>>> In some Smalltalk systems there is a method called #skipToAll:.
>>>> Here's how mine starts out:
>>>>
>>>> skipToAll: aSequence
>>>> "If the remaining elements can be parsed as <a><aSequence><b>,
>>>> return true leaving the position where? Otherwise return false.
>>>> GNU Smalltalk, Dolphin, and VisualAge:
>>>> leave the position after <aSequence>, consistent with #upToAll:,
>>>> and implementable in this class. (GST uses the KMP algorithm.)
>>>> VisualWorks and ST/X:
>>>> leave the position before <aSequence>, inconsistent with #upToAll:,
>>>> and only implementable for positionable streams.
>>>> Squeak 5.2 and Pharo 6.0:
>>>> not provided.
>>>> I cannot be compatible with everything. The semantics of
>>>> #skipToAll: should obviously match #upToAll:, so I'll fit
>>>> in with GNU, Dolphin, and VisualAge Smalltalk.
>>>> "
>>>>
>>>> So
>>>> (myReadStream skipToAll: 'marker')
>>>> ifTrue: [loc := myReadStream position]
>>>> ifFalse: [alternative code].
>>>>
>>>> HOWEVER, I have a bad feeling about this. The entire approach, as with much
>>>> concerning strings in a Unicode age, seems fraught with peril. Consider
>>>> input = 'the need for vigilance is never-ending'
>>>> marker = 'end'
>>>> Should the marker be found or not?
>>>> input = '.... Si<floating acute accent> ...'
>>>> marker = 'Si'
>>>> Should the marker be found or not?
>>>> My code is NOT sensitive to these issues.
>>>> I would like to say that it was because I was writing a compatibility
>>>> method, so my code was compatibly broken,
>>>> but to be honest, I was stupid and forgot to think it through.
>>>> I would think that there would need to be an '... asTokens: aBoolean'
>>>> variant that checks that a match
>>>> - is not followed by floating diacriticals
>>>> - is not preceded by an alphanumeric if the target begins with one
>>>> - is not followed by an alphanumeric if the target ends with one.
>>>>
>>>> My own preference is to write a lexical analyser for the mini-language
>>>> I'm using, and NOT try to hack at it using general-purpose string
>>>> methods.
>>>>
>>>> Perhaps you can tell us more about the context? What is the application-
>>>> level task you are trying to solve?
>>>>
>>>>
>>>>
>>>> On Sat, 1 Jun 2019 at 22:01, Tim Mackinnon <tim(a)testit.works> wrote:
>>>> Maybe this is a dumb question - and often Iâm surprised when asking these, but why is there no way to âfind afterâ a string.
>>>>
>>>> I find it rather boring to try and parse a string, after a known marker - thus:
>>>> (loc := aString findString: âmarkerâ) > 0 ifTrue: [ loc := loc + âmarkerâ size ].
>>>>
>>>> Is there a better way? This whole pattern seems very old and clunky and not smalltalk like?
>>>>
>>>> Couldnât we have: findAfter: aString ifAbsent: aBlock ?
>>>>
>>>> Or is there a whole better pattern for string searching that Iâm missing ?
>>>>
>>>> Tim
>>>
>>
>>
>
>
June 3, 2019
Re: [Pharo-users] Find after in strings?
by Sven Van Caekenberghe
To each his own opinion, #match: is not that bad a name, IMHO.
There is much more bloat than the mixing of reading and writing.
The concept of being positionable is bad too: it makes no sense for network and other non-collection backed streams.
There is also all the binary, encoding and converting API that assumes a specific type of element, an assumption that is not always correct.
Yes, Traits could help, but all this is a lot of work.
And I feel like this is a lost battle: everybody keeps on asking to put his/her favourite methods back.
> On 3 Jun 2019, at 00:20, Richard O'Keefe <raoknz(a)gmail.com> wrote:
>
> The issue is that #skipToAll: is the de facto standard name for the
> operation EXCEPT in Squeak and Pharo. It's not that an alias should
> be added. What should *really* be done is that #match: should be
> *renamed* to #skipToAll:. This will
> - improve compatibility
> - reduce confusion
> - improve navigability
>
> At the moment, for example, it is much harder to discover the
> consequences of renaming the #match: method than it should be
> because not just people but the system itself confuses #match:
> with #match:.
>
> The *real* API bloat in PositionableStream is that it covers
> both positionable input streams (which can implement #skipToAll:)
> and positionable output streams (which cannot), so that there
> are way too many methods in the interface of a WriteStream that
> cannot possibly work in any state of the receiver.
>
> With Trait support in Pharo, it is long past time that ReadStreams
> (and files opened for input only) did not respondTo: #nextPut: and
> that WriteStreams (and files opened for output only) did not
> respondTo: #next.
>
> THAT bloat dwarfs a compatibility method.
>
>
> On Mon, 3 Jun 2019 at 03:04, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
> Why add an alias ? The API is too wide as it is already.
>
> Note that most current implementations of #upToAll: already use words like match, so #match: is not that crazy.
>
> Yes it should be possible to talk about naming, but just adding aliases, no.
>
> My opinion, of course.
>
> > On 2 Jun 2019, at 04:33, Richard O'Keefe <raoknz(a)gmail.com> wrote:
> >
> > skipToAll: aCollection
> > "Set the receiver's position to just after the next occurrence of aCollection
> > in the receiver's future values and answer true. If there is no such
> > occurrence, answer false. In either case, left the postion where #upToAll:
> > would have left it."
> > ^self match: aCollection
> >
> > Sorry about the incomplete message.
> > #match: is such a bad name for this operation that the method comment has to
> > go to some trouble to explain that it is nothing like #match: for Strings.
> >
> >
> > On Sun, 2 Jun 2019 at 14:29, Richard O'Keefe <raoknz(a)gmail.com> wrote:
> > To get #skipToAll: in Pharo, add this to PositionableStream.
> >
> > skipToAll: aCollection
> > "Set the receiver's to just after the next occcurrence of aCollection
> > in the receiver's future values and answer true. If there is no such
> >
> >
> > On Sun, 2 Jun 2019 at 07:50, Tim Mackinnon <tim(a)testit.works> wrote:
> > Interesting - there is no #skipToAll: in pharo, I wonder why not? It sounds like what I was looking for - and Iâm surprised its not there. There is #skipTo: for an object (which sounds right, just not the string equivalent).
> >
> > Iâm not doing anything special, just want to take some lines from the end of a class comment and use them in an exercism exercise - but its not different than many applications - find some tag and use the text after it. Iâm kind of surprised its not in Pharo.
> >
> > Tim
> >
> >
> >> On 1 Jun 2019, at 12:25, Richard O'Keefe <raoknz(a)gmail.com> wrote:
> >>
> >> If you want to move around in strings, you might want to use a ReadStream.
> >> In some Smalltalk systems there is a method called #skipToAll:.
> >> Here's how mine starts out:
> >>
> >> skipToAll: aSequence
> >> "If the remaining elements can be parsed as <a><aSequence><b>,
> >> return true leaving the position where? Otherwise return false.
> >> GNU Smalltalk, Dolphin, and VisualAge:
> >> leave the position after <aSequence>, consistent with #upToAll:,
> >> and implementable in this class. (GST uses the KMP algorithm.)
> >> VisualWorks and ST/X:
> >> leave the position before <aSequence>, inconsistent with #upToAll:,
> >> and only implementable for positionable streams.
> >> Squeak 5.2 and Pharo 6.0:
> >> not provided.
> >> I cannot be compatible with everything. The semantics of
> >> #skipToAll: should obviously match #upToAll:, so I'll fit
> >> in with GNU, Dolphin, and VisualAge Smalltalk.
> >> "
> >>
> >> So
> >> (myReadStream skipToAll: 'marker')
> >> ifTrue: [loc := myReadStream position]
> >> ifFalse: [alternative code].
> >>
> >> HOWEVER, I have a bad feeling about this. The entire approach, as with much
> >> concerning strings in a Unicode age, seems fraught with peril. Consider
> >> input = 'the need for vigilance is never-ending'
> >> marker = 'end'
> >> Should the marker be found or not?
> >> input = '.... Si<floating acute accent> ...'
> >> marker = 'Si'
> >> Should the marker be found or not?
> >> My code is NOT sensitive to these issues.
> >> I would like to say that it was because I was writing a compatibility
> >> method, so my code was compatibly broken,
> >> but to be honest, I was stupid and forgot to think it through.
> >> I would think that there would need to be an '... asTokens: aBoolean'
> >> variant that checks that a match
> >> - is not followed by floating diacriticals
> >> - is not preceded by an alphanumeric if the target begins with one
> >> - is not followed by an alphanumeric if the target ends with one.
> >>
> >> My own preference is to write a lexical analyser for the mini-language
> >> I'm using, and NOT try to hack at it using general-purpose string
> >> methods.
> >>
> >> Perhaps you can tell us more about the context? What is the application-
> >> level task you are trying to solve?
> >>
> >>
> >>
> >> On Sat, 1 Jun 2019 at 22:01, Tim Mackinnon <tim(a)testit.works> wrote:
> >> Maybe this is a dumb question - and often Iâm surprised when asking these, but why is there no way to âfind afterâ a string.
> >>
> >> I find it rather boring to try and parse a string, after a known marker - thus:
> >> (loc := aString findString: âmarkerâ) > 0 ifTrue: [ loc := loc + âmarkerâ size ].
> >>
> >> Is there a better way? This whole pattern seems very old and clunky and not smalltalk like?
> >>
> >> Couldnât we have: findAfter: aString ifAbsent: aBlock ?
> >>
> >> Or is there a whole better pattern for string searching that Iâm missing ?
> >>
> >> Tim
> >
>
>
June 3, 2019
Re: [Pharo-users] ODBCDriver
by Julián Maestri
As far as I know, he just started porting it to Pharo 7.
On Sun, Jun 2, 2019, 13:51 Tomaž Turk <tomaz.turk(a)ef.uni-lj.si> wrote:
> I just found this marvel: https://github.com/apiorno/ODBCDriver.
>
> But when I try to
>
> | con |
> con := ODBCConnection dsn:'myDSN' user:'usr' password:'pwd'.
>
> it responds with an error "Instance of ODBCLibrary class did not
> understand #sqlAllocEnv":
>
>
> running on Win 10 and Pharo 7.0.3. I'd appreciate any help.
>
> Best wishes,
> Tomaz
>
>
>
June 3, 2019
OSProcess and CommandShell available on GitHub for Pharo users
by David T. Lewis
Alistair Grant and I, with the support of Feenk, have made GitHub repositories
for OSProcess and CommandShell at:
https://github.com/dtlewis290/OSProcess-Tonel
https://github.com/dtlewis290/CommandShell-Tonel
Alistair did the conversions using Peter Uhn??k's migration tool, and I set up
the repositories so that they can now be loading in Pharo as follows:
Metacello new
repository: 'github://dtlewis290/OSProcess-Tonel/src';
baseline: 'OSProcess';
load.
Metacello new
repository: 'github://dtlewis290/CommandShell-Tonel/src';
baseline: 'CommandShell';
load.
Note, the two respositories are named *-Tonel because I also maintain a GitHub
repository for OSProcess on Cuis, and will probably do repositories in Squot
format in the future.
@Thierry Goubier - If you have an account on GitHub I will add you as a
collaborator (but my own development work remains on squeaksource so I prefer
contributions there anyway).
Enjoy,
Dave and Alistair
June 3, 2019
Re: [Pharo-users] Find after in strings?
by Richard O'Keefe
The issue is that #skipToAll: is the de facto standard name for the
operation EXCEPT in Squeak and Pharo. It's not that an alias should
be added. What should *really* be done is that #match: should be
*renamed* to #skipToAll:. This will
- improve compatibility
- reduce confusion
- improve navigability
At the moment, for example, it is much harder to discover the
consequences of renaming the #match: method than it should be
because not just people but the system itself confuses #match:
with #match:.
The *real* API bloat in PositionableStream is that it covers
both positionable input streams (which can implement #skipToAll:)
and positionable output streams (which cannot), so that there
are way too many methods in the interface of a WriteStream that
cannot possibly work in any state of the receiver.
With Trait support in Pharo, it is long past time that ReadStreams
(and files opened for input only) did not respondTo: #nextPut: and
that WriteStreams (and files opened for output only) did not
respondTo: #next.
THAT bloat dwarfs a compatibility method.
On Mon, 3 Jun 2019 at 03:04, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
> Why add an alias ? The API is too wide as it is already.
>
> Note that most current implementations of #upToAll: already use words like
> match, so #match: is not that crazy.
>
> Yes it should be possible to talk about naming, but just adding aliases,
> no.
>
> My opinion, of course.
>
> > On 2 Jun 2019, at 04:33, Richard O'Keefe <raoknz(a)gmail.com> wrote:
> >
> > skipToAll: aCollection
> > "Set the receiver's position to just after the next occurrence of
> aCollection
> > in the receiver's future values and answer true. If there is no such
> > occurrence, answer false. In either case, left the postion where
> #upToAll:
> > would have left it."
> > ^self match: aCollection
> >
> > Sorry about the incomplete message.
> > #match: is such a bad name for this operation that the method comment
> has to
> > go to some trouble to explain that it is nothing like #match: for
> Strings.
> >
> >
> > On Sun, 2 Jun 2019 at 14:29, Richard O'Keefe <raoknz(a)gmail.com> wrote:
> > To get #skipToAll: in Pharo, add this to PositionableStream.
> >
> > skipToAll: aCollection
> > "Set the receiver's to just after the next occcurrence of aCollection
> > in the receiver's future values and answer true. If there is no such
> >
> >
> > On Sun, 2 Jun 2019 at 07:50, Tim Mackinnon <tim(a)testit.works> wrote:
> > Interesting - there is no #skipToAll: in pharo, I wonder why not? It
> sounds like what I was looking for - and Iâm surprised its not there. There
> is #skipTo: for an object (which sounds right, just not the string
> equivalent).
> >
> > Iâm not doing anything special, just want to take some lines from the
> end of a class comment and use them in an exercism exercise - but its not
> different than many applications - find some tag and use the text after it.
> Iâm kind of surprised its not in Pharo.
> >
> > Tim
> >
> >
> >> On 1 Jun 2019, at 12:25, Richard O'Keefe <raoknz(a)gmail.com> wrote:
> >>
> >> If you want to move around in strings, you might want to use a
> ReadStream.
> >> In some Smalltalk systems there is a method called #skipToAll:.
> >> Here's how mine starts out:
> >>
> >> skipToAll: aSequence
> >> "If the remaining elements can be parsed as <a><aSequence><b>,
> >> return true leaving the position where? Otherwise return
> false.
> >> GNU Smalltalk, Dolphin, and VisualAge:
> >> leave the position after <aSequence>, consistent with
> #upToAll:,
> >> and implementable in this class. (GST uses the KMP algorithm.)
> >> VisualWorks and ST/X:
> >> leave the position before <aSequence>, inconsistent with
> #upToAll:,
> >> and only implementable for positionable streams.
> >> Squeak 5.2 and Pharo 6.0:
> >> not provided.
> >> I cannot be compatible with everything. The semantics of
> >> #skipToAll: should obviously match #upToAll:, so I'll fit
> >> in with GNU, Dolphin, and VisualAge Smalltalk.
> >> "
> >>
> >> So
> >> (myReadStream skipToAll: 'marker')
> >> ifTrue: [loc := myReadStream position]
> >> ifFalse: [alternative code].
> >>
> >> HOWEVER, I have a bad feeling about this. The entire approach, as with
> much
> >> concerning strings in a Unicode age, seems fraught with peril. Consider
> >> input = 'the need for vigilance is never-ending'
> >> marker = 'end'
> >> Should the marker be found or not?
> >> input = '.... Si<floating acute accent> ...'
> >> marker = 'Si'
> >> Should the marker be found or not?
> >> My code is NOT sensitive to these issues.
> >> I would like to say that it was because I was writing a compatibility
> >> method, so my code was compatibly broken,
> >> but to be honest, I was stupid and forgot to think it through.
> >> I would think that there would need to be an '... asTokens: aBoolean'
> >> variant that checks that a match
> >> - is not followed by floating diacriticals
> >> - is not preceded by an alphanumeric if the target begins with one
> >> - is not followed by an alphanumeric if the target ends with one.
> >>
> >> My own preference is to write a lexical analyser for the mini-language
> >> I'm using, and NOT try to hack at it using general-purpose string
> >> methods.
> >>
> >> Perhaps you can tell us more about the context? What is the
> application-
> >> level task you are trying to solve?
> >>
> >>
> >>
> >> On Sat, 1 Jun 2019 at 22:01, Tim Mackinnon <tim(a)testit.works> wrote:
> >> Maybe this is a dumb question - and often Iâm surprised when asking
> these, but why is there no way to âfind afterâ a string.
> >>
> >> I find it rather boring to try and parse a string, after a known marker
> - thus:
> >> (loc := aString findString: âmarkerâ) > 0 ifTrue: [ loc := loc +
> âmarkerâ size ].
> >>
> >> Is there a better way? This whole pattern seems very old and clunky and
> not smalltalk like?
> >>
> >> Couldnât we have: findAfter: aString ifAbsent: aBlock ?
> >>
> >> Or is there a whole better pattern for string searching that Iâm
> missing ?
> >>
> >> Tim
> >
>
>
>
June 2, 2019
ODBCDriver
by Tomaž Turk
I just found this marvel: https://github.com/apiorno/ODBCDriver.
But when I try to
| con |
con := ODBCConnection dsn:'myDSN' user:'usr' password:'pwd'.
it responds with an error "Instance of ODBCLibrary class did not
understand #sqlAllocEnv":
running on Win 10 and Pharo 7.0.3. I'd appreciate any help.
Best wishes,
Tomaz
June 2, 2019
Re: [Pharo-users] Find after in strings?
by Sven Van Caekenberghe
Why add an alias ? The API is too wide as it is already.
Note that most current implementations of #upToAll: already use words like match, so #match: is not that crazy.
Yes it should be possible to talk about naming, but just adding aliases, no.
My opinion, of course.
> On 2 Jun 2019, at 04:33, Richard O'Keefe <raoknz(a)gmail.com> wrote:
>
> skipToAll: aCollection
> "Set the receiver's position to just after the next occurrence of aCollection
> in the receiver's future values and answer true. If there is no such
> occurrence, answer false. In either case, left the postion where #upToAll:
> would have left it."
> ^self match: aCollection
>
> Sorry about the incomplete message.
> #match: is such a bad name for this operation that the method comment has to
> go to some trouble to explain that it is nothing like #match: for Strings.
>
>
> On Sun, 2 Jun 2019 at 14:29, Richard O'Keefe <raoknz(a)gmail.com> wrote:
> To get #skipToAll: in Pharo, add this to PositionableStream.
>
> skipToAll: aCollection
> "Set the receiver's to just after the next occcurrence of aCollection
> in the receiver's future values and answer true. If there is no such
>
>
> On Sun, 2 Jun 2019 at 07:50, Tim Mackinnon <tim(a)testit.works> wrote:
> Interesting - there is no #skipToAll: in pharo, I wonder why not? It sounds like what I was looking for - and Iâm surprised its not there. There is #skipTo: for an object (which sounds right, just not the string equivalent).
>
> Iâm not doing anything special, just want to take some lines from the end of a class comment and use them in an exercism exercise - but its not different than many applications - find some tag and use the text after it. Iâm kind of surprised its not in Pharo.
>
> Tim
>
>
>> On 1 Jun 2019, at 12:25, Richard O'Keefe <raoknz(a)gmail.com> wrote:
>>
>> If you want to move around in strings, you might want to use a ReadStream.
>> In some Smalltalk systems there is a method called #skipToAll:.
>> Here's how mine starts out:
>>
>> skipToAll: aSequence
>> "If the remaining elements can be parsed as <a><aSequence><b>,
>> return true leaving the position where? Otherwise return false.
>> GNU Smalltalk, Dolphin, and VisualAge:
>> leave the position after <aSequence>, consistent with #upToAll:,
>> and implementable in this class. (GST uses the KMP algorithm.)
>> VisualWorks and ST/X:
>> leave the position before <aSequence>, inconsistent with #upToAll:,
>> and only implementable for positionable streams.
>> Squeak 5.2 and Pharo 6.0:
>> not provided.
>> I cannot be compatible with everything. The semantics of
>> #skipToAll: should obviously match #upToAll:, so I'll fit
>> in with GNU, Dolphin, and VisualAge Smalltalk.
>> "
>>
>> So
>> (myReadStream skipToAll: 'marker')
>> ifTrue: [loc := myReadStream position]
>> ifFalse: [alternative code].
>>
>> HOWEVER, I have a bad feeling about this. The entire approach, as with much
>> concerning strings in a Unicode age, seems fraught with peril. Consider
>> input = 'the need for vigilance is never-ending'
>> marker = 'end'
>> Should the marker be found or not?
>> input = '.... Si<floating acute accent> ...'
>> marker = 'Si'
>> Should the marker be found or not?
>> My code is NOT sensitive to these issues.
>> I would like to say that it was because I was writing a compatibility
>> method, so my code was compatibly broken,
>> but to be honest, I was stupid and forgot to think it through.
>> I would think that there would need to be an '... asTokens: aBoolean'
>> variant that checks that a match
>> - is not followed by floating diacriticals
>> - is not preceded by an alphanumeric if the target begins with one
>> - is not followed by an alphanumeric if the target ends with one.
>>
>> My own preference is to write a lexical analyser for the mini-language
>> I'm using, and NOT try to hack at it using general-purpose string
>> methods.
>>
>> Perhaps you can tell us more about the context? What is the application-
>> level task you are trying to solve?
>>
>>
>>
>> On Sat, 1 Jun 2019 at 22:01, Tim Mackinnon <tim(a)testit.works> wrote:
>> Maybe this is a dumb question - and often Iâm surprised when asking these, but why is there no way to âfind afterâ a string.
>>
>> I find it rather boring to try and parse a string, after a known marker - thus:
>> (loc := aString findString: âmarkerâ) > 0 ifTrue: [ loc := loc + âmarkerâ size ].
>>
>> Is there a better way? This whole pattern seems very old and clunky and not smalltalk like?
>>
>> Couldnât we have: findAfter: aString ifAbsent: aBlock ?
>>
>> Or is there a whole better pattern for string searching that Iâm missing ?
>>
>> Tim
>
June 2, 2019
Re: [Pharo-users] More Morphic snags
by Ben Coman
On Sun, 2 Jun 2019 at 00:18, Markus Stumptner <mst(a)cs.unisa.edu.au> wrote:
>
> I have been trying to replicate the behaviour of an existing (non-Pharo,
> non-Smalltalk) application with Morphic. This provides grouping images
> in a workspace, and then switching between laying them out separately or
> "stacked" by double clicking on the group (or an image in it). When the
> group is stacked, it can be moved around as a single drag and drop
> operation. When the group is separated, dragging an image out of it
> removes it from the group.
>
> On the surface this looked like a perfect fit to the submorph tree.
> Unfortunately, as both the Morphic chapter in Pharo by Example and the
> intro document by Maloney make clear, if you enable double clicking (by
> answering true to #handlesMouseDown:), you are interfering with what
> Maloney calls the "default behaviour" of being able to drag a Morph around.
>
> How do I reinstate that behaviour if a group is clicked on and the
> double click does not happen? Neither document helps in explaining where
> that "default" can be found in the code.
Have you put a `self haltOnce` in #handlesMouseDown: ?
I am far from an expert here, but the following may help:
Three alternate ways of handling mouse events
https://wiki.squeak.org/squeak/2477
http://squeak.preeminent.org/tut2007/html/078.html
Check the Dragging section here...
https://wiki.squeak.org/squeak/6194
Search for doubleclick here...
https://course.ccs.neu.edu/com3230/squeak/SqueakMorphClassGuide.pdf
a few more #handlesXXX methods...
https://course.ccs.neu.edu/com3230/squeak/SqueakMouseControls.html
cheers -ben
June 2, 2019
Re: [Pharo-users] Find after in strings?
by Richard O'Keefe
skipToAll: aCollection
"Set the receiver's position to just after the next occurrence of
aCollection
in the receiver's future values and answer true. If there is no such
occurrence, answer false. In either case, left the postion where
#upToAll:
would have left it."
^self match: aCollection
Sorry about the incomplete message.
#match: is such a bad name for this operation that the method comment has to
go to some trouble to explain that it is nothing like #match: for Strings.
On Sun, 2 Jun 2019 at 14:29, Richard O'Keefe <raoknz(a)gmail.com> wrote:
> To get #skipToAll: in Pharo, add this to PositionableStream.
>
> skipToAll: aCollection
> "Set the receiver's to just after the next occcurrence of aCollection
> in the receiver's future values and answer true. If there is no such
>
>
> On Sun, 2 Jun 2019 at 07:50, Tim Mackinnon <tim(a)testit.works> wrote:
>
>> Interesting - there is no #skipToAll: in pharo, I wonder why not? It
>> sounds like what I was looking for - and Iâm surprised its not there. There
>> is #skipTo: for an object (which sounds right, just not the string
>> equivalent).
>>
>> Iâm not doing anything special, just want to take some lines from the end
>> of a class comment and use them in an exercism exercise - but its not
>> different than many applications - find some tag and use the text after it.
>> Iâm kind of surprised its not in Pharo.
>>
>> Tim
>>
>>
>> On 1 Jun 2019, at 12:25, Richard O'Keefe <raoknz(a)gmail.com> wrote:
>>
>> If you want to move around in strings, you might want to use a ReadStream.
>> In some Smalltalk systems there is a method called #skipToAll:.
>> Here's how mine starts out:
>>
>> skipToAll: aSequence
>> "If the remaining elements can be parsed as <a><aSequence><b>,
>> return true leaving the position where? Otherwise return false.
>>
>> GNU Smalltalk, Dolphin, and VisualAge:
>> leave the position after <aSequence>, consistent with #upToAll:,
>> and implementable in this class. (GST uses the KMP algorithm.)
>> VisualWorks and ST/X:
>> leave the position before <aSequence>, inconsistent with
>> #upToAll:,
>> and only implementable for positionable streams.
>> Squeak 5.2 and Pharo 6.0:
>> not provided.
>> I cannot be compatible with everything. The semantics of
>> #skipToAll: should obviously match #upToAll:, so I'll fit
>> in with GNU, Dolphin, and VisualAge Smalltalk.
>> "
>>
>> So
>> (myReadStream skipToAll: 'marker')
>> ifTrue: [loc := myReadStream position]
>> ifFalse: [alternative code].
>>
>> HOWEVER, I have a bad feeling about this. The entire approach, as with
>> much
>> concerning strings in a Unicode age, seems fraught with peril. Consider
>> input = 'the need for vigilance is never-ending'
>> marker = 'end'
>> Should the marker be found or not?
>> input = '.... Si<floating acute accent> ...'
>> marker = 'Si'
>> Should the marker be found or not?
>> My code is NOT sensitive to these issues.
>> I would like to say that it was because I was writing a compatibility
>> method, so my code was compatibly broken,
>> but to be honest, I was stupid and forgot to think it through.
>> I would think that there would need to be an '... asTokens: aBoolean'
>> variant that checks that a match
>> - is not followed by floating diacriticals
>> - is not preceded by an alphanumeric if the target begins with one
>> - is not followed by an alphanumeric if the target ends with one.
>>
>> My own preference is to write a lexical analyser for the mini-language
>> I'm using, and NOT try to hack at it using general-purpose string
>> methods.
>>
>> Perhaps you can tell us more about the context? What is the application-
>> level task you are trying to solve?
>>
>>
>>
>> On Sat, 1 Jun 2019 at 22:01, Tim Mackinnon <tim(a)testit.works> wrote:
>>
>>> Maybe this is a dumb question - and often Iâm surprised when asking
>>> these, but why is there no way to âfind afterâ a string.
>>>
>>> I find it rather boring to try and parse a string, after a known marker
>>> - thus:
>>> (loc := aString findString: âmarkerâ) > 0 ifTrue: [ loc := loc +
>>> âmarkerâ size ].
>>>
>>> Is there a better way? This whole pattern seems very old and clunky and
>>> not smalltalk like?
>>>
>>> Couldnât we have: findAfter: aString ifAbsent: aBlock ?
>>>
>>> Or is there a whole better pattern for string searching that Iâm missing
>>> ?
>>>
>>> Tim
>>>
>>
>>
June 2, 2019