I have added/modified two methods to make the Workspace text persistent. 'accept' writes the text to a Text file, default name is the name of the window. 'cancel' reads a corresponding file.
Now a question before I publish this very small small goodie: I have used '.ws' as file extension. Does that conflict with anything else? If so, what should I use?
Regards --Trygve
P.S. I use persistent workspaces as notebooks/logs so that I remember how to recreate my working image from scratch.
Hi trygve
In 5707 the workspace menu proposes save contents to a file or to append it. I did not not check in 3.6 but I remember that I harvested it so this should not be in 3.6 but is in 3.7alpha
Stef
On 28 févr. 04, at 16:39, Trygve Reenskaug wrote:
I have added/modified two methods to make the Workspace text persistent. 'accept' writes the text to a Text file, default name is the name of the window. 'cancel' reads a corresponding file.
Now a question before I publish this very small small goodie: I have used '.ws' as file extension. Does that conflict with anything else? If so, what should I use?
Regards --Trygve
P.S. I use persistent workspaces as notebooks/logs so that I remember how to recreate my working image from scratch.
--
Trygve Reenskaug mailto: trygver@ifi.uio.no Morgedalsvn. 5A http://heim.ifi.uio.no/~trygver N-0378 Oslo Tel: (+47) 22 49 57 27 Norway
Thanks Stef,
I'm running Squeak3.6-5429. And you are right! There is a 'file it in' command towards the top of the second menu, hidden between 'pretty print with color' and 'tiles from it'. But it seems to take the selected text as a file name and fileIn that file. Not quite what I need..
There is also a command towards the bottom of the same menu: 'save contents to file...'. It writes a file with extension '.text', the file seems to contain the workspace characters, but no emphasis. I like to keep a distinction between Text and String, they are so often confused in the big world out there. I am also surprised that the corresponding 'read contents from file...' is missing. I used the accept and cancel commands, because that simply makes the Workspace persistent.
The Workspace has a three level menu with an extraordinary set of commands. So may be the two commands I need are hidden somewhere, but I haven't found them.
The reason I have used a special extension is that I am used to our OOram FileList that opens a Workspace automagically (We can say 'open' to .st-files, .ws-files and quite a few others and get the proper tool).
So the question remains: Is the '.ws'-extension free?
--Trygve
At 28.02.2004 20:18, you wrote:
Hi trygve
In 5707 the workspace menu proposes save contents to a file or to append it. I did not not check in 3.6 but I remember that I harvested it so this should not be in 3.6 but is in 3.7alpha
Stef
On 28 févr. 04, at 16:39, Trygve Reenskaug wrote:
I have added/modified two methods to make the Workspace text persistent. 'accept' writes the text to a Text file, default name is the name of the window. 'cancel' reads a corresponding file.
Now a question before I publish this very small small goodie: I have used '.ws' as file extension. Does that conflict with anything else? If so, what should I use?
Regards --Trygve
P.S. I use persistent workspaces as notebooks/logs so that I remember how to recreate my working image from scratch.
--
Trygve Reenskaug mailto: trygver@ifi.uio.no Morgedalsvn. 5A http://heim.ifi.uio.no/~trygver N-0378 Oslo Tel: (+47) 22 49 57 27 Norway
Thanks Stef,
I tried Squeak 3.7alpha 5707: 1) The 'save contents to file' asks for file name, does not choose append/save. IMHO 'append' is not meaningful for a workspace.
2) The 'save' command writes the workspace characters, ignores emphasis. The '.text' extension is now used in Squeak to men naked String characters, the standard Windows meaning.
3) I still can't find a corresponding read command.
May be I have overlooked something. It DOES happen - at times. --Trygve
At 28.02.2004 20:18, you wrote:
Hi trygve
In 5707 the workspace menu proposes save contents to a file or to append it. I did not not check in 3.6 but I remember that I harvested it so this should not be in 3.6 but is in 3.7alpha
Stef
On 28 févr. 04, at 16:39, Trygve Reenskaug wrote:
I have added/modified two methods to make the Workspace text persistent. 'accept' writes the text to a Text file, default name is the name of the window. 'cancel' reads a corresponding file.
Now a question before I publish this very small small goodie: I have used '.ws' as file extension. Does that conflict with anything else? If so, what should I use?
Regards --Trygve
P.S. I use persistent workspaces as notebooks/logs so that I remember how to recreate my working image from scratch.
--
Trygve Reenskaug mailto: trygver@ifi.uio.no Morgedalsvn. 5A http://heim.ifi.uio.no/~trygver N-0378 Oslo Tel: (+47) 22 49 57 27 Norway
I tried Squeak 3.7alpha 5707:
- The 'save contents to file' asks for file name, does not choose
append/save. IMHO 'append' is not meaningful for a workspace.
- The 'save' command writes the workspace characters, ignores
emphasis. The '.text' extension is now used in Squeak to men naked String characters, the standard Windows meaning.
- I still can't find a corresponding read command.
I do not know. :)
May be I have overlooked something. It DOES happen - at times.
I do not think so So can you change your enh if necessary and resuubmit it?
stef
Trygve Reenskaug wrote:
I have added/modified two methods to make the Workspace text persistent. 'accept' writes the text to a Text file, default name is the name of the window. 'cancel' reads a corresponding file.
Now a question before I publish this very small small goodie: I have used '.ws' as file extension. Does that conflict with anything else? If so, what should I use?
Regards --Trygve
P.S. I use persistent workspaces as notebooks/logs so that I remember how to recreate my working image from scratch.
Trygve, in the last years, I have always used script classes instead of workspaces, and I believe that has considerable advantages. So instead of writing code into workspaces, I put them as methods in a class (e.g. WolfgangsScripts). I use just one script class with a lot of methods, but you can use more, or use method categories.
I came to use this approach because I believe that these scripts are a valuable part of the source code, which should be shared as well. Also, when I was using Envy for source code management, the scripts always were in sync with the code, which is good. And, I find browing the scripts code more convenient than using the plain text editor. (e.g. browse senders will search your scripts, too)
Greetings, Wolfgang
On Mon, Mar 01, 2004 at 09:36:24AM +0100, Wolfgang Eder wrote:
in the last years, I have always used script classes instead of workspaces, and I believe that has considerable advantages. So instead of writing code into workspaces, I put them as methods in a class (e.g. WolfgangsScripts). I use just one script class with a lot of methods, but you can use more, or use method categories.
I came to use this approach because I believe that these scripts are a valuable part of the source code, which should be shared as well. Also, when I was using Envy for source code management, the scripts always were in sync with the code, which is good. And, I find browing the scripts code more convenient than using the plain text editor. (e.g. browse senders will search your scripts, too)
Good suggestion, thank you.
Dave
I completely agree. I did the same and I never use a workspace because I can edit code anywhere anyway. Even at the end I just invoke Opener install which call all the scripts so I can have multiple installations processes.
Trygve, in the last years, I have always used script classes instead of workspaces, and I believe that has considerable advantages. So instead of writing code into workspaces, I put them as methods in a class (e.g. WolfgangsScripts). I use just one script class with a lot of methods, but you can use more, or use method categories.
I came to use this approach because I believe that these scripts are a valuable part of the source code, which should be shared as well. Also, when I was using Envy for source code management, the scripts always were in sync with the code, which is good. And, I find browing the scripts code more convenient than using the plain text editor. (e.g. browse senders will search your scripts, too)
ducasse ducasse@iam.unibe.ch wrote:
I completely agree. I did the same and I never use a workspace because I can edit code anywhere anyway. Even at the end I just invoke Opener install which call all the scripts so I can have multiple installations processes.
That wouldn't work for me, because my workspace usage involves a lot of workspace variables.
I really would like a workspace that is connected to an instance of some class, where "workspace variables" are the same as instance variables of that class. Or alternatively, a browser that keeps track of a prototype instance of each class, so that I can do workspace-like things in it without losing the data I've computed.
-Lex
Lex Spoon wrote:
ducasse ducasse@iam.unibe.ch wrote:
I completely agree. I did the same and I never use a workspace because I can edit code anywhere anyway. Even at the end I just invoke Opener install which call all the scripts so I can have multiple installations processes.
That wouldn't work for me, because my workspace usage involves a lot of workspace variables.
Lex, could you use class variables instead? Cheers, Wolfgang
I really would like a workspace that is connected to an instance of some class, where "workspace variables" are the same as instance variables of that class. Or alternatively, a browser that keeps track of a prototype instance of each class, so that I can do workspace-like things in it without losing the data I've computed.
-Lex
Lex, My PersistentWorkspace lives as a Text on disk. This makes it easy to move it from one image to another.
A class also lives in disk (in a changes file or something) and can easily be filed into another image.
A workspace variable is like an instance (or class) variable. I guess it would be easy to store its specification on disk. What would be stored would be the name of a slot, not its value.
Values in a Workspace could be saved with e.g., storeOn: and read with readFrom: This _could_ be done i a PersistentWorkspace, but not in a class. Is that what you mean?
--Trygve
At 05.03.2004 10:39, you wrote:
Lex Spoon wrote:
ducasse ducasse@iam.unibe.ch wrote:
I completely agree. I did the same and I never use a workspace because I can edit code anywhere anyway. Even at the end I just invoke Opener install which call all the scripts so I can have multiple installations processes.
That wouldn't work for me, because my workspace usage involves a lot of workspace variables.
Lex, could you use class variables instead? Cheers, Wolfgang
I really would like a workspace that is connected to an instance of some class, where "workspace variables" are the same as instance variables of that class. Or alternatively, a browser that keeps track of a prototype instance of each class, so that I can do workspace-like things in it without losing the data I've computed.
-Lex
I simply want to have variables around at all.
I happen not to use very many images at once, and so I can't honestly comment on what will work will for sharing things among multiple images. I don't know that workspace variables necessarily need to get copied or not copied in PersistentWorkspace. Like you say, people don't expect this for class variables, either.
-Lex
Trygve Reenskaug trygver@ifi.uio.no wrote:
My PersistentWorkspace lives as a Text on disk. This makes it easy to move it from one image to another.
A class also lives in disk (in a changes file or something) and can easily be filed into another image.
A workspace variable is like an instance (or class) variable. I guess it would be easy to store its specification on disk. What would be stored would be the name of a slot, not its value.
Values in a Workspace could be saved with e.g., storeOn: and read with readFrom: This _could_ be done i a PersistentWorkspace, but not in a class. Is that what you mean?
Wolfgang Eder edw@generalmagic.at wrote:
That wouldn't work for me, because my workspace usage involves a lot of workspace variables.
Lex, could you use class variables instead?
Ahhh. Yes, class vars should suffice. Very interesting....
-Lex
Hmm.. Could I replace my cherished workspace with script classes?
I want to be able to reproduce my images from scratch. So I need a reminder of how to do it. A script class can contain executable code and comments. But the class has to be filed out and in separately since I need it before starting building my image proper. My images are always saved with the log workspace open. A simple 'cancel' updates it to the latest accepted version.
I never could make Projects work because I tend to do many things at the same time. When working in VW, I never used 'save as new version', but created a new version by intelligently following the instructions in the workspace log. I relied heavily on our strong ChangeList to create new fileIns from the changes file. It was much expanded with copying and sorting facilities and many new filters. May be the persistent workspace needs an expanded ChangeList to be really useful.
Note that I use the log workspace to organize my own work. Publishing/sharing is quite another matter and the Squeak facilities are much better than anything I have seen before.
Here is an abbreviated version of my first Squeak log workspace to give a taste of what I am talking about:
********************************************************************** Installation of tree06 Start from Squeak 3.6-5429-full ---------------------------------------------- Filein persistent workspace: D:\Mine dokumenter\book-11-is21c\Squeak-05\fileouts\RM-workspace.cs Install new version of SqueakMap 1) open Package Loader - new version installed and opened automatically 2) Install RefactoringBrowser and related tools v. 1.03 3) Connectors v. 1.9 4) Monticello v. 131 ******************************* 2004-02-28 10:52 Saved tree06.1 ******************************* Filein RMSRE-05 D:\Mine dokumenter\book-11-is21c\Squeak-05\fileouts\RM-SRE-05.1.cs ChangeStamp D:\Mine dokumenter\book-11-is21c\Squeak-05\fileouts\ch7.st RefactoringBrowser extension (copy-down the methods of a class) D:\Mine dokumenter\book-11-is21c\Squeak-05\fileouts\ch12.st Trace and other goodies (incl. the above) D:\Mine dokumenter\book-11-is21c\Squeak-05\fileouts\RM-goodies-05.cs ******************************* 2004-03-01 10:52 Saved tree06.2 ******************************* Manually edit Browser in flap to open RefactoringBrowser. Do not file in RM-changes to class Workspace since I now have my own subclass. etc., etc.,
********************************************************************************
cheers --Trygve
At 01.03.2004 09:36, you wrote:
Trygve Reenskaug wrote:
I have added/modified two methods to make the Workspace text persistent. 'accept' writes the text to a Text file, default name is the name of the window. 'cancel' reads a corresponding file. Now a question before I publish this very small small goodie: I have used '.ws' as file extension. Does that conflict with anything else? If so, what should I use? Regards --Trygve P.S. I use persistent workspaces as notebooks/logs so that I remember how to recreate my working image from scratch.
Trygve, in the last years, I have always used script classes instead of workspaces, and I believe that has considerable advantages. So instead of writing code into workspaces, I put them as methods in a class (e.g. WolfgangsScripts). I use just one script class with a lot of methods, but you can use more, or use method categories.
I came to use this approach because I believe that these scripts are a valuable part of the source code, which should be shared as well. Also, when I was using Envy for source code management, the scripts always were in sync with the code, which is good. And, I find browing the scripts code more convenient than using the plain text editor. (e.g. browse senders will search your scripts, too)
Greetings, Wolfgang
Hi
You should really automate that!!!! For my projects I have a one click rebuilding image.
For my stuff before I used sar I got:
| my proj mwpath dir ctx botpath goodiespath | dir := FileDirectory default. ctx := thisContext. [ctx == nil or:[ctx receiver isKindOf: FileStream]] whileFalse:[ctx := ctx sender]. ctx ifNotNil: [dir := ctx receiver directory]. dir isNil ifTrue: [self error: 'cannot locate the files'].
dir := dir pathName, FileDirectory pathNameDelimiter asString. my := 'Stable32Turtle-24', FileDirectory pathNameDelimiter asString. mwpath := 'MW-SD', FileDirectory pathNameDelimiter asString. botpath := 'Bot-1' , FileDirectory pathNameDelimiter asString. goodiespath := 'Goodies' , FileDirectory pathNameDelimiter asString.
"Loading Morphic Wrappers" (FileStream readOnlyFileNamed: dir, mwpath, 'MW-base.7.cs') fileIntoNewChangeSet. (FileStream readOnlyFileNamed: dir, mwpath, 'MW-dragAndDrop.3.cs') fileIntoNewChangeSet. (FileStream readOnlyFileNamed: dir , mwpath, 'MW-explorer.5.cs') fileIntoNewChangeSet. (FileStream readOnlyFileNamed: dir , mwpath, 'MW-extensions.6.cs') fileIntoNewChangeSet. ....
(FileStream readOnlyFileNamed: dir, goodiespath, 'NewLook-dgd.5.cs') fileIntoNewChangeSet. (FileStream readOnlyFileNamed: dir, goodiespath, 'iconMangt.4.cs') fileIntoNewChangeSet. proj := (TurtleAndBotProject newMorphicOn: nil). proj renameTo: 'CaroAndBot'. proj enter.
Now with sar
preamble
| files |
files := #( 'MW-SD/MW-base.7.cs' 'MW-SD/MW-dragAndDrop.3.cs' 'MW-SD/MW-explorer.5.cs' 'MW-SD/MW-extensions.6.cs' ... 'Goodies/BehavioralInspector.8.cs' 'Goodies/ParenBlinking.cs' 'Goodies/ScreenCapture.2.cs' 'Goodies/NewLook-dgd.5.cs' 'Goodies/iconMangt.4.cs').
files do: [ :cs | self fileInMemberNamed: cs ].
Postscript | proj | proj := (TurtleAndBotProject newMorphicOn: nil). proj renameTo: 'CaroAndBot'. proj enter.
squeak-dev@lists.squeakfoundation.org