Re: [Pharo-dev] 19609 FileReference>>base should be before last separator
Thanks Alistair. On Thu, Aug 17, 2017 at 5:50 PM, Alistair Grantwrote: > Hi Stef, > > On Thu, Aug 17, 2017 at 05:08:40PM +0200, Stephane Ducasse wrote: >> I do not know but I imagine that I added basenameWithoutExtension because >> I found the name much much clearer. I would have never guessed that >> base is the basename without the extension. >> >> Stef > > Thanks for the clarification. Although #base isn't the name without the > extension, it is the portion of the name up to the first extension > delimiter (for names with a single extension delimiter the two will of > course be the same, but for names with multiple extension delimiters > they will be different). > > In that case, assuming no one else comes up with additional > information, I would argue that the issue should be closed (rejected), > and Michael should change his code to use #basenameWithoutExtension > instead of #base. > > It would be nice to improve the comments in the code - I'll add it to my > list. :-) > > > Cheers, > Alistair > > >> On Wed, Aug 16, 2017 at 9:46 PM, Alistair Grant >> wrote: >> > Hi All, >> > >> > I've just taken a look at issue 19609 FileReference>>base should be >> > before last separator and wonder whether it is a correct interpretation >> > of the original intentions. >> > >> > The original author of the issue, Michael, seems to feel that >> > FileReferene>>base and FileReference>>basenameWithoutExtension are the >> > same. >> > >> > My reading of the comments is that they perform a different function, >> > i.e.: >> > >> > >> > '/a/b/c.d.e' asFileReference base. "c" >> > '/a/b/c.d.e' asFileReference basenameWithoutExtension. "c.d" >> > >> > >> > are both the expected values, i.e.: >> > >> > - #base answers the name up to the first extensionDelimiter. >> > - #basenameWithoutExtension answers the name without what is typically >> > considered the file extension (the bit after the last >> > extensionDelimiter). >> > >> > Not shown above, but: >> > >> > - #basename answers the entire filename, i.e. "c.d.e". >> > >> > >> > Does anyone know the history of these methods? >> > >> > >> > Cheers, >> > Alistair >> > >> >
Re: [Pharo-dev] 19609 FileReference>>base should be before last separator
Eliot Miranda-2 wrote > While basenameWithoutExtension is an intension revealing selector it is > soon ln :-) For file manipulation code that's a problem. I > wonder if something like bodyName is better because it's shorter. While I too feel a bit of pain from the long selector, I have reservations with #bodyName because I already know I will not remember what that means and will have to constantly look it up. IIRC we already have #base and #basename, which seem to be made up labels for subtle distinctions and I can never remember the difference. I think the domain here is nuanced enough to defy simple labels. I remember when we first integrated FS there was confusion/unworkability around "extension" vs. "extensions" for e.g. /myfile.tar.zip vs. /mypackage.1.mcz - Cheers, Sean -- View this message in context: http://forum.world.st/19609-FileReference-base-should-be-before-last-separator-tp4961729p4962586.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Re: [Pharo-dev] 19609 FileReference>>base should be before last separator
2017-08-17 20:43 GMT+02:00 Eliot Miranda: > Hi Stef, > > On Thu, Aug 17, 2017 at 8:08 AM, Stephane Ducasse > wrote: > >> I do not know but I imagine that I added basenameWithoutExtension because >> I found the name much much clearer. I would have never guessed that >> base is the basename without the extension. >> > > While basenameWithoutExtension is an intension revealing selector it is > soon ln :-) For file manipulation code that's a problem. I > wonder if something like bodyName is better because it's shorter. > > 25 years ago I had `aFilename basename withoutExtension` in my vw app... I don't think that such decomposition is a big efficiency problem for scripting. Nicolas >> Stef >> >> On Wed, Aug 16, 2017 at 9:46 PM, Alistair Grant >> wrote: >> > Hi All, >> > >> > I've just taken a look at issue 19609 FileReference>>base should be >> > before last separator and wonder whether it is a correct interpretation >> > of the original intentions. >> > >> > The original author of the issue, Michael, seems to feel that >> > FileReferene>>base and FileReference>>basenameWithoutExtension are the >> > same. >> > >> > My reading of the comments is that they perform a different function, >> > i.e.: >> > >> > >> > '/a/b/c.d.e' asFileReference base. "c" >> > '/a/b/c.d.e' asFileReference basenameWithoutExtension. "c.d" >> > >> > >> > are both the expected values, i.e.: >> > >> > - #base answers the name up to the first extensionDelimiter. >> > - #basenameWithoutExtension answers the name without what is typically >> > considered the file extension (the bit after the last >> > extensionDelimiter). >> > >> > Not shown above, but: >> > >> > - #basename answers the entire filename, i.e. "c.d.e". >> > >> > >> > Does anyone know the history of these methods? >> > >> > >> > Cheers, >> > Alistair >> > >> >> > > > -- > _,,,^..^,,,_ > best, Eliot >
Re: [Pharo-dev] 19609 FileReference>>base should be before last separator
Hi Stef, On Thu, Aug 17, 2017 at 8:08 AM, Stephane Ducassewrote: > I do not know but I imagine that I added basenameWithoutExtension because > I found the name much much clearer. I would have never guessed that > base is the basename without the extension. > While basenameWithoutExtension is an intension revealing selector it is soon ln :-) For file manipulation code that's a problem. I wonder if something like bodyName is better because it's shorter. > Stef > > On Wed, Aug 16, 2017 at 9:46 PM, Alistair Grant > wrote: > > Hi All, > > > > I've just taken a look at issue 19609 FileReference>>base should be > > before last separator and wonder whether it is a correct interpretation > > of the original intentions. > > > > The original author of the issue, Michael, seems to feel that > > FileReferene>>base and FileReference>>basenameWithoutExtension are the > > same. > > > > My reading of the comments is that they perform a different function, > > i.e.: > > > > > > '/a/b/c.d.e' asFileReference base. "c" > > '/a/b/c.d.e' asFileReference basenameWithoutExtension. "c.d" > > > > > > are both the expected values, i.e.: > > > > - #base answers the name up to the first extensionDelimiter. > > - #basenameWithoutExtension answers the name without what is typically > > considered the file extension (the bit after the last > > extensionDelimiter). > > > > Not shown above, but: > > > > - #basename answers the entire filename, i.e. "c.d.e". > > > > > > Does anyone know the history of these methods? > > > > > > Cheers, > > Alistair > > > > -- _,,,^..^,,,_ best, Eliot
Re: [Pharo-dev] 19609 FileReference>>base should be before last separator
Hi Stef, On Thu, Aug 17, 2017 at 05:08:40PM +0200, Stephane Ducasse wrote: > I do not know but I imagine that I added basenameWithoutExtension because > I found the name much much clearer. I would have never guessed that > base is the basename without the extension. > > Stef Thanks for the clarification. Although #base isn't the name without the extension, it is the portion of the name up to the first extension delimiter (for names with a single extension delimiter the two will of course be the same, but for names with multiple extension delimiters they will be different). In that case, assuming no one else comes up with additional information, I would argue that the issue should be closed (rejected), and Michael should change his code to use #basenameWithoutExtension instead of #base. It would be nice to improve the comments in the code - I'll add it to my list. :-) Cheers, Alistair > On Wed, Aug 16, 2017 at 9:46 PM, Alistair Grantwrote: > > Hi All, > > > > I've just taken a look at issue 19609 FileReference>>base should be > > before last separator and wonder whether it is a correct interpretation > > of the original intentions. > > > > The original author of the issue, Michael, seems to feel that > > FileReferene>>base and FileReference>>basenameWithoutExtension are the > > same. > > > > My reading of the comments is that they perform a different function, > > i.e.: > > > > > > '/a/b/c.d.e' asFileReference base. "c" > > '/a/b/c.d.e' asFileReference basenameWithoutExtension. "c.d" > > > > > > are both the expected values, i.e.: > > > > - #base answers the name up to the first extensionDelimiter. > > - #basenameWithoutExtension answers the name without what is typically > > considered the file extension (the bit after the last > > extensionDelimiter). > > > > Not shown above, but: > > > > - #basename answers the entire filename, i.e. "c.d.e". > > > > > > Does anyone know the history of these methods? > > > > > > Cheers, > > Alistair > > >
Re: [Pharo-dev] 19609 FileReference>>base should be before last separator
I do not know but I imagine that I added basenameWithoutExtension because I found the name much much clearer. I would have never guessed that base is the basename without the extension. Stef On Wed, Aug 16, 2017 at 9:46 PM, Alistair Grantwrote: > Hi All, > > I've just taken a look at issue 19609 FileReference>>base should be > before last separator and wonder whether it is a correct interpretation > of the original intentions. > > The original author of the issue, Michael, seems to feel that > FileReferene>>base and FileReference>>basenameWithoutExtension are the > same. > > My reading of the comments is that they perform a different function, > i.e.: > > > '/a/b/c.d.e' asFileReference base. "c" > '/a/b/c.d.e' asFileReference basenameWithoutExtension. "c.d" > > > are both the expected values, i.e.: > > - #base answers the name up to the first extensionDelimiter. > - #basenameWithoutExtension answers the name without what is typically > considered the file extension (the bit after the last > extensionDelimiter). > > Not shown above, but: > > - #basename answers the entire filename, i.e. "c.d.e". > > > Does anyone know the history of these methods? > > > Cheers, > Alistair >