I want to be able to read a text file and have it programmatically perform substitution on some of the text.
The requirement is for something akin to "smalltalk server pages" although this isn't for a web app.
I just want to be able to read a file containing the text "Hello, <%name%>. Welcome to my world." and have it return as a string "Hello, Joe. Welcome to my world."
Is this functionality available in squeak somewhere, perhaps as part of a web server framework?
thanks.
You'll have to dig a bit, but some years ago an SSP implementation by (IIRC) Stephen Pair did just that. I think it was simple and flexible enough to be used not just for webpages..
On 11/29/05, Larry White ljw1001@gmail.com wrote:
I want to be able to read a text file and have it programmatically perform substitution on some of the text.
The requirement is for something akin to "smalltalk server pages" although this isn't for a web app.
I just want to be able to read a file containing the text "Hello, <%name%>. Welcome to my world." and have it return as a string "Hello, Joe. Welcome to my world."
Is this functionality available in squeak somewhere, perhaps as part of a web server framework?
thanks.
I've found references to SSP (Squeak Server Pages) in the sqeak map - the latest is for version 3.2 and the links are broken. Are there any alternate repositories for squeak archieves? Any other ideas on where I might get this code?
On 11/29/05, Cees De Groot cdegroot@gmail.com wrote:
You'll have to dig a bit, but some years ago an SSP implementation by (IIRC) Stephen Pair did just that. I think it was simple and flexible enough to be used not just for webpages..
On 11/29/05, Larry White ljw1001@gmail.com wrote:
I want to be able to read a text file and have it programmatically
perform
substitution on some of the text.
The requirement is for something akin to "smalltalk server pages"
although
this isn't for a web app.
I just want to be able to read a file containing the text "Hello,
<%name%>.
Welcome to my world." and have it return as a string "Hello, Joe. Welcome to my world."
Is this functionality available in squeak somewhere, perhaps as part of
a
web server framework?
thanks.
2005/11/29, Larry White ljw1001@gmail.com:
I've found references to SSP (Squeak Server Pages) in the sqeak map - the latest is for version 3.2 and the links are broken. Are there any alternate repositories for squeak archieves? Any other ideas on where I might get this code?
self-advertisment: http://kilana.unibe.ch:8888/evaluablestrings/ does something very similiar, it should be easy to change so that it works with <% %> instead of { }. It has public write access.
The site you refer to isn't responding.
On 11/29/05, Philippe Marschall philippe.marschall@gmail.com wrote:
2005/11/29, Larry White ljw1001@gmail.com:
I've found references to SSP (Squeak Server Pages) in the sqeak map -
the
latest is for version 3.2 and the links are broken. Are there any
alternate
repositories for squeak archieves? Any other ideas on where I might get this code?
self-advertisment: http://kilana.unibe.ch:8888/evaluablestrings/ does something very similiar, it should be easy to change so that it works with <% %> instead of { }. It has public write access.
2005/11/29, Larry White ljw1001@gmail.com:
The site you refer to isn't responding.
http://kilana.unibe.ch:8888/evaluablestrings/ it really works for me
not for me, alas. I'll try later when i'm not behind a firewall - though i've never had problems with http before.
On 11/29/05, Philippe Marschall philippe.marschall@gmail.com wrote:
2005/11/29, Larry White ljw1001@gmail.com:
The site you refer to isn't responding.
http://kilana.unibe.ch:8888/evaluablestrings/ it really works for me
2005/11/29, Larry White ljw1001@gmail.com:
not for me, alas. I'll try later when i'm not behind a firewall - though i've never had problems with http before.
If http://squeaksource.com/evaluablestrings/ works, then it's the "firewall"
got that. but there seems to be only test code in the files. unless the implementation is in binary form only and i can't figure out how to load it.
On 11/29/05, Philippe Marschall philippe.marschall@gmail.com wrote:
2005/11/29, Larry White ljw1001@gmail.com:
not for me, alas. I'll try later when i'm not behind a firewall -
though
i've never had problems with http before.
If http://squeaksource.com/evaluablestrings/ works, then it's the "firewall"
2005/11/29, Larry White ljw1001@gmail.com:
got that. but there seems to be only test code in the files.
No, there are two class extensions and a TestClass and. That's enough, well Smalltalk makes such things easy.
unless the implementation is in binary form only and i can't figure out how to load it.
Monticello
Thanks for your help but, No. Smalltalk does not make such things easy. It's almost like someone is taking a perverse pleasure in making such things hard. Here are some of the most obvious problems with loading code:
1. I should be able to load the file from the "File List" browser. This is a close as Squeak comes to a file menu, which is a universally accepted approach to loading files into desktop software. And if I highlight a file and the Load button appears, then it should actually load when I click it. If it only loads some of the file, I should get an error or warning message. (Fortunately, I've used Squeak before, so I can actually find the file-list dialog.) I highlighted the mcz files, and it indicated that they loaded.
2. There shouldn't be 3 or more ways to do the same thing: I count file-in, install, monticello, and package loader. For all I know, there may be more. Ironically, this is the same problem OO is supposed to solve - hiding implementation differences behind a simple, consistent interface. I don't need 5 different buttons/dialogs to load different file formats into Excel.
3. A tool for loading code shouldn't be called Monticello, it should be called, I dunno, maybe, code-loader or something equally descriptive. A browser for a virtual tour of Thomas Jefferson's house should be called Monticello.
4. The instructions for using monticello shouldn't refer to mouse buttons as red and yellow. Yes, I know it's a Smalltalk tradition dating back from the days when the community actually cared about usability. My mouse buttons are both black. Give me a break. (This is where it starts to feel like poor usability has crossed over into sadism.)
5. It can't be usable if it doesn't work. I downloaded the files to a directory, opened monitcello, browsed to that "repository" highlighted the files and clicked "load". Same as before-says it's loading, but no new classes/methods appear in the system. Hmmm, maybe I should have clicked Merge. I click Merge. It says it's reloading and hangs. Maybe the firewall is blocking. Monticello must use HTTP tunneling, right, so the user doesn't have to deal with networking stuff?
And then, inevitably, somebody from the mailing list shakes their head and tells you it's easy to use.
On 11/29/05, Philippe Marschall philippe.marschall@gmail.com wrote:
2005/11/29, Larry White ljw1001@gmail.com:
got that. but there seems to be only test code in the files.
No, there are two class extensions and a TestClass and. That's enough, well Smalltalk makes such things easy.
unless the implementation is in binary form only and i can't figure out how to load
it. Monticello
On 29-Nov-05, at 11:59 AM, Larry White wrote:
- I should be able to load the file from the "File List" browser.
This is a close as Squeak comes to a file menu, which is a universally accepted approach to loading files into desktop software.
Leaving aside the other issues and admittedly off topic somewhat, I have to point out that this is an incorrect assertion. The concept of a 'file menu' is far from universal, and far from a good UI idea.
Consider RISC OS where there is no such idea. Files are loaded by dragging them from some other application. One such application is the filer window but it works equally well if it is another app that edits the same type of file. There is no idiotic 'mini-finder' used, just the main finder or other app. Completely pervasive drag and drop works a lot better. It provides a UI level loose equivalent of pipes; you can start by drawing something in the art app, drag it out to the convert-art-to-bitmap app, drag from that to the convert-bitmap-to- jpeg app and then drag that to the ftp app to save it to the website.
Yes, it's very different to the boring 'standard' of Windows and Mac. It is a good demonstraton that 'file menu' is not a universally accepted approach.
tim
i meant universal in terms of percent of users familiar with it, not percent of operating systems implementing. Also, i'm not suggesting it's an inherently good design, just that it's widely understood, like stopping at red lights and going on green.
also, if my criticism was overly harsh, let me paraphrase Alan Kay and say that Smalltalk is the only language worth criticizing. if it weren't so close to being a joy to work with, it wouldn't be so frustrating when it lets you down.
On 11/29/05, tim Rowledge tim@rowledge.org wrote:
On 29-Nov-05, at 11:59 AM, Larry White wrote:
- I should be able to load the file from the "File List" browser.
This is a close as Squeak comes to a file menu, which is a universally accepted approach to loading files into desktop software.
Leaving aside the other issues and admittedly off topic somewhat, I have to point out that this is an incorrect assertion. The concept of a 'file menu' is far from universal, and far from a good UI idea.
Consider RISC OS where there is no such idea. Files are loaded by dragging them from some other application. One such application is the filer window but it works equally well if it is another app that edits the same type of file. There is no idiotic 'mini-finder' used, just the main finder or other app. Completely pervasive drag and drop works a lot better. It provides a UI level loose equivalent of pipes; you can start by drawing something in the art app, drag it out to the convert-art-to-bitmap app, drag from that to the convert-bitmap-to- jpeg app and then drag that to the ftp app to save it to the website.
Yes, it's very different to the boring 'standard' of Windows and Mac. It is a good demonstraton that 'file menu' is not a universally accepted approach.
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim
On 11/29/05, Larry White ljw1001@gmail.com wrote:
Thanks for your help but, No. Smalltalk does not make such things easy.
If anything doesn't make anything not easy here, it's Squeak. There's a lot to improve in the UI (still, there's also a lot better than 'regular' UIs, but sadly enough it takes a bit of time to get that... - the learning curve should be a lot gentler)
[...] Same as before-says it's loading, but no new classes/methods appear in the system.
Are you sure? You can "Browse" MC files from the MC user interface, it shows exactly what it is supposed to add/change/override.
You're right -it did load. The package simply modifies the String class itself and adds a test class to go with it. I was expecting a subclass or something. I guess i've been too long in environments where changing key classes just isn't done.
i find squeak to be mostly friendly - once you load the software you need.
On 11/29/05, Cees De Groot cdegroot@gmail.com wrote:
On 11/29/05, Larry White ljw1001@gmail.com wrote:
Thanks for your help but, No. Smalltalk does not make such things easy.
If anything doesn't make anything not easy here, it's Squeak. There's a lot to improve in the UI (still, there's also a lot better than 'regular' UIs, but sadly enough it takes a bit of time to get that...
- the learning curve should be a lot gentler)
[...] Same as before-says it's loading, but no new classes/methods appear in the system.
Are you sure? You can "Browse" MC files from the MC user interface, it shows exactly what it is supposed to add/change/override.
i think it would if i knew what i was doing. Like you I was familiar with the same concept in Ruby and thought it would be a great thing to have in smalltalk. i guess my smalltalk skills aren't up to the task any more.
On 11/29/05, Larry White ljw1001@gmail.com wrote:
You're right -it did load. The package simply modifies the String class itself and adds a test class to go with it. I was expecting a subclass or something. I guess i've been too long in environments where changing key classes just isn't done.
i find squeak to be mostly friendly - once you load the software you need.
On 11/29/05, Cees De Groot <cdegroot@gmail.com > wrote:
On 11/29/05, Larry White <ljw1001@gmail.com > wrote:
Thanks for your help but, No. Smalltalk does not make such things
easy.
If anything doesn't make anything not easy here, it's Squeak. There's a lot to improve in the UI (still, there's also a lot better than 'regular' UIs, but sadly enough it takes a bit of time to get that...
- the learning curve should be a lot gentler)
[...] Same as before-says it's loading, but no new classes/methods appear in the system.
Are you sure? You can "Browse" MC files from the MC user interface, it shows exactly what it is supposed to add/change/override.
2005/11/29, Larry White ljw1001@gmail.com:
Thanks for your help but, No. Smalltalk does not make such things easy. It's almost like someone is taking a perverse pleasure in making such things hard. Here are some of the most obvious problems with loading code:
I was talking about the implementation. Since this is the squeak-dev mailinglist I thought you knew about Monticello because all the squeak devs I know, know Monticello. I'm sorry it's a mistake on my side, the code does not do what you need.
Hi!
Larry White ljw1001@gmail.com wrote:
Thanks for your help but, No. Smalltalk does not make such things easy. It'= s almost like someone is taking a perverse pleasure in making such things hard. Here are some of the most obvious problems with loading code:
Hehe. :)
- I should be able to load the file from the "File List" browser. This is
a close as Squeak comes to a file menu, which is a universally accepted approach to loading files into desktop software. And if I highlight a file and the Load button appears, then it should actually load when I click it. If it only loads some of the file, I should get an error or warning message= . (Fortunately, I've used Squeak before, so I can actually find the file-list dialog.) I highlighted the mcz files, and it indicated that they loaded.
In some ways Squeak can be viewed more as an OS than a single app. So given a full OS there are many ways to open/load files. :) But sure, things can be more streamlined, and there are people working in those directions.
- There shouldn't be 3 or more ways to do the same thing: I count file-in,
install, monticello, and package loader. For all I know, there may be more. Ironically, this is the same problem OO is supposed to solve - hiding implementation differences behind a simple, consistent interface. I don't need 5 different buttons/dialogs to load different file formats into Excel.
Well... a few comments explaining the "whys" (but not necessarily defending it):
- "file in" is historical. It only works for .cs and .st (I think), which is plain source.
- "install" is slightly different - it actually creates a new changeset first before filing in. It should probably be called "file into new changeset". I am writing from memory here, so I may be wrong.
- Monticello is a tool that has plenty more operations than just "loading". The Filelist today has a service registry etc, so things are actually streamlined a bit. But a "generic" load button would be nice perhaps.
- The package loader doesn't even have a mechanism to open a file from disk. :) It downloads from the net etc. And yes, it handles a multitude of formats under a single "install" menu option. Exactly what you want. :)
So the thing to note is that you can't really compare with "different file formats" - we are in fact talking about "different operations".
- A tool for loading code shouldn't be called Monticello, it should be
called, I dunno, maybe, code-loader or something equally descriptive. A browser for a virtual tour of Thomas Jefferson's house should be called Monticello.
It is an app. Apps have names. Not all word processors can be called "word processor". :)
- The instructions for using monticello shouldn't refer to mouse buttons a=
s red and yellow. Yes, I know it's a Smalltalk tradition dating back from the days when the community actually cared about usability. My mouse buttons ar= e both black. Give me a break. (This is where it starts to feel like poor usability has crossed over into sadism.)
Hehe! Well, I can't really comment on that, I agree that colors for mouse buttons isn't really helping today.
- It can't be usable if it doesn't work. I downloaded the files to a
directory, opened monitcello, browsed to that "repository" highlighted the files and clicked "load". Same as before-says it's loading, but no new classes/methods appear in the system. Hmmm, maybe I should have clicked Merge. I click Merge. It says it's reloading and hangs. Maybe the firewall is blocking. Monticello must use HTTP tunneling, right, so the user doesn'= t have to deal with networking stuff?
And then, inevitably, somebody from the mailing list shakes their head and tells you it's easy to use.
Mmmm, not sure, but if it said it loaded it - are you sure you didn't get something? People often have problems with HTTP on non standard port numbers, like 8888 (IIRC the Kilana url was such a port, right?)
regards, Göran
I reported a pretty serious bug on Mantis 5 weeks ago, but there is no evidence that anyone has looked at it since. I know this is a volunteer effort, and I'm looking forward to the day I grok this all enough to contribute, but it's kind of frustrating.
It's bug number 2114, and similar problems are holding me up now. It's very difficult to track down problems in Morphic where #step is involved. I get MessageNotUnderstood for #adaptToPoint:andSend: which happens because positionWhenComposed is nil... but when you go in with the debugger, it's happily a valid Point.
Very frustrating.
../Dave
Posting like this to Squeak-Dev is certainly a way to draw attention.
http://bugs.impara.de/view.php?id=2114
I'm about 99% certain your problem is because your clock is updated in a seperate process and when you update it you use the update mechanism to trigger a change in the UI. This mechanism is not thread-safe as far as I'm aware. Please see the URL above for a bit more commentary.
Ken
On Tue, 2005-11-29 at 16:11 -0500, Dave Mason wrote:
I reported a pretty serious bug on Mantis 5 weeks ago, but there is no evidence that anyone has looked at it since. I know this is a volunteer effort, and I'm looking forward to the day I grok this all enough to contribute, but it's kind of frustrating.
It's bug number 2114, and similar problems are holding me up now. It's very difficult to track down problems in Morphic where #step is involved. I get MessageNotUnderstood for #adaptToPoint:andSend: which happens because positionWhenComposed is nil... but when you go in with the debugger, it's happily a valid Point.
Very frustrating.
../Dave
Dave Mason wrote:
I reported a pretty serious bug on Mantis 5 weeks ago, but there is no evidence that anyone has looked at it since. I know this is a volunteer effort, and I'm looking forward to the day I grok this all enough to contribute, but it's kind of frustrating.
It's bug number 2114, and similar problems are holding me up now. It's very difficult to track down problems in Morphic where #step is involved. I get MessageNotUnderstood for #adaptToPoint:andSend: which happens because positionWhenComposed is nil... but when you go in with the debugger, it's happily a valid Point.
Very frustrating.
../Dave
I looked at your Clock code and notice that you are doing stuff that are not very safe in Morphic. The Clock code looks more like a MVC app. Morphic runs in a single process and updating from another process is probably what causes your trouble. Take a look at the class ClockMorph to see a morphic approach to what you are doing, using #step etc. Karl
Hi Larry!
Larry White ljw1001@gmail.com wrote:
I want to be able to read a text file and have it programmatically perform substitution on some of the text.
The requirement is for something akin to "smalltalk server pages" although this isn't for a web app.
I just want to be able to read a file containing the text "Hello, <%name%>. Welcome to my world." and have it return as a string "Hello, Joe. Welcome to my world."
Is this functionality available in squeak somewhere, perhaps as part of a web server framework?
Yup. :)
I have just implemented such a macro processor - should be exactly what you want, take a look at: http://squeak.krampe.se/MacroProc-gk.cs.gz
Cheers, Göran
squeak-dev@lists.squeakfoundation.org