Sorry for the delayed response, Vass and I had a very similar idea to
Christopher's.
begin with ref a, in b {
...
}
forall e in A with ref a, in b do
...
coforall i in 1..10 with
inout baz
{
...
}
I believe the parentheses around the list are not needed to be unambiguous, as
long as we require any 'begin' that uses task intents to start with a 'do' or
block stmt.
//valid
begin with ref a do foo(a);
begin with ref a {
foo(a);
}
// invalid
begin with ref a foo(a);
-Kyle
From: Chris Doris
<[email protected]<mailto:[email protected]>>
Date: Tuesday, July 8, 2014 at 3:06 PM
To: Brad Chamberlain <[email protected]<mailto:[email protected]>>
Cc: Chapel Sourceforge Developers List
<[email protected]<mailto:[email protected]>>
Subject: Re: [Chapel-developers] suggestions for more general syntax for task
intent/ref clause?
Or a new keyword?
begin with(ref a, in b) { ... }
It's syntactically unambiguous. I chose "with" because in a very loose sense,
it's a bit like Python's "with" block, which is to do with tying the behaviour
of a variable to a code block. Also "with" is vague enough that it could be
re-appropriated for other similar tasks - such as what "with" actually does in
Python (it's a very useful feature, which should be in every language!)
Christopher
On 8 July 2014 22:37, Brad Chamberlain <[email protected]<mailto:[email protected]>>
wrote:
Would a double paren work here?
begin (( ref c, in d )) { … }
Since it’s a paren, what could be passed into a task intent would have to be
limited. That may or may not be an issue. I’m not familiar enough here to know.
I agree that the comparison operators make me think C++ right away too. Like
you, I’m not in love with either of these unfortunately.
I almost counterproposed this, but got stuck on the question as to whether this
would be a new 'double paren' token in the lexer (which would be problematic
because it would mean that other instances of adjacent parenthesis -- like in
nested tuples -- would become syntax errors or require special handling in the
parser) or whether it would just be two consecutive paren tokens (which would
suggest that there could be whitespace between the parens, for better or worse).
-Brad
------------------------------------------------------------------------------
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
_______________________________________________
Chapel-developers mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/chapel-developers
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers