[squeak-dev] Re: [Pharo-project] About (backwards) Compatibility

Frank Shearar frank.shearar at gmail.com
Sat Dec 22 20:05:18 UTC 2012


On 22 December 2012 19:04, Igor Stasenko <siguctua at gmail.com> wrote:
> On 22 December 2012 19:04, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>>
>>
>>
>> On Sat, Dec 15, 2012 at 3:42 PM, Sean P. DeNigris <sean at clipperadams.com>
>> wrote:
>>>
>>> H. Hirzel wrote
>>> > As Chris points out, the difference is minimal.
>>> >
>>> > Sean, it looks like you need better examples to show how you perceive
>>> > the benefits of the FileSystem design
>>>
>>> While you ignored the point of my followup post, which is that beauty and
>>> simplicity lead to more than the sum of a few keywords, here are a few
>>> basic
>>> examples...
>>>
>>> Example #1:
>>> file := FileDirectory directoryEntryFor: '/path/to/file'.
>>> FileDirectory extensionFor: file name.
>>>
>>> vs.
>>>
>>> file2 := '/path/to/file' asFileReference.
>>> file2 extension.
>>>
>>> #2:
>>> (FileDirectory on: 'path') entryAt: 'nohup.out'.
>>> vs.
>>> 'path' asFileReference / 'filename'
>>>
>>> "Most operations routed through one massive FD class" vs. "immediate
>>> access
>>> to the domain object you want"; not to mention the appreciated absence of
>>> parens.
>>>
>>> No difference??
>>>
>> But with
>>
>> String methods for *FileSystem-utilities
>> / aPath
>>       ^self asFileReference / aPath
>>
>> you get
>>
>>     'path' / 'filename'
>>
>> and that's *really* nice.
>>
>> Does anyone think that '123' / '45' is good??
>>
>> This is a compromise:
>>
>> / arg
>>     self size = 0 ifTrue: [self error: 'cannot coerce the empty string].
>>     ^('+-01234456789' incudes: self first)
>>         ifTrue: [arg adaptToString: self andSend: #/]
>>         ifFalse: [self asFileReference / arg]
>>
>> the issue here being whether FileSystem wants '.profile' or '.hg' et al or
>> math wants '.123'.
>>
>> If FileSystem provides path-name checking then the above could include a
>> specific legality check instead of the naive discrimination.
>>
>> Personally I find the prospect of a concise file scripting api much more
>> appealing than lazy numeric conversion.  The absence of the former is why so
>> much of my life involves bash scripts.  The latter isn't necessary if one
>> starts off with numbers in the first place, and being literals they're as
>> easy, no, easier than denoting numbers using strings (1 + 1 is shorter than
>> '1' + 1).
>>
>
>
> yes, i want string math, because at the end, everything you type into
> machine is strings, so having objects, classes or compiled methods
> seems like overcomplication, when you can do the same by just using
> stings..
> We definitely should reconsider "everything is an object" postulate,
> instead we should postulate "everything is string",
> otherwise smalltalk will never be a successful platform like
> javascript/perl etc.
>
> oh, yes, and while we're changing that, please add the 'math' precedence rules,
> because my math teacher is the school told me that this is the only
> right way they should be processed,
> oh, and at last, lets use curly braces syntax because it is sooo convenient.
> ;)

But don't forget to preserve the fact that '1' + 1 is not the same as 1 + '1' !

frank

>> I hope Squeak integrates FileSystem in 4.4 for 4.5.
>> --
>> best,
>> Eliot
>
>
> --
> Best regards,
> Igor Stasenko.
>


More information about the Squeak-dev mailing list