24756, "jeremiah-corrado", "Should omitting the 'new' in a 'dmapped' expression be legal", "2024-04-03T21:08:00Z"
Currently, the syntax around dmapped
supports two ways of creating a distributed domain from an anonymous Distribution:
var D = {1..n} dmapped new blockDist({1..n});
var D = {1..n} dmapped blockDist({1..n});
The first option accepts a distribution instance on the right of the dmapped
. This is more consistent with something like:
var myBlockDist = new blockDist({1..n});
var D = {1..n} dmapped myBlockDist;
The second option is essentially syntactic sugar for the first, where the new
is implied.
The fact that the language allows omitting the new
could potentially be confusing for a few reasons:
- this is the only place, other than in a
new
expression itself, where an initialization expression (like:blockDist({1..n})
) is accepted as such - in all other contexts
blockDist({1..n})
would be treated as a call to a type constructor- even more confusing here because:
type t = domain(1) dmapped blockDist(...)
is the syntax for creating a distributed domain type.
- even more confusing here because: