Hi folks! I am trying to make Glorp work on Pharo but I am having problems with '_' in selectors.
The standard of tables with databases involve _ when having more than a word. Example TB_BANK_ACCOUNT. Glorp needs a method like this: tableForTB_BANK_ACCOUNT In pharo 250 it works, but in latests Pharo releases this doesn't work. I know Stef said it could be for 1.1 but I need to ask: is there a workaround a hack or a quick fix so that I can progress with the port of GLORP ? can this have to be with new compiler ? Thanks Mariano _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Helloa all,
I'd really like to second Mariano's request for a work-around, and I might even be
able to post one shortly. I did not write it, but it tweaks (at least the
old) scanner to accept underscores in any but the first position of a
selector. That might meet Mariano's need, and would cover most of
mine related to RDBs as well. For external interfacing, it would further
be important to be able to use them in class names, but nobody gave me a
workaround for that :)
One thing that I wonder about is whether Shout will adapt
with the change??? I will look for it and apply shortly and just see what
happens. If it works, I'll spread it around. I should have tried it
in Pharo a long time ago. I'll try to report back in an hour or
two.
Bill
From: [hidden email] [mailto:[hidden email]] On Behalf Of Mariano Martinez Peck Sent: Monday, May 18, 2009 7:58 AM To: Pharo Development Subject: [Pharo-project] Underscores in selectors The standard of tables with databases involve _ when having more than a word. Example TB_BANK_ACCOUNT. Glorp needs a method like this: tableForTB_BANK_ACCOUNT In pharo 250 it works, but in latests Pharo releases this doesn't work. I know Stef said it could be for 1.1 but I need to ask: is there a workaround a hack or a quick fix so that I can progress with the port of GLORP ? can this have to be with new compiler ? Thanks Mariano _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Hello all,
Here is the code, but both Shout and later (on accept) OB do not like underscores. No real surprise. Hopefully this will spark a nice workaround, because I sure could use it. Bill 'From Squeak3.2 of 15 January 2002 [latest update: #4881] on 17 October 2002 at 2:30:42 pm'! "Change Set: underscoreMadness Date: 17 October 2002 Author: Ian Piumarta Makes the Scanner accept underscores in words or keywords (but not in the first position since that would require context sensitivity). Use of this changeset has been officially condemned by the Independent Board of Syntactical Aesthetics for Squeak."! !Scanner methodsFor: 'multi-character scans' stamp: 'ikp 10/17/2002 14:24'! xLetter "Form a word or keyword." | type | buffer reset. [(type _ typeTable at: hereChar asciiValue) == #xLetter or: [type == #xDigit or: [type == #leftArrow]]] whileTrue: ["open code step for speed" buffer nextPut: hereChar. hereChar _ aheadChar. source atEnd ifTrue: [aheadChar _ 30 asCharacter "doit"] ifFalse: [aheadChar _ source next]]. (type == #colon or: [type == #xColon and: [aheadChar ~= $=]]) ifTrue: [buffer nextPut: self step. ["Allow any number of embedded colons in literal symbols" (typeTable at: hereChar asciiValue) == #xColon] whileTrue: [buffer nextPut: self step]. tokenType _ #keyword] ifFalse: [tokenType _ #word]. token _ buffer contents! ! ---- Wilhelm K. Schwab, Ph.D. bschwab AT anest DOT ufl DOT edu ________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Schwab,Wilhelm K [[hidden email]] Sent: Monday, May 18, 2009 9:06 AM To: [hidden email] Subject: Re: [Pharo-project] Underscores in selectors Helloa all, I'd really like to second Mariano's request for a work-around, and I might even be able to post one shortly. I did not write it, but it tweaks (at least the old) scanner to accept underscores in any but the first position of a selector. That might meet Mariano's need, and would cover most of mine related to RDBs as well. For external interfacing, it would further be important to be able to use them in class names, but nobody gave me a workaround for that :) One thing that I wonder about is whether Shout will adapt with the change??? I will look for it and apply shortly and just see what happens. If it works, I'll spread it around. I should have tried it in Pharo a long time ago. I'll try to report back in an hour or two. Bill ________________________________ From: [hidden email] [mailto:[hidden email]] On Behalf Of Mariano Martinez Peck Sent: Monday, May 18, 2009 7:58 AM To: Pharo Development Subject: [Pharo-project] Underscores in selectors Hi folks! I am trying to make Glorp work on Pharo but I am having problems with '_' in selectors. The standard of tables with databases involve _ when having more than a word. Example TB_BANK_ACCOUNT. Glorp needs a method like this: tableForTB_BANK_ACCOUNT In pharo 250 it works, but in latests Pharo releases this doesn't work. I know Stef said it could be for 1.1 but I need to ask: is there a workaround a hack or a quick fix so that I can progress with the port of GLORP ? can this have to be with new compiler ? Thanks Mariano _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Schwab,Wilhelm K
Mariano, are you sure underscores worked in previous versions of Pharo?
Adrian On May 18, 2009, at 15:06 , Schwab,Wilhelm K wrote: > Helloa all, > > I'd really like to second Mariano's request for a work-around, and I > might even be able to post one shortly. I did not write it, but it > tweaks (at least the old) scanner to accept underscores in any but > the first position of a selector. That might meet Mariano's need, > and would cover most of mine related to RDBs as well. For external > interfacing, it would further be important to be able to use them in > class names, but nobody gave me a workaround for that :) > > One thing that I wonder about is whether Shout will adapt with the > change??? I will look for it and apply shortly and just see what > happens. If it works, I'll spread it around. I should have tried > it in Pharo a long time ago. I'll try to report back in an hour or > two. > > Bill > > > > ________________________________ > From: [hidden email] [mailto:[hidden email] > ] On Behalf Of Mariano Martinez Peck > Sent: Monday, May 18, 2009 7:58 AM > To: Pharo Development > Subject: [Pharo-project] Underscores in selectors > > Hi folks! I am trying to make Glorp work on Pharo but I am having > problems with '_' in selectors. > > The standard of tables with databases involve _ when having more > than a word. Example TB_BANK_ACCOUNT. > > Glorp needs a method like this: tableForTB_BANK_ACCOUNT > > In pharo 250 it works, but in latests Pharo releases this doesn't > work. I know Stef said it could be for 1.1 but I need to ask: is > there a workaround a hack or a quick fix so that I can progress with > the port of GLORP ? can this have to be with new compiler ? > > Thanks > > Mariano > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
mmmm I think I am a bit dizzy with the versions. I just download 10250 again (the one I thought worked) but, as you ask, it isn't working. Sorry for the noise. So, this never worked on pharo? In squeak it works, so I guess it's a pharo change in somewhere. That's why I though in new compiler that Pharo has but squeak doesn't.
Thanks! Mariano On Mon, May 18, 2009 at 1:13 PM, Adrian Lienhard <[hidden email]> wrote: Mariano, are you sure underscores worked in previous versions of Pharo? _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
I do not think it ever worked in Pharo. However,
we might be able to corrupt the workaround I posted into changes to Pharo's
scanner and Shout (if needed) to get it to work.
Bill
From: [hidden email] [mailto:[hidden email]] On Behalf Of Mariano Martinez Peck Sent: Monday, May 18, 2009 9:19 AM To: [hidden email] Subject: Re: [Pharo-project] Underscores in selectors Thanks! Mariano On Mon, May 18, 2009 at 1:13 PM, Adrian Lienhard <[hidden email]> wrote: Mariano, are you sure underscores worked in previous versions of Pharo? _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Thanks Bill!!!
I just have tested and seems to work ok. Tonight I will test it with Glorp. However, I wonder if this could break a lot of things. I am scared hahah. Cheers, Mariano
2009/5/18 Schwab,Wilhelm K <[hidden email]>
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Mariano,
Are you saying that the workaround I posted works for you
in Pharo? I had problems, but will try again if you got along ok.
Does Shout display things correctly? Which browser/toolset are you
using?
Bill
--- From: [hidden email] [mailto:[hidden email]] On Behalf Of Mariano Martinez Peck Sent: Monday, May 18, 2009 10:03 AM To: [hidden email] Subject: Re: [Pharo-project] Underscores in selectors I just have tested and seems to work ok. Tonight I will test it with Glorp. However, I wonder if this could break a lot of things. I am scared hahah. Cheers, Mariano 2009/5/18 Schwab,Wilhelm K <[hidden email]>
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/5/18 Schwab,Wilhelm K <[hidden email]>
Yes. It seems to work ok. I am using a shout workspace and OB Package Browser. I don't know what toolset are.
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Mariano,
Toolset might not be the correct word - I was wondering
whether you did anything special to change browsers.
Bill
From: [hidden email] [mailto:[hidden email]] On Behalf Of Mariano Martinez Peck Sent: Monday, May 18, 2009 10:13 AM To: [hidden email] Subject: Re: [Pharo-project] Underscores in selectors 2009/5/18 Schwab,Wilhelm K <[hidden email]>
Yes. It seems to work ok. I am using a shout workspace and OB Package Browser. I don't know what toolset are.
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/5/18 Schwab,Wilhelm K <[hidden email]>
No. I didn't change anything. I just open a new pharo image and run the changeset.
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Ok, I jus tried it again, and Shout is definitely unhappy,
but it seems to work otherswise. The walkback I saw appears to be thrown
by OB on any right click in the code pane, not just with the workaround applied
(DNU OBTextSelection>>isClassNode)..
Bill
From: [hidden email] [mailto:[hidden email]] On Behalf Of Mariano Martinez Peck Sent: Monday, May 18, 2009 10:27 AM To: [hidden email] Subject: Re: [Pharo-project] Underscores in selectors 2009/5/18 Schwab,Wilhelm K <[hidden email]>
No. I didn't change anything. I just open a new pharo image and run the changeset.
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/5/18 Schwab,Wilhelm K <[hidden email]>
Yes, but this is not due to your code. This is another bug and it is already reported. See mailing list
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Mariano,
Got it. Of course, it is not my
code: I simply take credit for pointing out how, um, unfortunte, it was for
Squeak to have such a limitation, and managed to hang onto theworkaround after
Ian was kind enough to write it. It's great that it works well enough to
use! Ugly red source aside, it will be a huge help in my upcoming RDB
work.
Thanks,
Bill
From: [hidden email] [mailto:[hidden email]] On Behalf Of Mariano Martinez Peck Sent: Monday, May 18, 2009 11:07 AM To: [hidden email] Subject: Re: [Pharo-project] Underscores in selectors 2009/5/18 Schwab,Wilhelm K <[hidden email]>
Yes, but this is not due to your code. This is another bug and it is already reported. See mailing list
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/5/18 Schwab,Wilhelm K <[hidden email]>
Yes. Thanks a lot for this. Tonight I will test it with Glorp. However, I created a ticket for this so that it can be sotored somewhere. It must be tested deeper and must in Pharo core. The ticket is: http://code.google.com/p/pharo/issues/detail?id=826 Thanks again. Mariano
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Mariano,
Thank you for nudging me, not giving up as easily as I did,
and for creating the ticket. If it is in fact stable, it would
make a nice addition to the core until we can get full support for
underscores.
Thanks!
Bill
From: [hidden email] [mailto:[hidden email]] On Behalf Of Mariano Martinez Peck Sent: Monday, May 18, 2009 1:23 PM To: [hidden email] Subject: Re: [Pharo-project] Underscores in selectors 2009/5/18 Schwab,Wilhelm K <[hidden email]>
Yes. Thanks a lot for this. Tonight I will test it with Glorp. However, I created a ticket for this so that it can be sotored somewhere. It must be tested deeper and must in Pharo core. The ticket is: http://code.google.com/p/pharo/issues/detail?id=826 Thanks again. Mariano
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/5/18 Schwab,Wilhelm K <[hidden email]>
You are welcome!
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |