what happens if .complex[4,6]
?
Walter Pachl

---- Mike Cowlishaw <m...@speleotrove.com> schrieb:
> Kewl ... sort of like the generality of loop .. over.
> 
> I was hacking on the DO instruction code today in my sandbox and I noticed
> something neat in how the code functions.  With the little tweak to the
> complex.cls sample that I just committed, the following code works:  
> 
> comp1 = .complex[1,2]
> 
> comp2 = .complex[4,5]
> 
> comp3 = .complex[1,1]
> 
> 
> 
> loop i = comp1 to comp2 by comp3
> 
>    say i
> 
> end
> 
> 
> 
> ::REQUIRES 'complex'
> 
> Displaying: 
> 1+2i
> 
> 2+3i
> 
> 3+4i
> 
> 4+5i
> 
> 
> 
> The DO loop code does not have a requirement that things be Rexx strings, it 
> is
> sufficient that the objects just implement the required methods.  In this 
> case,
> the prefix + operator, the + operator for the iteration, and being able to
> compare against normal numbers.  Just thought this was kinda neat and wanted 
> to
> share!
> 
> 
> Rick
> 
> 
> 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to