And in OGNL it's similar to apply an _expression_ to any collection, enumeration or iterator:

    parent.children.{ #this.doSomething() }

or you can filter any collection, enumeration or iterator using

    filteredItems = parent.children.{? name.startsWith("foo") }

This is what Buddha would have used for an _expression_ language.

- Drew
// OGNL since 1998

josh zeidner wrote:
Thomas,

 I was about to say practically the same thing...  in
python:

 foreach( SomeObject )

 It amazing!  Its going save us billions in
development costs!  Crom the Mighty, the patron diety
of Ruby on Rails is very pleased with block
enumerators.

 Do they pass out pills at Ruby user group meetings?

 -jmz


--- Thomas Hicks <[EMAIL PROTECTED]> wrote:

  
At 09:44 AM 6/22/2006, Chad wrote:

    
Cool.  I checked out the REXML page.  This quote is
      
great:
    
------------------------------------
"Some of the common differences are that the Ruby
      
API relies on block
    
enumerations, rather than iterators. For example,
      
the Java code:
    
for (Enumeration e=parent.getChildren();
      
e.hasMoreElements(); ) {
    
 Element child = (Element)e.nextElement(); // Do
      
something with child
    
}

in Ruby becomes:

parent.each_child{ |child| # Do something with
      
child }
    
Can't you feel the peace and contentment in this
      
block of code? Ruby
    
is the language Buddha would have programmed in."
---------------------------------------
      
Dr. Ralph Griswold (creator or SNOBOL and Icon
programming languages)
used to say that there's really nothing new under
the sun in CS, it's all
recycled. I have to note that this statement form
you admire so much comes
directly from Smalltalk of 20 years ago!
         regards,
         -tom




    
---------------------------------------------------------------------
  
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


    


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  

-- 
+---------------------------------+
< Drew Davidson | OGNL Technology >
+---------------------------------+
|  Email: [EMAIL PROTECTED]          /
|    Web: http://www.ognl.org   /
|    Vox: (520) 531-1966       <
|    Fax: (520) 531-1965        \
| Mobile: (520) 405-2967         \
+---------------------------------+

Reply via email to