Write Javascript in Smalltalk
I just stumbled over a nice little tool in the public repository: JavascriptInSmalltalk. Michael Lucas Smith developed this handy little package and it allows you to write javascript functions directly inside the Refactoring Browser. All you need to do is create a subclass of JavascriptClass. If you send your new class the method #javascript it’ll return the string that you need to serve as a javascript file. It contains the class definition as well as all the functions that you have in your class. Please note, that the class definition is for MooTools. If you use another Javascript library you might want to modify some of the class methods of JavascriptClass in order to produce text for your library.
The package requires SmeeStandaloneParser, which throws a little error when loaded, but as far as I can tell you might just ignore that.
Karsten
Comments
Interesting...
[markus] June 24, 2008 16:41:25 +0200 (CEST)
Sounds very interesting, i will give it a closer look soon.
Anything that liberates me from this dratted "programming-in-text-editors"-thing is more than welcome.
Doesn't load?
[Magnus] June 25, 2008 08:32:45 +0200 (CEST)
I tried to load the latest version but always ran into problems with the SmeeParser - anything special I should do/think of?
First impression..
[Markus] June 27, 2008 14:30:15 +0200 (CEST)
I've just took a (quick) look at it.
It seems to be nice enough, but some cool things are missing imho
- sender/implementers-functionality
- format; would be cool, not really important, but it should not be available if not properly supported; this point is valid for other menuitems to, if they are not supported, they should not appear
-rename
...but syntax-checking seems to be ok.
Nevertheless, good thing to have it integrated in seabreeze, Karsten!!