Re: [squeak-dev] The Trunk: Files-jcg.27.mcz

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

Re: [squeak-dev] The Trunk: Files-jcg.27.mcz

Joshua Gargus-2
Does anyone know why several classes had their class variables
alphabetized when I committed this version?  I didn't do it explicitly.
Is this the desired behavior?

Cheers,
Josh


[hidden email] wrote:

> Joshua Gargus uploaded a new version of Files to project The Trunk:
> http://source.squeak.org/trunk/Files-jcg.27.mcz
>
> ==================== Summary ====================
>
> Name: Files-jcg.27
> Author: jcg
> Time: 1 September 2009, 12:56:15 pm
> UUID: 1b72224b-d639-44fc-b7ef-3ea1d359f682
> Ancestors: Files-ar.26
>
> RemoteString>>checkSum: relied on broken behavior in #mimeEncode:  (see Collections-jcg.124).  Fixed this assumption, and simplified the code at the same time.
>
> =============== Diff against Files-ar.26 ===============
>
> Item was changed:
>   ----- Method: RemoteString>>checkSum: (in category 'private') -----
>   checkSum: aString
>   "Construct a checksum of the string.  A three byte number represented as Base64 characters."
> + | sum shift bytes |
> + sum := aString size.
> + shift := 0.
> + aString do: [:char |
> + (shift := shift + 7) > 16 ifTrue: [shift := shift - 17].
> + "shift by 7 to keep a change of adjacent chars from xoring to same value"
> + sum := sum bitXor: (char asInteger bitShift: shift)
> + ].
> + bytes := ByteArray new: 3.
> + sum := sum + 16r10000000000.
> + 1 to: 3 do: [:ind | bytes at: ind put: (sum digitAt: ind)].
> + ^bytes base64Encoded!
> -
> - | sum shift bytes ss bb |
> - sum := aString size.
> - shift := 0.
> - aString do: [:char |
> - (shift := shift + 7) > 16 ifTrue: [shift := shift - 17].
> - "shift by 7 to keep a change of adjacent chars from xoring to same value"
> - sum := sum bitXor: (char asInteger bitShift: shift)].
> - bytes := ByteArray new: 3.
> - sum := sum + 16r10000000000.
> - 1 to: 3 do: [:ind | bytes at: ind put: (sum digitAt: ind)].
> - ss := ReadWriteStream on: (ByteArray new: 3).
> - ss nextPutAll: bytes.
> - bb := Base64MimeConverter mimeEncode: ss.
> - ^ bb contents!
>
> Item was changed:
>   StandardFileStream subclass: #CrLfFileStream
>   instanceVariableNames: 'lineEndConvention'
> + classVariableNames: 'Cr CrLf Lf LineEndDefault LineEndStrings LookAheadCount'
> - classVariableNames: 'LookAheadCount LineEndDefault LineEndStrings CrLf Cr Lf'
>   poolDictionaries: ''
>   category: 'Files-Kernel'!
>  
>   !CrLfFileStream commentStamp: 'ls 11/10/2002 13:32' prior: 0!
>   I am the same as a regular file stream, except that when I am in text mode, I will automatically convert line endings between the underlying platform's convention, and Squeak's convention of carriage-return only.  The goal is that Squeak text files can be treated as OS text files, and vice versa.
>  
>   In binary mode, I behave identically to a StandardFileStream.
>  
>   To enable CrLfFileStream as the default file stream class for an entire image, modify FileStream class concreteStream .
>  
>  
>   There are two caveats on programming with CrLfFileStream.
>  
>   First, the choice of text mode versus binary mode affects which characters are visible in Squeak, and no longer just affects whether those characters are returned as Character's or as Integer's.  Thus the choice of mode needs to be made very carefully, and must be based on intent instead of convenience of representation.  The methods asString, asByteArray, asCharacter, and asInteger can be used to convert between character and integer representations.  (Arguably, file streams should accept either strings or characters in nextPut: and nextPutAll:, but that is not the case right now.)
>  
>   Second, arithmetic on positions no longer works, because one character that Squeak sees (carriage return) could map to two characters in the underlying file (carriage return plus line feed, on MS Windows and MS DOS).  Comparison between positions still works.  (This caveat could perhaps be fixed by maintaining a map between Squeak positions and positions in the underlying file, but it is complicated.  Consider, for example, updates to the middle of the file.  Also, consider that text files are rarely updated in the middle of the file, and that general random access to a text file is rarely very useful.  If general random access with specific file counts is desired, then the file is starting to sound like a binary file instead of a text file.)
>  
>   !
>
> Item was changed:
>   Object subclass: #FileDirectory
>   instanceVariableNames: 'pathName'
> + classVariableNames: 'DefaultDirectory DirectoryClass StandardMIMEMappings'
> - classVariableNames: 'StandardMIMEMappings DirectoryClass DefaultDirectory'
>   poolDictionaries: ''
>   category: 'Files-Directories'!
>  
>   !FileDirectory commentStamp: '<historical>' prior: 0!
>   A FileDirectory represents a folder or directory in the underlying platform's file system. It carries a fully-qualified path name for the directory it represents, and can enumerate the files and directories within that directory.
>  
>   A FileDirectory can be thought of as a Dictionary whose keys are the local names of files in that directory, and whose values are directory "entries". Each entry is an array of five items:
>  
>   <name> <creationTime> <modificationTime> <dirFlag> <fileSize>
>  
>   The times are given in seconds, and can be converted to a time and date via Time>dateAndTimeFromSeconds:. See the comment in lookupEntry:... which provides primitive access to this information.
>   !
>
> Item was changed:
>   Object subclass: #RemoteString
>   instanceVariableNames: 'sourceFileNumber filePositionHi'
> + classVariableNames: 'CurrentTextAttStructure CurrentTextAttVersion TextAttributeStructureVersions'
> - classVariableNames: 'TextAttributeStructureVersions CurrentTextAttVersion CurrentTextAttStructure'
>   poolDictionaries: ''
>   category: 'Files-System'!
>  
>   !RemoteString commentStamp: '<historical>' prior: 0!
>   My instances provide an external file reference to a piece of text.  It may be the sourceCode of a method, or the class comments of a class.
>  
>   The changes file or file-in file usually has a chunk that is just the source string of a method:
>  
>   max: aNumber
>   ^ self > aNumber ifTrue: [self] ifFalse: [aNumber]!!
>  
>   I can return either a String or a Text.  Some a chunk is followed by a second chunk (beginning with ]style[) containing style information.  The encoding is like this:
>  
>   max: aNumber
>   ^ self > aNumber ifTrue: [self] ifFalse: [aNumber]!!
>   ]style[(14 50 312)f1,f1b,f1LInteger +;i!!
>  
>   Allowed TextAttributes are TextFontChange, TextEmphasis, TextColor, TextDoIt, TextKern, TextLink, TextURL.  TextFontReference and TextAnchor are not supported.
>  
>   See PositionableStream nextChunkText and RunArray class scanFrom:.!
>
>
>  


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Files-jcg.27.mcz

Bert Freudenberg
On 01.09.2009, at 10:01, Joshua Gargus wrote:

> Does anyone know why several classes had their class variables
> alphabetized when I committed this version?  I didn't do it  
> explicitly.
> Is this the desired behavior?

Yes:

http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-August/138223.html

Looking at how the formatting is lost in the archive me thinks we need  
to remind people not to send HTML to the list if possible. Including  
you, Eliot ;)

