On 10/20/07, Mark Derricutt <[EMAIL PROTECTED]> wrote:
>
> In this work your doing are there any provisions for determining the
> current position in the loop?  i.e. is there anything coming after me?
>
> An example from some code I was just fixing up was taking a list of class
> names and combining them into a ;  delimited string (and erroneously
> appending a trailing separator), without knowing the current position, or if
> something follows you one has to manually keep track of position to
> optionally append a ; rather than just call say ' iterator.hasNext()"
> inside the loop.
>
> With the syntax below, it would be nice if a new implicit variable was
> available which gave up such info...


These loops are library methods, not separate looping language extensions.
Closures just make it possible for programmers to define them. One can
easily make a looping method that has an index or that exposes an iterator.


On 10/20/07, hlovatt <[EMAIL PROTECTED]> wrote:

> Is it really necessary to have a new feature. I would of thought a
> convention that you don't catch something derived from Jump was
> sufficient.


A new exception hierarchy outside Throwable is necessary for closures to
satisfy Tennent's Correspondence Principle, which as you know is a powerful
litmus test for the expressive power of a language feature such as closures.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" 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/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to