The syntax that looks like a list comprehension is really more like a
lambda:

html submitButton
         onClick: (html jQuery ajax
            script: [ :s | s << (s jQuery: #logger) html: DateAndTime
now ]);
         with: 'Replace'.

The square brackets above enclose a "block" in Smalltalk.  The
variable inside the block (s:) is passed in when the block is
evaluated.  In this case it is sent the message "jQuery: #logger" and
the result of that message is sent the message "html: DateAndTime
now".  From the context I can tell the s variable is an object that
obeys a Stream protocol and it is being sent messages that render html
onto the stream.

The really interesting thing about Seaside is not necessarily how it
does jQuery or other AJAX calls.  It's that it can do "ajax like"
things in a browser with no AJAX at all.  You can have several
different regions of your page work independently of each other, like
separate applications or parts of a single application.  It is a
facinating environment and it kicks RoR to heck and back.  In fact,
the ONLY weird or hard-to-accept thing about it is that it's based on
Smalltalk! <g>

-- Joe B.

On Apr 4, 7:27 am, Yarko Tymciurak <[email protected]> wrote:

>
> This is somewhat interesting - says its history is from NeXT / Apple
> WebObjects...
>
> Take a look at this Seaside / JQuery example:
>
> http://seasidemo.blobworks.com:9090/seaside/tests/jquery/ajax%20and%2...
>
> .... in thinking about this, I thought of generators (do they have any place
> here?) - I've never seen this before:  generator expressions (like list
> comprehensions.. but different?)...
>
> .... more later....
>
> Thanks for this,
> -Yarko

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to