- Bert -

> Cheers,
> Josh
>
>
> [hidden email] wrote:
>>
>>  StandardFileStream subclass: #CrLfFileStream
>>   instanceVariableNames: 'lineEndConvention'
>> + classVariableNames: 'Cr CrLf Lf LineEndDefault LineEndStrings  
>> LookAheadCount'
>> - classVariableNames: 'LookAheadCount LineEndDefault  
>> LineEndStrings CrLf Cr Lf'
>>   poolDictionaries: ''
>>   category: 'Files-Kernel'!


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Files-jcg.27.mcz

Bert Freudenberg

On 01.09.2009, at 11:45, Bert Freudenberg wrote:

> On 01.09.2009, at 10:01, Joshua Gargus wrote:
>
>> Does anyone know why several classes had their class variables
>> alphabetized when I committed this version?  I didn't do it  
>> explicitly.
>> Is this the desired behavior?
>
> Yes:
>
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-August/138223.html
>
> - Bert -

... and if our squeaksource server was using the same MC version as in  
trunk, you would not even see these spurious diffs, because it knows  
the two definitions are actually equivalent.

- Bert -

>
>> Cheers,
>> Josh
>>
>>
>> [hidden email] wrote:
>>>
>>> StandardFileStream subclass: #CrLfFileStream
>>> instanceVariableNames: 'lineEndConvention'
>>> + classVariableNames: 'Cr CrLf Lf LineEndDefault LineEndStrings  
>>> LookAheadCount'
>>> - classVariableNames: 'LookAheadCount LineEndDefault  
>>> LineEndStrings CrLf Cr Lf'
>>> poolDictionaries: ''
>>> category: 'Files-Kernel'!
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Files-jcg.27.mcz

