Le dimanche 27 mars 2011 à 01:28 +0100, Richard Durr a écrit :
Is SOMELIBRARY then reachable at all? SOMELIBRARY basicPerform: #doSomething withArguments: (Array with: anObject ), ?
Not currently. The reason is that Jtalk doesn't extend Object.prototype. But as I said, Jtalk is still young, there are tons of things to do :) Cheers, Nico
On Fri, Mar 25, 2011 at 2:58 PM, Nicolas Petton <petton.nicolas@gmail.com> wrote: Le lundi 21 mars 2011 à 10:17 +0100, Richard Durr a écrit : > As far as I can see, the only way to call external Javascript is by > writing Javascript-Code directly into a method like so: > doSomethingWith: anObject > {'return SOMELIBRARY.doSomething(anObject); '} > > > is this correct?
No, you can call JS functions with: #basicPerform: and #basicPerform:withArguments:
Cheers, Nicolas
> The OMETA based Smalltalk->JS translator seem to let one use st-syntax > for direct access to javascript like so: > > > doSomethingWith: anObject [ > SOMELIBRARY doSomething: anObject. > ] > > > and CoffeeScript can use JS seamlessly in the same way. > > > Best regards, > RD > > On Mon, Mar 14, 2011 at 7:36 PM, Nicolas Petton > <petton.nicolas@gmail.com> wrote: > Hi, > > I would like to share a project I'm working on on my spare > time: Jtalk > Smalltalk. > > http://nicolaspetton.github.com/jtalk > https://github.com/NicolasPetton/jtalk > > Jtalk is an implementation of the Smalltalk language that > compiles into > JavaScript. > > Some features: > - it is written in itself (including the parser/compiler) > - it is self-contained > - it compiles into efficient JS code > - it uses the Squeak chunk format > - Pharo is considered as the reference implementation > > I think Jtalk can be compared to CoffeeScript[1], > Objective-J[2] or > Clamato[3], from which it reuses some ideas and code. > > Jtalk includes an IDE with a class browser, transcript and > workspace, an > HTML canvas similar to Seaside and a jQuery binding. > > It is still a young piece of code, and some important features > are still > missing/incomplete. > > Cheers, > Nicolas Petton > > [1] http://jashkenas.github.com/coffee-script/ > [2] http://cappuccino.org/ > [3] http://clamato.net > > > >