Bug 471130 - Guards in loops
Summary: Guards in loops
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Golo (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Julien Ponge CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2015-06-26 08:53 EDT by Julien Ponge CLA
Modified: 2016-05-25 10:27 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Ponge CLA 2015-06-26 08:53:36 EDT
Some languages (e.g., Go, Swift, ...) support guards in loops.

This would be a nice addition for imperative-style constructions, as in:

foreach n in l {
  if n > 10 {
    println(n)
  }
}

This could be replaced by, say:

foreach n in l when n > 10 {
  println(n)
}

The syntax is to be discussed, this could be nice, too:

foreach n in l, n > 10 {
  println(n)
}
Comment 1 Eclipse Genie CLA 2015-06-30 16:17:34 EDT
GitHub Pull Request 287 created by [jponge]
https://github.com/eclipse/golo-lang/pull/287
Comment 2 Julien Ponge CLA 2015-07-03 08:28:26 EDT
Merged