[squeak-dev] The Trunk: Tools-eem.999.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Tue Oct 13 13:22:48 UTC 2020


Huh? Why should anybody want to turn this off? It should always be possible to evaluate "x := 5" and then use "x" in a Workspace. It would be really cumbersome if one always had to evaluate the entire workspace and also write those || declarations on the top. Please ... :-(

Please elaborate. Why does this feature hinders your working habits? You can always evaluate the entire workspace. This just seems like a preference that would annoy people if not set correctly. Why do you want to prevent "x := 5" evaluation. I don't understand. Why can that be dangerous?

-1 for such a preference. But I could live with it. ;-)


Best,
Marcel
Am 12.10.2020 20:00:28 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.999.mcz

==================== Summary ====================

Name: Tools-eem.999
Author: eem
Time: 12 October 2020, 11:00:17.202907 am
UUID: 53fd9116-3cf5-43db-ad0d-150e7f41efd3
Ancestors: Tools-mt.998

Add a preference for automatic variable declaration in a Workspace (true by default). Many people love this feature; I hate it :-)

=============== Diff against Tools-mt.998 ===============

Item was changed:
StringHolder subclass: #Workspace
instanceVariableNames: 'bindings acceptDroppedMorphs acceptAction mustDeclareVariables shouldStyle environment'
+ classVariableNames: 'DeclareVariablesAutomatically LookupPools ShouldStyle'
- classVariableNames: 'LookupPools ShouldStyle'
poolDictionaries: ''
category: 'Tools-Base'!

!Workspace commentStamp: 'fbs 6/2/2012 20:46' prior: 0!
A Workspace is a text area plus a lot of support for executable code. It is a great place to execute top-level commands to compute something useful, and it is a great place to develop bits of a program before those bits get put into class methods.

To open a new workspace, execute:

Workspace open


A workspace can have its own variables, called "workspace variables", to hold intermediate results. For example, if you type into a workspace "x := 5" and do-it, then later you could type in "y := x * 2" and y would become 10.

Additionally, in Morphic, a workspace can gain access to morphs that are on the screen. If acceptDroppedMorphs is turned on, then whenever a morph is dropped on the workspace, a variable will be created which references that morph. This functionality is toggled with the window-wide menu of a workspace.


The instance variables of this class are:

bindings - holds the workspace variables for this workspace

acceptDroppedMorphs - whether dropped morphs should create new variables!

Item was added:
+ ----- Method: Workspace class>>declareVariablesAutomatically (in category 'preferences') -----
+ declareVariablesAutomatically
+
+ category: 'browsing'
+ description: 'If true, workspaces automatically create variables.'
+ type: #Boolean>
+ ^DeclareVariablesAutomatically ifNil: [true]!

Item was added:
+ ----- Method: Workspace class>>declareVariablesAutomatically: (in category 'preferences') -----
+ declareVariablesAutomatically: aBoolean
+ DeclareVariablesAutomatically := aBoolean!

Item was changed:
----- Method: Workspace>>initialize (in category 'initialize-release') -----
initialize

super initialize.
self initializeBindings.
acceptDroppedMorphs := false.
+ mustDeclareVariables := self class declareVariablesAutomatically not.
+ environment := Environment current!
- mustDeclareVariables := false.
- environment := Environment current.!

Item was changed:
----- Method: Workspace>>mustDeclareVariableWording (in category 'variable declarations') -----
mustDeclareVariableWording

+ ^(mustDeclareVariables
+ ifFalse: [' automatically create variable declaration']
+ ifTrue: [' automatically create variable declaration']) translated!
- ^ mustDeclareVariables not
- ifTrue: [' automatically create variable declaration' translated]
- ifFalse: [' automatically create variable declaration' translated]!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20201013/b84d5bc4/attachment-0001.html>


More information about the Squeak-dev mailing list