socket.io

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

socket.io

Herby Vojčík
Hello,

I am considering Amber as one of the choices for making client in a suite of client-server applications. The choice of client-server communication was socket.io. Is it possible to use socket.io from amber (I know it is possible to use other js libs, but is it easy to use callbacks in them, like convert block to closure or so?)?

Thanx, Herby
Reply | Threaded
Open this post in threaded view
|

Re: socket.io

Nicolas Petton
On Mon, 2011-10-10 at 13:43 -0700, Herby Vojčík wrote:
> Hello,
>
> I am considering Amber as one of the choices for making client in a suite of
> client-server applications. The choice of client-server communication was
> socket.io. Is it possible to use socket.io from amber (I know it is possible
> to use other js libs, but is it easy to use callbacks in them, like convert
> block to closure or so?)?

Hi,

A block closure *is* a callback in JavaScript. By that I mean that it is
the same object.

anObject.on('hello', function(e) {...})

and:

anObject on: 'foo' do: [:e | ... ]

are strictly equivalent.

HTH,
Nico
>
> Thanx, Herby
>
> --
> View this message in context: http://forum.world.st/socket-io-tp3891761p3891761.html
> Sent from the Amber mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: socket.io

Sean P. DeNigris
Administrator
Nicolas Petton wrote
A block closure *is* a callback in JavaScript. By that I mean that it is
the same object.

anObject.on('hello', function(e) {...})

and:

anObject on: 'foo' do: [:e | ... ]

are strictly equivalent.
Wow! That's cool and helpful :) Is this part of the documentation? Luckily I stumbled upon this post...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: socket.io

Nicolas Petton
Yes, it is there:
https://github.com/amber-smalltalk/amber/wiki/From-smalltalk-to-javascript-and-back

Cheers,
Nico


Sean P. DeNigris writes:

> Nicolas Petton wrote
>> A block closure *is* a callback in JavaScript. By that I mean that it is
>> the same object.
>>
>> anObject.on('hello', function(e) {...})
>>
>> and:
>>
>> anObject on: 'foo' do: [:e | ... ]
>>
>> are strictly equivalent.
>
> Wow! That's cool and helpful :) Is this part of the documentation? Luckily I
> stumbled upon this post...
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/socket-io-tp3891761p4768402.html
> Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.