Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.263.mcz
==================== Summary ====================
Name: EToys-tfel.263
Author: tfel
Time: 29 September 2016, 4:07:37.715594 pm
UUID: 951255bb-c387-4df7-8044-181017752b52
Ancestors: EToys-tfel.262
- remove two obsolete methods
- forward sendLog to the Debugger
=============== Diff against EToys-tfel.262 ===============
Item was removed:
- ----- Method: FillInTheBlankMorph>>createQueryTextMorph: (in category '*Etoys-Squeakland-initialization') -----
- createQueryTextMorph: queryString
- "create the queryTextMorph"
- | r |
- r := TextMorph new newContents: queryString.
- r setNameTo: 'query' translated.
- r font: Preferences standardMenuFont.
- r releaseParagraphReally.
- r fillStyle: ScriptingSystem baseColor.
- r centered.
- r lock.
- r hResizing: #spaceFill.
- ^ r!
Item was removed:
- ----- Method: FillInTheBlankMorph>>createTextPaneAcceptBoolean: (in category '*Etoys-Squeakland-initialization') -----
- createTextPaneAcceptBoolean: acceptBoolean
- "create the textPane"
- | r |
- r := PluggableTextMorph
- on: self
- text: #response
- accept: #response:
- readSelection: #selectionInterval
- menu: #codePaneMenu:shifted:.
- r hResizing: #spaceFill;
- vResizing: #spaceFill.
- r borderWidth: 1.
- r borderColor: Preferences menuBorderColor.
- r hasUnacceptedEdits: true.
- r acceptOnCR: acceptBoolean.
- r setNameTo: 'textPane'.
- r font: Preferences standardMenuFont.
- r hideScrollBarsIndefinitely.
- r selectionInterval: nil.
- r selectAll.
- ^ r!
Item was added:
+ ----- Method: PreDebugWindow>>sendLog (in category 'as yet unclassified') -----
+ sendLog
+ model storeLog; sendLog.!
Hi Nicolas,
First, thank you for answering me in the other thread.
2016-09-28 23:02 GMT+02:00 Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>:
> Without clear goals or vision, fixing could essentially mean "let
> Environment be transparent", that is let it remain a promise, a potential,
> whithout too many side effects... Not exactly YAGNI, just a bit of
> over-engineered nice piece of code that might serve later. OK this sounds
> like a mandatory first step.
I don't quite get what you mean by transparent, other than fixing it
and enhancing the documentation to shed some light on what it is, why
it is there and how to use it.
> But then, what feature are we after?
> I have read bootstrapping, sandboxing, letting concurrent packages and/or
> versions co-exist, stop prefixing class names with pseudo namespace...
> So environment are about reducing global variable scope.
>
> For me, the essential decisions are in these questions:
> - how will environments and source-code-management interfere?
> - how are we going to specify reproducible artifacts (images)?
>
> Are we going to use environment "statically" like in VW, just like
> namespaces are in many languages? That somehow means that the SCM will have
> to be environment aware.
>
> Or are we going to transfer this responsibility at a higher level, like
> Metacello for example? In this later case, we have greater flexibility, but
> assembling an image means telling which package is installed into which
> environment, then which import are necessary for each environment.
It depends on whether you look at Environments as a developer's tool
(like, e. g., Java packages) or an operator's/administrator's tool
(like, e. g., Docker containers, maybe). In this discrimination
developers can also be operators while they gather the dependencies
for their projects, for example.
Treating them as an operator's tool, I could imagine to create a new
environment for every "Squeak app" you want to deploy in a production
image. Installing that app via Metacello or the Squeak Map could
(optionally?) create such an environment, isolating its dependencies
(and their particular versions) from other apps in that image.
Alternatively, you could install that app or library package into an
existing environment that you must specify then. But I do not consider
myself an operator, so I might be off conventional paths here...
Another thing I have in mind is running a new test case against many
older versions of a package (and its dependencies?) to find out which
version introduced a regression, without changing the "main"
environment each time when another version is checked out. Imagine you
would want to do this with the Kernel or Collections package. I would
want "throwaway" environments for this.
My current naive use case is to hide from a Pharo package that I want
to get going in Squeak the fact that in Pharo some classes have been
renamed. I just want to make the older Squeak classes available under
their changed names, without really renaming the classes themselves
and without doing a big search&replace in the client package. This is
probably bound to fail, because the interface has probably changed as
well, but a generalization of this would be compatibility-, adapter-
or emulation environments.
> But it's even more complex than that, because the way we create classes: by
> subclassing another class. So we don't need one environment, we need at
> least two, one source environment for picking the super class, one
> destination environment for hosting the subclass. Hmm, the metacello
> configuration is going to be verbose...
> OK, OK, but how would we designate an environment in the configuration, is
> it by name in a sort of Environment registry?
Currently, Environments can be retrieved by name, or you have a
reference to an Environment object (and treat it as anonymous). In the
operations mindframe from above, I would not want a Metacello baseline
or whatever to specify its environments. This configuration would only
belong to the particular image you want to build. You could still put
this configuration as a script into another package, of course...
On the other hand, if packages started to abandon class name prefixes,
being "agnostic" to environments in your package might not be feasible
in some cases, when you have to do renames to resolve naming
conflicts.
I look forward to hearing other opinions.
> All this is strongly related to Newspeak mechanisms for contructing a
> module, http://bracha.org/newspeak-modules.pdf. Newspeak was conceived with
> solid foundations. Can we reach a solid design by small iterations? Will we
> converge to the same economy of concepts? I just wonder, or should I say
> wander?
>
> That's very interesting. So who has a vision?
> No urge to asnwer this, let's rather make environment transparent ;)
>
> Nicolas
>
Best regards,
Jakob
Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.262.mcz
==================== Summary ====================
Name: EToys-tfel.262
Author: tfel
Time: 29 September 2016, 2:13:27.526594 pm
UUID: ec1649f4-3c03-415c-89d4-504ffe9be9a1
Ancestors: EToys-tfel.261
remove a transcript show that was triggered often during compilation of kedama scripts
=============== Diff against EToys-tfel.261 ===============
Item was changed:
----- Method: KedamaAttributeEvaluator>>evaluateOccurence: (in category 'private') -----
evaluateOccurence: occurence
"pick the attribute from the occurence at parseNode."
"check the dependency for that occurence."
"if they are not evaluated, recursively call itself with new arguments."
"if all the values are evaluated, #perform: the registered method with these values."
| ret n args realArgs |
n := occurence node.
args := ReadStream on: (occurence dependencies collect: [:oc | oc value]).
realArgs := Array new: 0.
occurence inputSizes do: [:s |
s isCollection ifTrue: [
realArgs := realArgs copyWith: (args next: (s at: 1)).
] ifFalse: [
realArgs := realArgs copyWith: args next.
].
].
(n = parseTree and: [occurence selectedRule selector = #rcvr]) ifTrue: [
ret := receiver
] ifFalse: [
ret := n perform: occurence selectedRule selector withArguments: realArgs.
].
Debug == true ifTrue: [
Transcript show: n printString, ' ', occurence selectedRule selector, ' ', args printString, ' ', realArgs printString, ' ', ret printString; cr.
].
- ret ifNil: [Transcript show: occurence printString; cr].
occurence value: ret.
!
Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.261.mcz
==================== Summary ====================
Name: EToys-tfel.261
Author: tfel
Time: 29 September 2016, 2:00:18.299594 pm
UUID: b41c90b3-754a-452e-add4-3637e2be7a97
Ancestors: EToys-tfel.260
make ScriptableButtons hold on to their own action scripts, rather than their enclosing paste up morph. Otherwise the button action changes when I drop it in a different world!
=============== Diff against EToys-tfel.260 ===============
Item was removed:
- ----- Method: ButtonProperties>>editButtonsScript: (in category 'events') -----
- editButtonsScript: evt
- "The user has touched my Scriptor halo-handle. Bring up a Scriptor on the script of the button."
-
- | cardsPasteUp cardsPlayer anEditor scriptSelector |
-
- cardsPasteUp := self pasteUpMorph.
- (cardsPlayer := cardsPasteUp assuredPlayer) assureUniClass.
- scriptSelector := self figureOutScriptSelector.
- scriptSelector ifNil: [
- scriptSelector := cardsPasteUp scriptSelectorToTriggerFor: self.
- anEditor := cardsPlayer newTextualScriptorFor: scriptSelector.
- evt hand attachMorph: anEditor.
- ^self
- ].
-
- (cardsPlayer class includesSelector: scriptSelector) ifTrue: [
- anEditor := cardsPlayer scriptEditorFor: scriptSelector.
- evt hand attachMorph: anEditor.
- ^self
- ].
- "Method somehow got removed; I guess we start aftresh"
- scriptSelector := nil.
- ^ self editButtonsScript!
Item was removed:
- ----- Method: PasteUpMorph>>scriptSelectorToTriggerFor: (in category '*Etoys-viewing') -----
- scriptSelectorToTriggerFor: aButtonMorph
- "Answer a new selector which will bear the code for aButtonMorph in the receiver"
-
- | buttonName selectorName |
- buttonName := aButtonMorph externalName.
- selectorName := self assuredPlayer acceptableScriptNameFrom: buttonName forScriptCurrentlyNamed: nil.
-
- buttonName ~= selectorName ifTrue:
- [aButtonMorph setNameTo: selectorName].
- ^ selectorName!
Item was changed:
----- Method: ScriptableButton>>doButtonAction (in category 'button') -----
doButtonAction
"The user has pressed the button. Dispatch to the actual user script, if any."
scriptSelector ifNil: [^ super doButtonAction].
+ self player performScriptIfCan: scriptSelector!
- self pasteUpMorph player performScriptIfCan: scriptSelector!
Item was changed:
----- Method: ScriptableButton>>editButtonsScript (in category 'script') -----
editButtonsScript
"The user has touched my Scriptor halo-handle. Bring up a Scriptor on the script of the button."
+ | anEditor player |
+ (player := self assuredPlayer) assureUniClass.
- | cardsPasteUp cardsPlayer anEditor |
- cardsPasteUp := self pasteUpMorph.
- (cardsPlayer := cardsPasteUp assuredPlayer) assureUniClass.
anEditor := scriptSelector ifNil:
+ [scriptSelector := self scriptSelectorToTriggerForMe.
+ player newTextualScriptorFor: scriptSelector.
+ player scriptEditorFor: scriptSelector]
- [scriptSelector := cardsPasteUp scriptSelectorToTriggerFor: self.
- cardsPlayer newTextualScriptorFor: scriptSelector.
- cardsPlayer scriptEditorFor: scriptSelector
- ]
ifNotNil:
+ [(player class selectors includes: scriptSelector)
+ ifTrue: [player scriptEditorFor: scriptSelector]
- [(cardsPlayer class selectors includes: scriptSelector)
- ifTrue: [cardsPlayer scriptEditorFor: scriptSelector]
ifFalse:
["Method somehow got removed; I guess we start afresh"
-
scriptSelector := nil.
+ ^ self editButtonsScript]].
- ^self editButtonsScript]].
anEditor showingMethodPane ifTrue: [anEditor toggleWhetherShowingTiles].
self currentHand attachMorph: anEditor!
Item was added:
+ ----- Method: ScriptableButton>>scriptSelectorToTriggerForMe (in category 'accessing') -----
+ scriptSelectorToTriggerForMe
+ "Answer a new selector which will bear the code for myself"
+
+ | buttonName selectorName |
+ buttonName := self externalName.
+ selectorName := self assuredPlayer acceptableScriptNameFrom: buttonName forScriptCurrentlyNamed: nil.
+
+ buttonName ~= selectorName ifTrue:
+ [self setNameTo: selectorName].
+ ^ selectorName!
Nicolas Cellier uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-nice.64.mcz
==================== Summary ====================
Name: Environments-nice.64
Author: nice
Time: 29 September 2016, 10:41:52.190388 am
UUID: 607ee3c4-cc23-ff46-9f28-edddf2118760
Ancestors: Environments-nice.63
Fix the postscript: it's Smalltalk globals that should be exported...
Note: Environment stack policies without testing if they already exist, so there's a big danger to exportmore than once! There might be undesired side effects (notifying more than once?)
=============== Diff against Environments-nice.63 ===============
Item was changed:
(PackageInfo named: 'Environments') postscript: '"It''s impossible to import a binding if not exported.
There''s nothing secret in Smalltalk (nor private)."
+ Smalltalk globals exportSelf.
- Smalltalk exportSelf.
'!
Nicolas Cellier uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-nice.63.mcz
==================== Summary ====================
Name: Environments-nice.63
Author: nice
Time: 29 September 2016, 10:29:59.273388 am
UUID: 1c6b29fd-c218-034b-8059-2a4e231109d4
Ancestors: Environments-mt.62
Update the class comment of Environment to match current instance variable list.
Update the postscript to export Smalltalk bindings.
=============== Diff against Environments-mt.62 ===============
Item was changed:
Object subclass: #Environment
instanceVariableNames: 'info declarations bindings undeclared policies observers'
classVariableNames: 'Default Instances'
poolDictionaries: ''
category: 'Environments-Core'!
+ !Environment commentStamp: 'nice 9/29/2016 10:27' prior: 0!
- !Environment commentStamp: 'cmm 12/20/2013 14:10' prior: 0!
I am a context for compiling methods. I maintain the namespace of classes and global variables that are visible to the methods compiled within me.
I have the following instance variables:
info <EnvironmentInfo>
Metadata about me and the code I contain.
- imports <Import>
- Rules for importing globals from other environments.
-
- exports <Export>
- Rules for exposing globals to other environments.
-
declarations <IdentityDictionary>
+ Bindings for class and other globals that have been declared inside me.
- Bindings for globals that have been declared inside me.
+ bindings <IdentityDictionary>
+ Bindings for all the class and global variables visible from the compiler.
+ It generally includes the declarations (see importSelf), plus other imports from other environments, including aliases.
- references <IdentityDictionary>
- Bindings for globals that are used by methods compiled inside me.
+ policies <Collection of: NamePolicy>
+ The list of rules for importing and exporting bindings to other environments.
- public <IdentityDictionary>
- Bindings for classes that have been declared inside me, and which satisfy the export rules contain in 'exports'.
+ observers <Collection of: Environment>
+ These are the environments importing some bindings from self, and which should be notified whenever we add/remove/change some binding.
+ !
- undeclared <Dictionary>
- Bindings for globals that are used by methods compiled inside me, but which aren't present in 'references' and couldn't be found via the rules in 'imports'.!
Item was changed:
+ (PackageInfo named: 'Environments') postscript: '"It''s impossible to import a binding if not exported.
+ There''s nothing secret in Smalltalk (nor private)."
+ Smalltalk exportSelf.
- (PackageInfo named: 'Environments') postscript: '"Recompile all methods to fix errant bindings"
- Compiler recompileAll.
'!
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.798.mcz
==================== Summary ====================
Name: Kernel-nice.798
Author: nice
Time: 30 July 2013, 10:34:15.34 pm
UUID: e02ae597-3f6d-40b9-9468-bf01416db6de
Ancestors: Kernel-nice.797
Better fix for http://bugs.squeak.org/view.php?id=1554
A class variable defined in a superclass should take precedence over a global variable.
First look in local class variables.
Then look in local sharedPools (a local sharedPool will shadow a super class variable, that sounds fair).
Then look in superclass pools.
When superclass chain is exhausted, look in the Environment that were provided as parameter.
Note that this is mostly squeak 1.x implementation of #scopeHas:ifTrue: (or st-80), except that anEvironment parameter replaces Smalltalk.
This way we avoid duplicate lookup of previous workaround.
And we never ever look in superclass environment, that's not necessarily ours.
This currently breaks some EnvironmentTest because inheriting superclass environment is a cheap and easy way to import all Smalltalk (unless you are not an Object or ProtoObject of course).
The longest and proper way would be to properly export some symbols from Smalltalk globals, and import them explicitely in the tested environment.
=============== Diff against Kernel-nice.797 ===============
Item was changed:
----- Method: Class>>bindingOf:environment: (in category 'compiling') -----
bindingOf: varName environment: anEnvironment
"Answer the binding of some variable resolved in the scope of the receiver"
| aSymbol binding |
aSymbol := varName asSymbol.
+ "First look in local classVar dictionary."
+ binding := self classPool bindingOf: aSymbol.
+ binding ifNotNil:[^binding].
- "First look in classVar dictionary."
- (self classThatDefinesClassVariable: aSymbol) ifNotNil:
- [:x | ^x classPool bindingOf: aSymbol].
+ "Next look in local shared pools."
- "Next look in shared pools."
self sharedPools do:[:pool |
binding := pool bindingOf: aSymbol.
binding ifNotNil:[^binding].
].
+ "Next look into superclass pools"
+ superclass ifNotNil: [^ superclass bindingOf: aSymbol environment: anEnvironment].
+
+ "No more superclass... Last look in declared environment."
+ ^anEnvironment bindingOf: aSymbol
- "Next look in declared environment."
- binding := anEnvironment bindingOf: aSymbol.
- binding ifNotNil:[^binding].
- "Finally look higher up the superclass chain and fail at the end."
- superclass == nil
- ifTrue: [^ nil]
- ifFalse: [^ superclass bindingOf: aSymbol].
-
!
Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.259.mcz
==================== Summary ====================
Name: EToys-tfel.259
Author: tfel
Time: 29 September 2016, 10:11:59.109594 am
UUID: 2f475582-bfa8-48fa-a9eb-362252d134ef
Ancestors: EToys-tfel.258
Another fix for copying Kedama, KedamaPatches need to reference the copy of their world, too, if that was copied.
=============== Diff against EToys-tfel.258 ===============
Item was added:
+ ----- Method: KedamaPatchMorph>>veryDeepFixupWith: (in category 'copying') -----
+ veryDeepFixupWith: deepCopier
+
+ super veryDeepFixupWith: deepCopier.
+ kedamaWorld := deepCopier references at: kedamaWorld ifAbsent: [kedamaWorld].!
Item was changed:
+ ----- Method: KedamaPatchMorph>>veryDeepInner: (in category 'copying') -----
- ----- Method: KedamaPatchMorph>>veryDeepInner: (in category 'as yet unclassified') -----
veryDeepInner: deepCopier
"the state of a Kedama patch is held in its forms, so we need to "
form := form deepCopy.
displayForm := displayForm deepCopy.
tmpForm := tmpForm deepCopy.
super veryDeepInner: deepCopier.!