[Pharo-project] Url comparison
Hi, I'd like to compare url's but it doesn't seem to work (as I expect - Pharo 1.1) ex: 'http://www.pharo-project.org' asUrl = 'http://www.pharo-project.org' asUrl. => false What about having: Url>> = anotherUrl ^self asText = anotherUrl asText Do we need to redefine hash too ? TIA Cédrick
What about www.cnn.com asUrl = ( 'cnn.com' asUrl )? I'm not sure what the right answer to that is - sorry. ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Cédrick Béler [cdrick65@gmail.com] Sent: Friday, December 10, 2010 10:41 AM To: Pharo-project@lists.gforge.inria.fr Subject: [Pharo-project] Url comparison Hi, I'd like to compare url's but it doesn't seem to work (as I expect - Pharo 1.1) ex: 'http://www.pharo-project.org' asUrl = 'http://www.pharo-project.org' asUrl. => false What about having: Url>> = anotherUrl ^self asText = anotherUrl asText Do we need to redefine hash too ? TIA Cédrick
What about
'www.cnn.com' asUrl = ( 'cnn.com' asUrl )?
I'm not sure what the right answer to that is - sorry.
should be false to me...
Hi,
I'd like to compare url's but it doesn't seem to work (as I expect - Pharo 1.1)
ex: 'http://www.pharo-project.org' asUrl = 'http://www.pharo-project.org' asUrl. => false
What about having:
Url>> = anotherUrl
^self asText = anotherUrl asText
Do we need to redefine hash too ?
TIA
Cédrick
Do you think #= is needed for Url ? (ie. do I open an issue ?) if yes, is the following proposition enough ? or should it be more precise according to each subclass ? See you
'http://www.pharo-project.org' asUrl = 'http://www.pharo-project.org' asUrl. => false
What about having:
Url>> = anotherUrl
^self asText = anotherUrl asText
Do we need to redefine hash too ?
TIA
Cédrick
Do you think #= is needed for Url ? (ie. do I open an issue ?)
yes. Now I do not understand why you need to convert to text. printString should be enough.
if yes, is the following proposition enough ? or should it be more precise according to each subclass ?
See you
'http://www.pharo-project.org' asUrl = 'http://www.pharo-project.org' asUrl. => false
What about having:
Url>> = anotherUrl
^self asText = anotherUrl asText
Do we need to redefine hash too ?
TIA
Cédrick
Le 10 déc. 2010 à 18:46, Stéphane Ducasse a écrit :
Do you think #= is needed for Url ? (ie. do I open an issue ?)
yes.
ok, I'll do that
Now I do not understand why you need to convert to text. printString should be enough.
true... :) Do I add Url >> hash self printstring hash
if yes, is the following proposition enough ? or should it be more precise according to each subclass ?
See you
'http://www.pharo-project.org' asUrl = 'http://www.pharo-project.org' asUrl. => false
What about having:
Url>> = anotherUrl
^self asText = anotherUrl asText
Do we need to redefine hash too ?
TIA
Cédrick
Isn't #printString intended for use in debugging? Peter On Fri, 10 Dec 2010 19:00:47 +0100, Cédrick Béler <cdrick65@gmail.com> wrote:
Le 10 déc. 2010 à 18:46, Stéphane Ducasse a écrit :
Do you think #= is needed for Url ? (ie. do I open an issue ?)
yes.
ok, I'll do that
Now I do not understand why you need to convert to text. printString should be enough.
true... :)
Do I add
Url >> hash
self printstring hash
if yes, is the following proposition enough ? or should it be more precise according to each subclass ?
See you
'http://www.pharo-project.org' asUrl = 'http://www.pharo-project.org' asUrl. => false
What about having:
Url>> = anotherUrl
^self asText = anotherUrl asText
Do we need to redefine hash too ?
TIA
Cédrick
Isn't #printString intended for use in debugging?
I used asString actually. cheers
Peter
On Fri, 10 Dec 2010 19:00:47 +0100, Cédrick Béler <cdrick65@gmail.com> wrote:
Le 10 déc. 2010 à 18:46, Stéphane Ducasse a écrit :
Do you think #= is needed for Url ? (ie. do I open an issue ?)
yes.
ok, I'll do that
Now I do not understand why you need to convert to text. printString should be enough.
true... :)
Do I add
Url >> hash
self printstring hash
if yes, is the following proposition enough ? or should it be more precise according to each subclass ?
See you
'http://www.pharo-project.org' asUrl = 'http://www.pharo-project.org' asUrl. => false
What about having:
Url>> = anotherUrl
^self asText = anotherUrl asText
Do we need to redefine hash too ?
TIA
Cédrick
participants (4)
-
Cédrick Béler -
Peter van Rooijen -
Schwab,Wilhelm K -
Stéphane Ducasse