Frank Shearar uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-fbs.599.mcz
==================== Summary ====================
Name: System-fbs.599
Author: fbs
Time: 1 October 2013, 11:19:18.501 pm
UUID: ec7dbcc2-93e6-4143-bfee-4d52d9368951
Ancestors: System-fbs.598
Minor spelling corrections.
=============== Diff against System-fbs.598 ===============
Item was changed:
TextDiffBuilder subclass: #ClassDiffBuilder
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'System-FilePackage'!
+ !ClassDiffBuilder commentStamp: 'fbs 9/23/2013 08:58' prior: 0!
+ I'm like TextDiffBuilder, but I split the input text by Character >> #separators, instead of new lines. I'm probably meant to create diffs of class definitions.!
- !ClassDiffBuilder commentStamp: 'klub 12/28/2009 05:14' prior: 0!
- I'm like TextDiffBuilder, but I split the input text by Character >> #separators, instead of new lines. I'm probably ment to create diffs of class definitions.!
Item was changed:
Object subclass: #TextDiffBuilder
instanceVariableNames: 'xLines yLines ignoreLineEndings'
classVariableNames: 'IgnoreLineEndings InsertTextAttributes NormalTextAttributes RemoveTextAttributes'
poolDictionaries: ''
category: 'System-FilePackage'!
+ !TextDiffBuilder commentStamp: 'fbs 9/23/2013 08:58' prior: 0!
- !TextDiffBuilder commentStamp: 'ul 9/11/2013 01:05' prior: 0!
I implement the diff algorithm. I can show the differences between two texts. See my method comments for further information.
Instance Variables
xLines: <Array>
yLines: <Array>
ignoreLineEndings: <Boolean>
xLines
- an Array of DiffElements which is created from the first input text
yLines
- an Array of DiffElements which is created from the second input text
ignoreLineEndings
+ - a Boolean describing whether lines only differing in the line endings should be reported as a difference, or not!
- - a Boolean describing wether lines only differing in the line endings should be reported as a difference, or not!
Item was changed:
----- Method: TextDiffBuilder>>lcsFor:and: (in category 'private') -----
lcsFor: xFilteredLines and: yFilteredLines
+ "I find one of the longest common subsequences of my arguments. I assume that none of my arguments are empty. I return nil, or an Array which represents a list. The first two elements are the matching ''line'' numbers, the third (and last) is the next node in the list, or nil, if there are no more elements. The list contains the longest common subsequence. I'm a modified version of the Greedy LCS/SES Algorithm from the 6th page of 'An O(ND) Difference Algorithm and Its Variations (1986)' by Eugene W. Myers."
- "I find one of the longest common subsequences of my arguments. I assume that none of my arguments are empty. I return nil, or an Array which represents a list. The first two elements are the matching ''line'' numbers, the third (and last) is the next node in the list, or nil, if there are no more elements. The list containts the longest common subsequence. I'm a modified version of the Greedy LCS/SES Algorithm from the 6th page of 'An O(ND) Difference Algorithm and Its Variations (1986)' by Eugene W. Myers"
| n m v lcss max index lcs x y |
n := xFilteredLines size.
m := yFilteredLines size.
max := m + n.
v := Array new: 2 * max + 1.
lcss := Array new: 2 * max + 1.
"Unrolled first iteration (d = 0, k = 0)"
index := max + 2.
y := x := v at: index put: 0.
lcs := lcss at: index.
[ x < n and: [ y < m and: [ (xFilteredLines at: x + 1) = (yFilteredLines at: y + 1) ] ] ]
whileTrue: [ lcs := { x := x + 1. y := y + 1. lcs } ].
x >= n ifTrue: [ y >= m ifTrue: [ ^lcs ] ].
v at: max + 1 put: x.
lcss at: max + 1 put: lcs.
1 to: max do: [ :d |
"Unrolled lowest diagonal checks (k = -d)."
index := max - d + 2.
x := v at: index.
y := x + d.
lcs := lcss at: index.
[ x < n and: [ y < m and: [ (xFilteredLines at: x + 1) = (yFilteredLines at: y + 1) ] ] ]
whileTrue: [ lcs := { x := x + 1. y := y + 1. lcs } ].
x >= n ifTrue: [ y >= m ifTrue: [ ^lcs ] ].
v at: max - d + 1 put: x.
lcss at: max - d + 1 put: lcs.
"Inner diagonals. (k in [2-d..d-2])"
2 - d to: d - 2 by: 2 do: [ :k |
index := max + k.
(v at: index) < (v at: index + 2)
ifTrue: [ x := v at: (index := index + 2) ]
ifFalse: [ x := (v at: index) + 1 ].
y := x - k.
lcs := lcss at: index.
[ x < n and: [ y < m and: [ (xFilteredLines at: x + 1) = (yFilteredLines at: y + 1) ] ] ]
whileTrue: [ lcs := { x := x + 1. y := y + 1. lcs } ].
x >= n ifTrue: [ y >= m ifTrue: [ ^lcs ] ].
v at: max + k + 1 put: x.
lcss at: max + k + 1 put: lcs ].
"Unrolled highest diagonal checks (k = d)."
index := max + d.
x := (v at: index) + 1.
y := x - d.
lcs := lcss at: index.
[ x < n and: [ y < m and: [ (xFilteredLines at: x + 1) = (yFilteredLines at: y + 1) ] ] ]
whileTrue: [ lcs := { x := x + 1. y := y + 1. lcs } ].
x >= n ifTrue: [ y >= m ifTrue: [ ^lcs ] ].
v at: max + d + 1 put: x.
lcss at: max + d + 1 put: lcs ].
self error "We should never reach this point."!
So far as I can tell, this method cannot return nil (well, unless somebody subverts things) and yet two senders try to handle the result being nil.
EncodedCharSet class>scanSelectorAt: and CompoundTextConvertor>nextPutValue:toStream:withShiftSequenceIfNeededForLeadingChar:
If the intent was that something ought to sometimes happen that actually can't, maybe the code needs checking, just in case. All the other senders rely on the result being non-nil.
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Fractured Idiom:- POSH MORTEM - Death styles of the rich and famous
Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.500.mcz
==================== Summary ====================
Name: Tools-cmm.500
Author: cmm
Time: 1 October 2013, 2:19:25.118 pm
UUID: 426c84cf-2b9c-4c84-8a06-489fabc91907
Ancestors: Tools-fbs.499
- Ensure RecentMessages startUp is executed in postScript.
- Employ "Meaningless Behavior" (from CHECKS PLII) rather than a modal dialog by putting up an empty RecentMessageSet rather than a modal alert.
=============== Diff against Tools-fbs.499 ===============
Item was changed:
----- Method: RecentMessageSet>>updateListsAndCodeIn: (in category 'update') -----
updateListsAndCodeIn: aWindow
| recentFromUtilities |
"RAA 20 june 2000 - a recent change to how messages were displayed in the list caused them not to match what was stored in Utilities. This caused the recent submissions to be continuously updated. The hack below fixed that problem"
self flag: #mref. "in second pass, use simpler test"
self canDiscardEdits ifFalse: [^ self].
+ RecentMessages default isEmpty ifTrue: [ ^ self ].
recentFromUtilities := RecentMessages default mostRecent asString,' '.
(messageList first asStringOrText asString beginsWith: recentFromUtilities)
ifFalse:
[self reformulateList]
ifTrue:
[self updateCodePaneIfNeeded]!
Item was changed:
----- Method: Utilities class>>browseRecentSubmissions (in category '*Tools') -----
browseRecentSubmissions
"Open up a browser on the most recent methods submitted in the image. 5/96 sw."
"Utilities browseRecentSubmissions"
+ | recentMessages |
- | recentMessages |
-
- RecentMessages default isEmpty ifTrue:
- [^ self inform: 'There are no recent submissions'].
-
recentMessages := RecentMessages default methodReferences reversed.
^ RecentMessageSet
openMessageList: recentMessages
name: 'Recent submissions -- youngest first '
autoSelect: nil.!
Item was changed:
(PackageInfo named: 'Tools') postscript: 'Workspace allSubInstancesDo: [ :each | (each instVarNamed: #bindings) ifNil: [ each initializeBindings ] ].
+ World initializeDesktopCommandKeySelectors.
+ RecentMessages startUp.'!
- World initializeDesktopCommandKeySelectors'!
After just updating from trunk, all of my Recent Submissions have been
blown away and it appears it is not accepting new submissions!
I use this all the time, doesn't everyone?
Frank is this you?
Does this method belong to Collections? Shouldn't it be an extension
method?
Levente
On Mon, 30 Sep 2013, commits(a)source.squeak.org wrote:
> tim Rowledge uploaded a new version of Collections to project The Trunk:
> http://source.squeak.org/trunk/Collections-tpr.537.mcz
>
> ==================== Summary ====================
>
> Name: Collections-tpr.537
> Author: tpr
> Time: 30 September 2013, 4:06:41.402 pm
> UUID: b3a96179-9642-40b1-93f3-3f1d82f3e256
> Ancestors: Collections-fbs.536
>
> Add Character class>>characterForColumnBreak - to replace TextComposer equivalent. See Mantis 4814
>
> =============== Diff against Collections-fbs.536 ===============
>
> Item was added:
> + ----- Method: Character class>>characterForColumnBreak (in category 'accessing untypeable characters') -----
> + characterForColumnBreak
> + "use a newPage to split columns in character scanners"
> + ^self newPage!
>
>
>
Chris Muller uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-cmm.33.mcz
==================== Summary ====================
Name: Environments-cmm.33
Author: cmm
Time: 30 September 2013, 7:53:24.291 pm
UUID: 5f0a2674-9bae-44ec-9526-37d24814878e
Ancestors: Environments-fbs.32
Remove isVariableBinding redundant with super impl.
=============== Diff against Environments-fbs.32 ===============
Item was removed:
- ----- Method: Binding>>isVariableBinding (in category 'as yet unclassified') -----
- isVariableBinding
- ^ true!
Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.538.mcz
==================== Summary ====================
Name: Collections-cmm.538
Author: cmm
Time: 30 September 2013, 7:50:52.954 pm
UUID: f041f162-9c02-499f-866e-27d2e1a31b6b
Ancestors: Collections-tpr.537
- Logging output to a #endEntry is sometimes necessary. So let's still allow switching to another kind of WriteStream.
=============== Diff against Collections-tpr.537 ===============
Item was added:
+ ----- Method: WriteStream>>endEntry (in category 'compatibility') -----
+ endEntry
+ "No-op for compatibility with TranscriptStream."!
Item was changed:
+ ----- Method: WriteStream>>flush (in category 'compatibility') -----
- ----- Method: WriteStream>>flush (in category 'file open/close') -----
flush!