[Cuis] veryShortName
Masashi UMEZAWA
ume at blueplane.jp
Sun Oct 25 09:15:18 CDT 2015
Hi all,
Indeed, we should avoid adding ad-hoc methods.
Currently I'm thinking to introduce a more generic API (splitName:by:)
to FmFileIOAccessor.
So we can implement FmFileEntry methods more consistently like:
FmFileEntry >> firstName
^ (self fileAccessor splitName: self name by: self extensionDelimiter) first
FmFileEntry >> extension
^ (self fileAccessor splitName: self name by: self extensionDelimiter) last
FmFileEntry >> baseName
| names |
names := self fileAccessor splitName: self name by: self extensionDelimiter.
names size = 1 ifTrue: [^names first].
^self extensionDelimiter join: names allButLast
Best regards,
2015-10-24 2:22 GMT+09:00 Juan Vuletich <juan at jvuletich.org>:
> On 17/10/2015 11:39 a.m., KenD wrote:
>>
>> On Sat, 17 Oct 2015 14:28:23 +0900
>> Masashi UMEZAWA<ume at blueplane.jp> wrote:
>>
>>> Perhaps #firstName or #nameUpToDot would be better?
>>
>> Yes. Either works for me.
>>
>> Thanks,
>> KenD<Ken.Dickey at Whidbey.com>
>>
>
> Besides #shortName, we also have #splitNameVersionExtensionFor:,
> #baseNameFor:, #baseName, etc. Reducing their number would be good. As it
> would be to separate those that give a "standard service" from those that
> just solve a more specific need of some client code.
>
> Cheers,
> Juan Vuletich
--
[:masashi | ^umezawa]
More information about the Cuis
mailing list