Joshua Gargus-2
Bert Freudenberg wrote:

>
> On 01.09.2009, at 11:45, Bert Freudenberg wrote:
>
>> On 01.09.2009, at 10:01, Joshua Gargus wrote:
>>
>>> Does anyone know why several classes had their class variables
>>> alphabetized when I committed this version?  I didn't do it explicitly.
>>> Is this the desired behavior?
>>
>> Yes:
>>
>> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-August/138223.html
>>
>>
>> - Bert -
>
> ... and if our squeaksource server was using the same MC version as in
> trunk, you would not even see these spurious diffs, because it knows
> the two definitions are actually equivalent.

That was my next question.  Thanks Bert!

Josh


>
> - Bert -
>>
>>> Cheers,
>>> Josh
>>>
>>>
>>> [hidden email] wrote:
>>>>
>>>> StandardFileStream subclass: #CrLfFileStream
>>>>     instanceVariableNames: 'lineEndConvention'
>>>> +     classVariableNames: 'Cr CrLf Lf LineEndDefault LineEndStrings
>>>> LookAheadCount'
>>>> -     classVariableNames: 'LookAheadCount LineEndDefault
>>>> LineEndStrings CrLf Cr Lf'
>>>>     poolDictionaries: ''
>>>>     category: 'Files-Kernel'!
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Files-jcg.27.mcz

Igor Stasenko
In reply to this post by Bert Freudenberg
2009/9/1 Bert Freudenberg <[hidden email]>:

> On 01.09.2009, at 10:01, Joshua Gargus wrote:
>
>> Does anyone know why several classes had their class variables
>> alphabetized when I committed this version?  I didn't do it explicitly.
>> Is this the desired behavior?
>
> Yes:
>
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-August/138223.html
>
> Looking at how the formatting is lost in the archive me thinks we need to
> remind people not to send HTML to the list if possible. Including you, Eliot
> ;)
Huh? Joshua == Eliot? O_o

>
> - Bert -
>
>> Cheers,
>> Josh
>>
>>
>> [hidden email] wrote:
>>>
>>>  StandardFileStream subclass: #CrLfFileStream
>>>        instanceVariableNames: 'lineEndConvention'
>>> +       classVariableNames: 'Cr CrLf Lf LineEndDefault LineEndStrings
>>> LookAheadCount'
>>> -       classVariableNames: 'LookAheadCount LineEndDefault LineEndStrings
>>> CrLf Cr Lf'
>>>        poolDictionaries: ''
>>>        category: 'Files-Kernel'!
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Files-jcg.27.mcz

Eliot Miranda-2
In reply to this post by Bert Freudenberg


On Tue, Sep 1, 2009 at 2:45 AM, Bert Freudenberg <[hidden email]> wrote:
On 01.09.2009, at 10:01, Joshua Gargus wrote:

Does anyone know why several classes had their class variables
alphabetized when I committed this version?  I didn't do it explicitly.
Is this the desired behavior?

Yes:

http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-August/138223.html

Looking at how the formatting is lost in the archive me thinks we need to remind people not to send HTML to the list if possible. Including you, Eliot ;)

You mean I have to give up posting those beautifully syntax-highlighted methods??  Please don't take my Kodachrome away?!


- Bert -

Cheers,
Josh


[hidden email] wrote:

 StandardFileStream subclass: #CrLfFileStream
       instanceVariableNames: 'lineEndConvention'
+       classVariableNames: 'Cr CrLf Lf LineEndDefault LineEndStrings LookAheadCount'
-       classVariableNames: 'LookAheadCount LineEndDefault LineEndStrings CrLf Cr Lf'
       poolDictionaries: ''
       category: 'Files-Kernel'!





Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] The Trunk: Files-jcg.27.mcz

Bert Freudenberg

On 02.09.2009, at 00:57, Eliot Miranda wrote:

>
>
> On Tue, Sep 1, 2009 at 2:45 AM, Bert Freudenberg  
> <[hidden email]> wrote:
> On 01.09.2009, at 10:01, Joshua Gargus wrote:
>
> Does anyone know why several classes had their class variables
> alphabetized when I committed this version?  I didn't do it  
> explicitly.
> Is this the desired behavior?
>
> Yes:
>
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2009-August/138223.html
>
> Looking at how the formatting is lost in the archive me thinks we  
> need to remind people not to send HTML to the list if possible.  
> Including you, Eliot ;)
>
> You mean I have to give up posting those beautifully syntax-
> highlighted methods??  Please don't take my Kodachrome away?!


I mean unless you have a good reason, do not use HTML. See how the  
indentation is lost in my reply? Not cool.

- Bert -