I expected #withPathSegments: to return a copy with path segments replaced by the argument, but in fact they were added to the existing path. Just me? ----- Cheers, Sean -- View this message in context: http://forum.world.st/ZnUrl-withPathSegments-Surprise-tp4836593.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
I don't know. If you see where it is used, you'll see it makes sense to add: 'http://host.com:80' asZnUrl / 'files' / 'readme.txt' Where #/ is equivalent to #withPathSegments. I do remember adding this especially for you ;-)
On 08 Jul 2015, at 18:30, Sean P. DeNigris <sean@clipperadams.com> wrote:
I expected #withPathSegments: to return a copy with path segments replaced by the argument, but in fact they were added to the existing path. Just me?
----- Cheers, Sean -- View this message in context: http://forum.world.st/ZnUrl-withPathSegments-Surprise-tp4836593.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Sven Van Caekenberghe-2 wrote
I do remember adding this especially for you ;-)
Ha ha, yes I remember... the #/ is certainly useful. My question is just about the name #withPathSegments:. Maybe something like #withAddedPathSegments: might be clearer? Also, there is the #copyXyz convention used elsewhere in Pharo. Maybe #copyAddingPathSegments: for uniformity? ----- Cheers, Sean -- View this message in context: http://forum.world.st/ZnUrl-withPathSegments-Surprise-tp4836593p4836596.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
On 08 Jul 2015, at 19:13, Sean P. DeNigris <sean@clipperadams.com> wrote:
Sven Van Caekenberghe-2 wrote
I do remember adding this especially for you ;-)
Ha ha, yes I remember... the #/ is certainly useful. My question is just about the name #withPathSegments:. Maybe something like #withAddedPathSegments: might be clearer? Also, there is the #copyXyz convention used elsewhere in Pharo. Maybe#copyAddingPathSegments: for uniformity?
Maybe, but where do you find proof for the #withX: meaning 'replace X in a copy of the receiver ' ? I mean, it does not strike me as confusing. Of course, the longer #copyAddingPathSegments: is long and clear.
----- Cheers, Sean -- View this message in context: http://forum.world.st/ZnUrl-withPathSegments-Surprise-tp4836593p4836596.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Sven Van Caekenberghe-2 wrote
where do you find proof for the #withX: meaning 'replace X in a copy of the receiver ' ?
I guess from the collection #with:... messages that start from a fresh copy, but also quickly browsing the image, I see other such uses e.g. #withAngle:, #withNewSelection:, all of which return a new instance with the argument passing through to it independent of the original value. ----- Cheers, Sean -- View this message in context: http://forum.world.st/ZnUrl-withPathSegments-Surprise-tp4836593p4836616.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
participants (2)
-
Sean P. DeNigris -
Sven Van Caekenberghe