Url comparison

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Url comparison

cedreek
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
Reply | Threaded
Open this post in threaded view
|

Re: Url comparison

Schwab,Wilhelm K
What about

   www.cnn.com asUrl = ( 'cnn.com' asUrl )?

I'm not sure what the right answer to that is - sorry.


________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Cédrick Béler [[hidden email]]
Sent: Friday, December 10, 2010 10:41 AM
To: [hidden email]
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

Reply | Threaded
Open this post in threaded view
|

Re: Url comparison

cedreek


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


Reply | Threaded
Open this post in threaded view
|

Re: Url comparison

cedreek
In reply to this post by Schwab,Wilhelm K
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
>


Reply | Threaded
Open this post in threaded view
|

Re: Url comparison

Stéphane Ducasse
> 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
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Url comparison

cedreek

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


Reply | Threaded
Open this post in threaded view
|

Re: Url comparison

Peter van Rooijen
Isn't #printString intended for use in debugging?

Peter

On Fri, 10 Dec 2010 19:00:47 +0100, Cédrick Béler <[hidden email]>  
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
>>>>
>>>
>>>
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Url comparison

cedreek


> 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 <[hidden email]> 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
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Url comparison

Peter van Rooijen
On Wed, 15 Dec 2010 11:30:34 +0100, Cédrick Béler <[hidden email]>  
wrote:

>
>
>> Isn't #printString intended for use in debugging?
>
> I used asString actually.
>
> cheers

That makes perfect sense!

Cheers, Peter