Skip to content

Instantly share code, notes, and snippets.

@xkr47
Last active December 3, 2015 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xkr47/cb78792d0678def748ec to your computer and use it in GitHub Desktop.
Save xkr47/cb78792d0678def748ec to your computer and use it in GitHub Desktop.
Ceylon Web Runner: ceylon precedence fun
//$webrun_wrapped
shared void run() {
value cn = "foo.bar";
print(cn[(cn.lastIndexWhere((Character ch) => ch == '.') else 0) ...]);
// vs
print(cn[(cn.lastIndexWhere((Character ch) => ch == '.') else 0)+1 ...]);
// vs
print(cn[ cn.lastIndexWhere((Character ch) => ch == '.') else 0 ...]);
}
@xkr47
Copy link
Author

xkr47 commented Dec 3, 2015

Click here to run this code online

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment