Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.1411.mcz
==================== Summary ====================
Name: Morphic-nice.1411
Author: nice
Time: 6 April 2018, 12:18:50.18955 pm
UUID: b1fb10c7-ba0f-7f41-a17f-1cdfd5e60e85
Ancestors: Morphic-mt.1410
Fix http://bugs.squeak.org/view.php?id=7863 can't undo paste initials
=============== Diff against Morphic-mt.1410 ===============
Item was changed:
----- Method: TextEditor>>pasteInitials: (in category 'editing keys') -----
pasteInitials: aKeyboardEvent
"Replace the current text selection by an authorship name/date stamp; invoked by cmd-shift-v, easy way to put an authorship stamp in the comments of an editor."
self insertAndCloseTypeIn.
+ self openTypeIn.
self replace: self selectionInterval with: (Text fromString: Utilities changeStamp) and: [self selectAt: self stopIndex].
+ self closeTypeIn.
^ true!
Just because I could, here are the tinyBenchmark results for a new Pi 3B+ running a recent squeak.cog.spur vm
Tiny Benchmarks
---------------
330,000,000 bytecodes/sec; 19,000,000 sends/sec
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Any nitwit can understand computers. Many do.
Hello
The following questions have been raised yesterday concerning the
description of MorphicModel [1], page 2338.
MorphicModel is an important class, it has many subclasses,
potentially many thousands [2].
Page 2338 reads more like an outline and needs to be improved by
adding more text, illustrations and answering questions
1. "A morphicModel is usually the root of a morphic tree depicting its
appearance. "
--> give an example with code and a screen shot
2. "A MorphicModel is used to represent structures with state and
behavior as well as graphical structure"
--> illustrate this by means of the example given under 1.
3. "An object (morph, widget) will not respond to an event unless it
has been sensitized to that event."
--> What does 'sensitized' mean here?
4. Is a structure, in the context of a MorphicModel, an instance of
the class to which one or more submorphs have been added and
(optionally) sensitized?
5. Are constituent morphs added to a world (World?) or and instance of
MorphModel or perhaps as an instance of PastUpMorph?
6. When should I , as a developer of some application, consider to use
a MorphicModel over "plain" Morphs.
7. All the pluggable stuff made with MorphicToolBuilder are
MorphicModels, but what is the the added value MorphicModel supplies
here?
8. What is the function of the menu items revolving around prototypes
(something like 'Be the prototype for this model')?
Answers, partial ones as well are welcome!
Regards
Hannes
-----------------------------------
[1] MorphicModel http://wiki.squeak.org/squeak/2338
[2] MorphicModel subclasses http://wiki.squeak.org/squeak/2549
Note: I have images with thousands of MorphicModel subclasses.
These subclasses are linked to instances of PasteUpMorph.
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.1409.mcz
==================== Summary ====================
Name: Morphic-cmm.1409
Author: cmm
Time: 4 April 2018, 2:30:02.510117 pm
UUID: 6d625668-7bfe-4baa-8c15-ea49525a34dd
Ancestors: Morphic-cmm.1408
Slightly better fix (thanks Tim) which uses the World passed-in to the sender rather than the global World.
=============== Diff against Morphic-cmm.1408 ===============
Item was removed:
- ----- Method: SystemWindow>>anyOpenWindowLikeMe (in category 'open/close') -----
- anyOpenWindowLikeMe
-
- self class reuseWindows ifFalse: [ ^Array empty ].
- ^ SystemWindow
- windowsIn: World
- satisfying:
- [ : each |
- each model class = self model class
- and: [ (each model respondsTo: #representsSameBrowseeAs:)
- and: [ each model representsSameBrowseeAs: self model ] ] ]
- !
Item was added:
+ ----- Method: SystemWindow>>anyOpenWindowLikeMeIn: (in category 'open/close') -----
+ anyOpenWindowLikeMeIn: aPasteUpMorph
+ self class reuseWindows ifFalse: [ ^Array empty ].
+ ^ SystemWindow
+ windowsIn: aPasteUpMorph
+ satisfying:
+ [ : each |
+ each model class = self model class
+ and: [ (each model respondsTo: #representsSameBrowseeAs:)
+ and: [ each model representsSameBrowseeAs: self model ] ] ]
+ !
Item was changed:
----- Method: SystemWindow>>openInWorld: (in category 'open/close') -----
openInWorld: aWorld
"This msg and its callees result in the window being activeOnlyOnTop"
+ ^ (self anyOpenWindowLikeMeIn: aWorld)
- ^ self anyOpenWindowLikeMe
ifEmpty:
[ self
bounds: (RealEstateAgent initialFrameFor: self world: aWorld) ;
openAsIsIn: aWorld ]
ifNotEmptyDo:
[ : windows |
windows anyOne
expand ;
beKeyWindow ;
postAcceptBrowseFor: self ].!
Item was changed:
----- Method: SystemWindow>>openInWorld:extent: (in category 'open/close') -----
openInWorld: aWorld extent: extent
"This msg and its callees result in the window being activeOnlyOnTop"
+ ^ (self anyOpenWindowLikeMeIn: aWorld)
- ^ self anyOpenWindowLikeMe
ifEmpty:
[ self
position: (RealEstateAgent initialFrameFor: self initialExtent: extent world: aWorld) topLeft ;
extent: extent.
self openAsIsIn: aWorld ]
ifNotEmptyDo:
[ : windows |
windows anyOne
expand ;
beKeyWindow ;
postAcceptBrowseFor: self ].!
Marcel Taeumel uploaded a new version of 60Deprecated to project The Trunk:
http://source.squeak.org/trunk/60Deprecated-mt.14.mcz
==================== Summary ====================
Name: 60Deprecated-mt.14
Author: mt
Time: 5 April 2018, 10:31:02.988307 am
UUID: d86c101d-94ec-4a42-add5-f8934e606243
Ancestors: 60Deprecated-mt.13
No need for #exploreAndYourself anymore.
=============== Diff against 60Deprecated-mt.13 ===============
Item was added:
+ ----- Method: Object>>exploreAndYourself (in category '*60Deprecated-Tools') -----
+ exploreAndYourself
+
+ self deprecated: 'Use #explore because it does not return the tool window anymore. Only calls via ToolSet do so.'.
+ self explore!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.804.mcz
==================== Summary ====================
Name: Tools-mt.804
Author: mt
Time: 5 April 2018, 10:29:51.105307 am
UUID: 7490573c-8cd9-0d46-afe3-bea1c791066d
Ancestors: Tools-mt.803
Consistently return the domain object in question for any inspect/explore/browse call to it.
Background: We did change the semantics of #inspect for the Squeak 5.1 release to harmonize #explore. After several ongoing discussions with Chris (cmm), we found a more usefull consent. That is, call ToolSet directly if you want to gain access to the created tool window(s). Call the object directly to get the object back. Now you can sprinkle #inspect, #explore, #browse etc. in your code during exploratory debugging sessions again.
Let's hope this works for everybody. See the deprecated #exploreAndYourself to better understand what is not required anymore.
=============== Diff against Tools-mt.803 ===============
Item was changed:
----- Method: Inspector>>exploreObject (in category 'toolbuilder') -----
exploreObject
"Switch to an explorer tool."
| window currentBounds |
currentBounds := ToolBuilder findDefault getBoundsForWindow: self containingWindow.
"Close first because MVC fiddles around with processes."
self changed: #close.
+ window := ToolSet explore: self object.
- window := self object explore.
"---- In MVC, the lines after this will not be executed ---"
window model setExpression: self expression.
ToolBuilder findDefault setBoundsForWindow: window to: currentBounds.!
Item was changed:
----- Method: Object>>basicInspect (in category '*Tools-inspecting') -----
basicInspect
"Create and schedule an Inspector in which the user can examine the
receiver's variables. This method should not be overriden."
+ ToolSet basicInspect: self!
- ^ToolSet basicInspect: self!
Item was changed:
----- Method: Object>>browse (in category '*Tools-Browsing') -----
browse
+ ToolSet browseClass: self class!
- ^ToolSet browseClass: self class!
Item was changed:
----- Method: Object>>explore (in category '*Tools-Explorer') -----
explore
+ ToolSet explore: self!
- ^ToolSet explore: self!
Item was removed:
- ----- Method: Object>>exploreAndYourself (in category '*Tools-Explorer') -----
- exploreAndYourself
- "i.e. explore; yourself. Thisway i can peek w/o typing all the parentheses"
- self explore.
- ^self!
Item was changed:
----- Method: Object>>explorePointers (in category '*Tools-Debugger') -----
explorePointers
+ PointerExplorer openOn: self!
- PointerExplorer openOn: self.!
Item was changed:
----- Method: Object>>exploreWithLabel: (in category '*Tools-Explorer') -----
exploreWithLabel: label
+ ToolSet explore: self label: label!
-
- ^ ObjectExplorer openOn: self withLabel: label!
Item was changed:
----- Method: Object>>inspect (in category '*Tools-inspecting') -----
inspect
"Create and schedule an Inspector in which the user can examine the receiver's variables."
+ ToolSet inspect: self!
- ^ ToolSet inspect: self!
Item was changed:
----- Method: Object>>inspectWithLabel: (in category '*Tools-inspecting') -----
inspectWithLabel: aLabel
"Create and schedule an Inspector in which the user can examine the receiver's variables."
+ ToolSet inspect: self label: aLabel!
- ^ToolSet inspect: self label: aLabel!
Item was changed:
----- Method: ObjectExplorer>>inspectObject (in category 'toolbuilder') -----
inspectObject
"Switch to an inspector tool."
| window currentBounds |
currentBounds := ToolBuilder findDefault getBoundsForWindow: self containingWindow.
"Close first because MVC fiddles around with processes."
self changed: #close.
+ window := ToolSet inspect: self rootObject.
- window := self rootObject inspect.
"---- In MVC, the lines after this will not be executed ---"
window model setExpression: self expression.
ToolBuilder findDefault setBoundsForWindow: window to: currentBounds.!
Item was added:
+ ----- Method: StandardToolSet class>>explore:label: (in category 'inspecting') -----
+ explore: anObject label: label
+
+ ^ ObjectExplorer openOn: anObject withLabel: label!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1014.mcz
==================== Summary ====================
Name: System-mt.1014
Author: mt
Time: 5 April 2018, 10:22:30.974307 am
UUID: 8650d884-c761-f240-a1c7-5f04eb83a0a9
Ancestors: System-mt.1013
Adds #explore:label: to tool set to mirror #inspect:label: and hence make this Inspector/Explorer dualism more consistent.
=============== Diff against System-mt.1013 ===============
Item was added:
+ ----- Method: ToolSet class>>explore:label: (in category 'inspecting') -----
+ explore: anObject label: aString
+ "Open an explorer on the given object."
+ self default ifNil:[^self inform: 'Cannot explore - no ToolSet present'].
+ ^self default explore: anObject label: aString!
Marcel Taeumel uploaded a new version of 60Deprecated to project The Trunk:
http://source.squeak.org/trunk/60Deprecated-mt.13.mcz
==================== Summary ====================
Name: 60Deprecated-mt.13
Author: mt
Time: 5 April 2018, 9:57:04.971457 am
UUID: 29391520-9b58-8e4d-9fa1-d3a4f896668f
Ancestors: 60Deprecated-mt.12
Adds deprecation for window re-use.
=============== Diff against 60Deprecated-mt.12 ===============
Item was added:
+ ----- Method: SystemWindow>>anyOpenWindowLikeMe (in category '*60Deprecated-open/close') -----
+ anyOpenWindowLikeMe
+
+ self deprecated: 'Use #anyOpenWindowLikeMe: passing a concrete world object.'.
+ ^ self anyOpenWindowLikeMeIn: Project current world!
Hi Denis, Hi Sven,
> On Apr 4, 2018, at 3:16 AM, Denis Kudriashov <dionisiydk(a)gmail.com> wrote:
>
> Hi.
>
> #next returning nil is definitely looks bad because we will always have case when nil value will not means the end:
>
> #(1 nil 2) readSteam next; next; atEnd
>
> But I understand that in many cases analysing #next for nil is much more suitable than #atEnd. I am sure that it can be always avoided but it can be not easy to do.
> Alternatively we can reify real EndOfStream object which will be used as result of reading operation when stream is at end.
> It can provide nice API like #ifEndOfStream:. which will reflect intention in much cleaner way than ifNil: checks.
There is a much better scheme which is to allow streams to have an end-of-file element in an inst var, "endOfStream". It is initialised with the stream itself (nil cannot be used as we want it as a value). If the end of the stream is reached and endOfStream == self an EndIfStream exception is raised. Otherwise the value of endOfStream is answered. We can't answer nil because in some applications (streams of objects) nil is a valid element to read from the steam and we need to manufacture a unique sentinel.
We made this change in VisualWorks and it works well. One can avoid using atEnd and lion for the sentinel instead, which is much cleaner and faster and less problematic than atEnd.
>
>
> 2018-04-04 12:00 GMT+02:00 Sven Van Caekenberghe <sven(a)stfx.eu>:
>>
>>
>> > On 4 Apr 2018, at 11:38, Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com> wrote:
>> >
>> > Hi Sven,
>> > See also discussion at https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/232
>>
>> Thanks Nicolas, I had already seen parts of it.
>>
>> Now, I still want image level changes to be based on clear semantic definitions of the abstract stream API, we're not just talking about file or unix streams, the general Smalltalk concept.
>>
>> For reading, they are IMHO,
>>
>> #next
>> #readInto:startingAt:count:
>> #peek
>> #atEnd
>> #upToEnd (can be derived but still the semantics are important in relation to #atEnd)
>>
>> For writing, we have
>>
>> #nextPut:
>> #next:putAll:startingAt:
>> #flush
>>
>> For both, we have
>>
>> #atEnd
>> #close
>> #closed (new)
>>
>> So, I know, #next returning nil exists, but is it universally/officially defined as such ? Where is that documented ?
>>
>> Positioning, sizing are not universal, IMHO, but should be clearly defined as well.
>>
>> > 2018-04-04 11:32 GMT+02:00 Sven Van Caekenberghe <sven(a)stfx.eu>:
>> > Somehow, somewhere there was a change to the implementation of the primitive called by some streams' #atEnd.
>> >
>> > IIRC, someone said it is implemented as 'remaining size being zero' and some virtual unix files like /dev/random are zero sized.
>> >
>> > Now, all kinds of changes are being done image size to work around this.
>> >
>> > I am a strong believer in simple, real (i.e. infinite) streams, but I am not sure we are doing the right thing here.
>> >
>> > Point is, I am not sure #next returning nil is official and universal.
>> >
>> > Consider the comments:
>> >
>> > Stream>>#next
>> > "Answer the next object accessible by the receiver."
>> >
>> > ReadStream>>#next
>> > "Primitive. Answer the next object in the Stream represented by the
>> > receiver. Fail if the collection of this stream is not an Array or a String.
>> > Fail if the stream is positioned at its end, or if the position is out of
>> > bounds in the collection. Optional. See Object documentation
>> > whatIsAPrimitive."
>> >
>> > Note how there is no talk about returning nil !
>> >
>> > I think we should discuss about this first.
>> >
>> > Was the low level change really correct and the right thing to do ?
>> >
>> > Note also that a Guille introduced something new, #closed which is related to the difference between having no more elements (maybe right now, like an open network stream) and never ever being able to produce more data.
>> >
>> > Sven
>> >
>> >
>> >
>> >
>>
>>
>