Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.838.mcz
==================== Summary ====================
Name: Tools-eem.838
Author: eem
Time: 11 December 2018, 10:26:23.796428 pm
UUID: f6aeef1b-77ff-440c-9e16-ab6b654a9378
Ancestors: Tools-pre.837
For the benefit of proxies avoid the use of withArgs:executeMethod: in Debugger>>runUntil.
=============== Diff against Tools-pre.837 ===============
Item was changed:
----- Method: Debugger>>runUntil (in category 'code pane menu') -----
runUntil
"Step until an expression evaluates to other than false, reporting an error if it doesn't evaluate to true.
Remember the expression in an inst var. If shift is pressed when the expression is supplied, don't update the UI.
If shift is pressed while stepping, stop stepping. Using a user interrupt to break out would be more natural
but Squeak currently doesn't provide a UserInterrupt expection. It should do."
| expression receiver context method value lastUpdate updateUI breakOnShift |
expression := UIManager default
request: 'run until expression is true (shift to disable ui update; shift to break).'
initialAnswer: (untilExpression ifNil: 'boolean expression').
(expression isNil or: [expression isEmpty]) ifTrue:
[^self].
updateUI := breakOnShift := Sensor shiftPressed not.
untilExpression := expression.
context := self selectedContext.
receiver := context receiver.
method := receiver class evaluatorClass new
compiledMethodFor: untilExpression
in: context
to: receiver
notifying: nil
ifFail: [^ #failedDoit].
lastUpdate := Time millisecondClockValue.
Cursor execute showWhile:
[[self selectedContext == context
and: [context willReturn not
+ and: [(value := method valueWithReceiver: receiver arguments: {context}) == false]]] whileTrue:
- and: [(value := receiver with: context executeMethod: method) == false]]] whileTrue:
[interruptedProcess completeStep: self selectedContext.
self selectedContext == context ifTrue:
[self resetContext: interruptedProcess stepToSendOrReturn changeContents: false].
Time millisecondClockValue - lastUpdate > 50 ifTrue:
[updateUI ifTrue:
[self changed: #contentsSelection.
Project current world displayWorldSafely].
breakOnShift
ifTrue: [Sensor shiftPressed ifTrue:
[self changed: #contentsSelection.
self updateInspectors.
^self]]
ifFalse: [Sensor shiftPressed ifFalse: [breakOnShift := true]].
lastUpdate := Time millisecondClockValue]]].
self changed: #contentsSelection.
self updateInspectors.
(value ~~ false and: [value ~~ true]) ifTrue:
[UIManager default inform: 'expression ', (untilExpression contractTo: 40), ' answered ', (value printString contractTo: 20), '!!!!']!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1204.mcz
==================== Summary ====================
Name: Kernel-eem.1204
Author: eem
Time: 11 December 2018, 10:25:21.771318 pm
UUID: 6984fae9-5e2c-4093-b962-d51a825e3176
Ancestors: Kernel-nice.1203
For teh benefit of proxies avoid withArgs:executeMethod: in CompiledMethod>>valueWithReceiver:arguments:. Have CompiledMethod class>>receiver:withArguments:executeMethod: expect the primitiv e is available in that form and fail rather than fall back on withArgs:executeMethod:.
=============== Diff against Kernel-nice.1203 ===============
Item was changed:
----- Method: CompiledMethod class>>receiver:withArguments:executeMethod: (in category 'evaluating') -----
receiver: receiver withArguments: argArray executeMethod: compiledMethod
"Execute compiledMethod against the receiver and the arguments in argArray"
+ <primitive: 188 error: ec>
+ self primitiveFailed!
- <primitive: 188>
- ^receiver withArgs: argArray executeMethod: compiledMethod!
Item was changed:
----- Method: CompiledMethod>>valueWithReceiver:arguments: (in category 'evaluating') -----
valueWithReceiver: aReceiver arguments: anArray
+ ^self class receiver: aReceiver withArguments: anArray executeMethod: self!
- "This should be changed after the release of Squeak 4.3 to
- ^self class receiver: aReceiver withArguments: anArray executeMethod: self"
- ^ aReceiver withArgs: anArray executeMethod: self!
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1203.mcz
==================== Summary ====================
Name: Kernel-nice.1203
Author: nice
Time: 12 December 2018, 12:58:33.810289 am
UUID: 1fdf8772-d764-cd42-9291-fb7464d23204
Ancestors: Kernel-nice.1202
Micro-optimization: use knowledge of SmallFloat64 representation: due to restricted exponent range, they can't be infinite nor nan (nor subnormal, but we don't ask).
Let a comment be more accurate, primitive 75 does not only fail for SmallInteger, but also for any other immediate value.
=============== Diff against Kernel-nice.1202 ===============
Item was changed:
----- Method: ProtoObject>>identityHash (in category 'comparing') -----
identityHash
"Answer a SmallInteger whose value is related to the receiver's identity.
+ This method must not be overridden, except by immediate values.
+ Primitive. Fails if the receiver is immediate. Essential.
- This method must not be overridden, except by SmallInteger.
- Primitive. Fails if the receiver is a SmallInteger. Essential.
See Object documentation whatIsAPrimitive.
Do not override."
<primitive: 75>
self primitiveFailed!
Item was added:
+ ----- Method: SmallFloat64>>isFinite (in category 'testing') -----
+ isFinite
+ "A SmallFloat64 is always finite.
+ Infinity or nan require large exponent that does not fit."
+
+ ^true!
Item was added:
+ ----- Method: SmallFloat64>>isInfinite (in category 'testing') -----
+ isInfinite
+ "A SmallFloat64 is never infinite.
+ Infinity require large exponent that does not fit."
+
+ ^false!
Item was added:
+ ----- Method: SmallFloat64>>isNaN (in category 'testing') -----
+ isNaN
+ "A SmallFloat64 is never nan.
+ nan require large exponent that does not fit."
+
+ ^false!
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1202.mcz
==================== Summary ====================
Name: Kernel-nice.1202
Author: nice
Time: 12 December 2018, 12:31:18.370647 am
UUID: f1313d70-e185-de48-a230-53fe6f67ec59
Ancestors: Kernel-pre.1201, Kernel-nice.1200
Merge Kernel-pre.1201 + Kernel-nice.1200
=============== Diff against Kernel-pre.1201 ===============
Item was changed:
----- Method: Number>>defaultLabelForInspector (in category 'printing') -----
defaultLabelForInspector
"Answer the default label to be used for an Inspector window on the receiver."
+ ^ super defaultLabelForInspector, ': ', ([self printStringLimitedTo: 100]
+ ifError: ['<error cannot print this number>'])!
- ^ super defaultLabelForInspector, ': ', self printString!
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1200.mcz
==================== Summary ====================
Name: Kernel-nice.1200
Author: nice
Time: 9 December 2018, 11:17:42.830548 am
UUID: 4608ee87-5859-4132-918f-df0f71dcc07e
Ancestors: Kernel-eem.1199
Let's make basicInspect robust to crazy numbers.
With http://www.squeaksource.com/ArbitraryPrecisionFl.html
I can create crazy numbers like this:
((1 asArbitraryPrecisionFloatNumBits: 100) timesTwoPower: 1e100)
But then I can't print to decimal form (a bit too many bytes to be allocated....).
The problem when debugging such monster is that basicInspect is not basicEnough: it insists on printing the Number in the inspector title (label)!
If we invoke basicInspect, we generally want something basic. Even if we just inspect, having a label spanning more than 100 chars is vain...
So let's be robust.
=============== Diff against Kernel-eem.1199 ===============
Item was changed:
----- Method: Number>>defaultLabelForInspector (in category 'printing') -----
defaultLabelForInspector
"Answer the default label to be used for an Inspector window on the receiver."
+ ^ super defaultLabelForInspector, ': ', ([self printStringLimitedTo: 100]
+ ifError: ['<error cannot print this number>'])!
- ^ super defaultLabelForInspector, ': ', self printString!
Patrick Rein uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-pre.228.mcz
==================== Summary ====================
Name: Network-pre.228
Author: pre
Time: 11 December 2018, 4:07:36.560299 pm
UUID: 1dd9f0d5-8662-4b3d-b6ba-28ac11852dd3
Ancestors: Network-pre.227
Recategorizes methods in the Network package and applies a typo fix and an indentation fix.
=============== Diff against Network-pre.227 ===============
Item was changed:
+ ----- Method: Authorizer class>>unauthorizedFor: (in category 'utilities') -----
- ----- Method: Authorizer class>>unauthorizedFor: (in category 'as yet unclassified') -----
unauthorizedFor: realm
^'HTTP/1.0 401 Unauthorized', self crlf, 'WWW-Authenticate: Basic realm="Squeak/',realm,'"',
String crlfcrlf, '<html><title>Unauthorized</title><body><h2>Unauthorized for ',realm, '</h2></body></html>'
!
Item was changed:
+ ----- Method: HttpUrl class>>shutDown (in category 'system startup') -----
- ----- Method: HttpUrl class>>shutDown (in category 'as yet unclassified') -----
shutDown
"Forget all cached passwords, so they won't stay in the image"
Passwords := nil.!
Item was changed:
Object subclass: #MIMEDocument
instanceVariableNames: 'mainType subType content fields url parts'
classVariableNames: 'MIMEdatabase'
poolDictionaries: ''
category: 'Network-Url'!
+ !MIMEDocument commentStamp: 'pre 7/6/2017 13:58' prior: 0!
+ a MIME object, along with its type and the URL it was found at (if any)
+
+ Design decisions:
+ - The API for using the content of the MIME object inside Squeak returns Strings
+ in Squeak encoding. The serializing methods return the content serialized according
+ to the content-type and content-transfer-encoding --pre!
- !MIMEDocument commentStamp: '<historical>' prior: 0!
- a MIME object, along with its type and the URL it was found at (if any)!
Item was changed:
Object subclass: #Password
instanceVariableNames: 'cache sequence'
classVariableNames: ''
poolDictionaries: ''
category: 'Network-Kernel'!
+ !Password commentStamp: 'pre 12/11/2018 15:53' prior: 0!
- !Password commentStamp: '<historical>' prior: 0!
"Hold a password. There are three ways to get the password.
If there is no password (sequence == nil), ask the user for it.
+ If the user supplied one during this session, return that. It is cleared at shutDown.
- If the use supplied one during this session, return that. It is cleared at shutDown.
If sequence is a number, get the server passwords off the disk. File 'sqk.info' must be in the same folder 'Squeak.sources' file. Decode the file. Return the password indexed by sequence."!
Item was changed:
+ ----- Method: Password class>>shutDown (in category 'system startup') -----
- ----- Method: Password class>>shutDown (in category 'as yet unclassified') -----
shutDown
"Forget all cached passwords, so they won't stay in the image"
self allSubInstancesDo: [:each | each cache: nil].!
Item was changed:
+ ----- Method: Password>>decode: (in category 'private') -----
- ----- Method: Password>>decode: (in category 'as yet unclassified') -----
decode: string
"Xor with secret number -- just so file won't have raw password in it"
| kk rand |
rand := Random new seed: 234237.
kk := (ByteArray new: string size) collect: [:bb | (rand next * 255) asInteger].
1 to: kk size do: [:ii |
kk at: ii put: ((kk at: ii) bitXor: (string at: ii) asciiValue)].
^ kk asString!
Item was changed:
+ ----- Method: Password>>serverPasswords (in category 'accessing') -----
- ----- Method: Password>>serverPasswords (in category 'as yet unclassified') -----
serverPasswords
"Get the server passwords off the disk and decode them. The file 'sqk.info' must be in some folder that Squeak thinks is special (vm folder, or default directory). (Note: This code works even if you are running with no system sources file.)"
| sfile |
(sfile := FileDirectory lookInUsualPlaces: 'sqk.info') ifNil: [^ nil].
"If not there, Caller will ask user for password"
"If you don't have this file, and you really do want to release an update,
contact Ted Kaehler."
^ (self decode: (sfile contentsOfEntireFile)) lines
!
Item was changed:
+ ----- Method: RemoteFileStream>>close (in category 'file status') -----
- ----- Method: RemoteFileStream>>close (in category 'as yet unclassified') -----
close
"Write if we have data to write. FTP files are always binary to preserve the data exactly. The binary/text (ascii) flag is just for tell how the bits are delivered from a read."
remoteFile writable ifTrue: [
remoteFile putFile: (self as: RWBinaryOrTextStream) reset named: remoteFile fileName]!
Item was changed:
+ ----- Method: RemoteFileStream>>contentsOfEntireFile (in category 'accessing') -----
- ----- Method: RemoteFileStream>>contentsOfEntireFile (in category 'as yet unclassified') -----
contentsOfEntireFile
"Fetch the data off the server and store it in me. But not if I already have it."
readLimit := readLimit max: position.
localDataValid ifTrue: [^ super contentsOfEntireFile].
collection size = 0 ifTrue: [self on: (String new: 2000)].
remoteFile getFileNamed: remoteFile fileName into: self. "sets localDataValid := true"
^ super contentsOfEntireFile!
Item was changed:
+ ----- Method: RemoteFileStream>>dataIsValid (in category 'accessing') -----
- ----- Method: RemoteFileStream>>dataIsValid (in category 'as yet unclassified') -----
dataIsValid
localDataValid := true.!
Item was changed:
+ ----- Method: RemoteFileStream>>directory (in category 'accessing') -----
- ----- Method: RemoteFileStream>>directory (in category 'as yet unclassified') -----
directory
^ remoteFile!
Item was changed:
+ ----- Method: RemoteFileStream>>directoryUrl (in category 'accessing') -----
- ----- Method: RemoteFileStream>>directoryUrl (in category 'as yet unclassified') -----
directoryUrl
^ remoteFile directoryUrl!
Item was changed:
+ ----- Method: RemoteFileStream>>localName (in category 'accessing') -----
- ----- Method: RemoteFileStream>>localName (in category 'as yet unclassified') -----
localName
^ remoteFile fileName!
Item was changed:
+ ----- Method: RemoteFileStream>>openReadOnly (in category 'accessing') -----
- ----- Method: RemoteFileStream>>openReadOnly (in category 'as yet unclassified') -----
openReadOnly
"If we have data, don't reread."
self readOnly.
readLimit := readLimit max: position.
localDataValid ifFalse: [remoteFile getFileNamed: remoteFile fileName into: self].
"sets localDataValid := true"!
Item was changed:
+ ----- Method: RemoteFileStream>>readOnly (in category 'accessing') -----
- ----- Method: RemoteFileStream>>readOnly (in category 'as yet unclassified') -----
readOnly
^ remoteFile readOnly!
Item was changed:
+ ----- Method: RemoteFileStream>>remoteFile (in category 'accessing') -----
- ----- Method: RemoteFileStream>>remoteFile (in category 'as yet unclassified') -----
remoteFile
^ remoteFile!
Item was changed:
+ ----- Method: RemoteFileStream>>remoteFile: (in category 'accessing') -----
- ----- Method: RemoteFileStream>>remoteFile: (in category 'as yet unclassified') -----
remoteFile: aServerFile
remoteFile := aServerFile.
localDataValid := false. "need to read from the server"!
Item was changed:
+ ----- Method: RemoteFileStream>>sleep (in category 'file directory') -----
- ----- Method: RemoteFileStream>>sleep (in category 'as yet unclassified') -----
sleep
"If we are done, then let the server know"
self close.
remoteFile sleep.!
Item was changed:
+ ----- Method: ServerFile>>asStream (in category 'converting') -----
- ----- Method: ServerFile>>asStream (in category 'as yet unclassified') -----
asStream
"Return a RemoteFileStream (subclass of RWBinaryOrTextStream) on the contents of the remote file I represent. For reading only. This method is probably misnamed. Maybe call it makeStream"
^ self readOnlyFileNamed: self fileName!
Item was changed:
+ ----- Method: ServerFile>>directoryUrl (in category 'accessing') -----
- ----- Method: ServerFile>>directoryUrl (in category 'as yet unclassified') -----
directoryUrl
| ru |
"A url to the directory this file is in"
ru := self realUrl.
^ ru copyFrom: 1 to: (ru size - fileName size)!
Item was changed:
+ ----- Method: ServerFile>>exists (in category 'file directory') -----
- ----- Method: ServerFile>>exists (in category 'as yet unclassified') -----
exists
"Return true if the file exists on the server already"
^ self fileExists: fileName!
Item was changed:
+ ----- Method: ServerFile>>fileName (in category 'accessing') -----
- ----- Method: ServerFile>>fileName (in category 'as yet unclassified') -----
fileName
"should this be local or as in a url?"
urlObject ifNotNil: [^ urlObject path last]. "path last encodeForHTTP ?"
^ fileName!
Item was changed:
+ ----- Method: ServerFile>>fileName: (in category 'accessing') -----
- ----- Method: ServerFile>>fileName: (in category 'as yet unclassified') -----
fileName: aString
+ urlObject ~~ nil "type == #file"
+ ifTrue: [urlObject path at: urlObject path size put: aString]
+ ifFalse: [fileName := aString]!
- urlObject ~~ nil "type == #file"
- ifTrue: [urlObject path at: urlObject path size put: aString]
- ifFalse: [fileName := aString]!
Item was changed:
+ ----- Method: ServerFile>>fileNameRelativeTo: (in category 'accessing') -----
- ----- Method: ServerFile>>fileNameRelativeTo: (in category 'as yet unclassified') -----
fileNameRelativeTo: aServerDir
"Produce an absolute fileName from me and an absolute directory"
urlObject isAbsolute ifFalse: [
(aServerDir urlObject ~~ nil and: [aServerDir urlObject isAbsolute])
ifTrue: [urlObject
privateInitializeFromText: urlObject pathString
relativeTo: aServerDir urlObject]
ifFalse: [urlObject default]]. "relative to Squeak directory"
^ urlObject pathForDirectory, self fileName!
Item was changed:
+ ----- Method: ServerFile>>fullPath: (in category 'accessing') -----
- ----- Method: ServerFile>>fullPath: (in category 'as yet unclassified') -----
fullPath: serverAndDirectory
"Parse and save a full path. Separate out fileName at the end."
| delim ii |
super fullPath: serverAndDirectory. "set server and directory"
self isTypeFile ifTrue: [
fileName := ''.
^ self
].
delim := self pathNameDelimiter.
ii := directory findLast: [:c | c = delim].
ii = 0
ifTrue: [self error: 'expecting directory and fileName']
ifFalse: [fileName := directory copyFrom: ii+1 to: directory size.
directory := (directory copyFrom: 1 to: directory size - fileName size - 1)].!
Item was changed:
+ ----- Method: ServerFile>>localName (in category 'file directory') -----
- ----- Method: ServerFile>>localName (in category 'as yet unclassified') -----
localName
^ self fileName!
Item was changed:
+ ----- Method: ServerFile>>readOnly (in category 'file modes') -----
- ----- Method: ServerFile>>readOnly (in category 'as yet unclassified') -----
readOnly
"Set the receiver to be read-only"
rwmode := false!
Item was changed:
+ ----- Method: ServerFile>>readWrite (in category 'file modes') -----
- ----- Method: ServerFile>>readWrite (in category 'as yet unclassified') -----
readWrite
"Set the receiver to be writable"
rwmode := true!
Item was changed:
+ ----- Method: ServerFile>>realUrl (in category 'accessing') -----
- ----- Method: ServerFile>>realUrl (in category 'as yet unclassified') -----
realUrl
"a fully expanded version of the url we represent. Prefix the path with http: or ftp: or file:"
self isTypeFile ifTrue: [
self fileNameRelativeTo: self.
^ urlObject asString
].
^ self typeWithDefault asString, '://', self pathName, '/', fileName "note difference!!"
!
Item was changed:
+ ----- Method: ServerFile>>writable (in category 'file modes') -----
- ----- Method: ServerFile>>writable (in category 'as yet unclassified') -----
writable
^ rwmode!
Item was changed:
+ ----- Method: SuperSwikiServer class>>currentSuperSwiki (in category 'instances') -----
- ----- Method: SuperSwikiServer class>>currentSuperSwiki (in category 'as yet unclassified') -----
currentSuperSwiki
"make this return nil to disable SuperSwiki hack"
^self defaultSuperSwiki
!
Item was changed:
+ ----- Method: SuperSwikiServer class>>defaultEncodingName (in category 'defaults') -----
- ----- Method: SuperSwikiServer class>>defaultEncodingName (in category 'as yet unclassified') -----
defaultEncodingName
Locale current isoLanguage = 'ja' ifTrue: [^'shift_jis' copy] ifFalse: [^'latin1' copy].
!
Item was changed:
+ ----- Method: SuperSwikiServer class>>defaultSuperSwiki (in category 'instances') -----
- ----- Method: SuperSwikiServer class>>defaultSuperSwiki (in category 'as yet unclassified') -----
defaultSuperSwiki
^SuperSwikiServer new
type: #http;
server: self defaultSuperSwikiIPAddress;
directory: '/super/SuperSwikiProj'
!
Item was changed:
+ ----- Method: SuperSwikiServer class>>defaultSuperSwikiIPAddress (in category 'instances') -----
- ----- Method: SuperSwikiServer class>>defaultSuperSwikiIPAddress (in category 'as yet unclassified') -----
defaultSuperSwikiIPAddress
^'209.143.91.36'
!
Item was changed:
+ ----- Method: SuperSwikiServer class>>testOnlySuperSwiki (in category 'tests') -----
- ----- Method: SuperSwikiServer class>>testOnlySuperSwiki (in category 'as yet unclassified') -----
testOnlySuperSwiki
^SuperSwikiServer new
type: #http;
server: self defaultSuperSwikiIPAddress;
directory: '/super/SuperSwikiProj'
!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>directory (in category 'accessing') -----
- ----- Method: SwikiPseudoFileStream>>directory (in category 'as yet unclassified') -----
directory
^directory url!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>directory: (in category 'accessing') -----
- ----- Method: SwikiPseudoFileStream>>directory: (in category 'as yet unclassified') -----
directory: x
directory := x!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>directoryObject (in category 'accessing') -----
- ----- Method: SwikiPseudoFileStream>>directoryObject (in category 'as yet unclassified') -----
directoryObject
^directory!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>directoryUrl (in category 'accessing') -----
- ----- Method: SwikiPseudoFileStream>>directoryUrl (in category 'as yet unclassified') -----
directoryUrl
^directory url!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>directoryUrl: (in category 'accessing') -----
- ----- Method: SwikiPseudoFileStream>>directoryUrl: (in category 'as yet unclassified') -----
directoryUrl: x
directoryUrl := x!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>fileName (in category 'accessing') -----
- ----- Method: SwikiPseudoFileStream>>fileName (in category 'as yet unclassified') -----
fileName
^localName!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>isTypeHTTP (in category 'testing') -----
- ----- Method: SwikiPseudoFileStream>>isTypeHTTP (in category 'as yet unclassified') -----
isTypeHTTP
^true!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>localName (in category 'accessing') -----
- ----- Method: SwikiPseudoFileStream>>localName (in category 'as yet unclassified') -----
localName
^localName!
Item was changed:
+ ----- Method: SwikiPseudoFileStream>>localName: (in category 'accessing') -----
- ----- Method: SwikiPseudoFileStream>>localName: (in category 'as yet unclassified') -----
localName: x
localName := x!