On 24/08/12 15:57, bearophile wrote:
It's just syntax sugar for a very obscure operation,
It's an operation included in Cilk Plus, I think Intel devs know
enough what they are doing.
And I think code like this is a common need:
if (a[] 0) {
// ...
}
and it's somewhat ambiguous -- is
On 8/27/12 8:06 AM, Don Clugston wrote:
vote -= int.max;
Beware of wraparound :o).
Andrei
On Friday, 24 August 2012 at 13:57:42 UTC, bearophile wrote:
That code means:
foreach (i; 0 .. a.length) {
if (a[i] 0) {
// ...
}
}
How could this possibly be useful? It's like the loop, but you
lose the index variable. I can't see how you could possibly do
anything with
Peter Alexander:
How could this possibly be useful? It's like the loop, but you
lose the index variable. I can't see how you could possibly do
anything with this.
I think this feature is a part of Cilk+. Maybe I have not fully
understood this feature, or maybe some Intel developers are mad
On Monday, 27 August 2012 at 20:29:29 UTC, bearophile wrote:
I think in code like this:
if (a[] = 0)
b[] += c[];
The 'b' and 'c' arrays receive the implicit index of the items
of 'a' that aren't negative.
Ok, I can see the use of this, but I find the syntax *very*
confusing.
On 24/08/12 00:13, bearophile wrote:
Sean Cavanaugh:
Well, right now the binary operators == != = = and are required
to return bool instead of allowing a user defined type, which prevents
a lot of the sugar you would want to make the code nice to write.
The hypothetical D sugar I was
It's just syntax sugar for a very obscure operation,
It's an operation included in Cilk Plus, I think Intel devs know
enough what they are doing.
And I think code like this is a common need:
if (a[] 0) {
// ...
}
and it's somewhat ambiguous -- is it allowed to use
short-circuit
On Thursday, 23 August 2012 at 00:19:39 UTC, bearophile wrote:
At page 69 of those slides there is some code that looks
interesting, I think this is a reduced version of part of it,
that shows another way to use vectorized comparisons:
void main() {
double[] a = [1.0, 1.0, -1.0, 1.0,
On 8/22/2012 7:19 PM, bearophile wrote:
Some time ago I have suggested to add support to vector comparisons in
D, because this is sometimes useful and in the modern SIMD units there
is hardware support for such operations:
I think that code is semantically equivalent to:
void main() {
Sean Cavanaugh:
Well, right now the binary operators == != = = and are
required to return bool instead of allowing a user defined
type, which prevents a lot of the sugar you would want to make
the code nice to write.
The hypothetical D sugar I was looking for is this, where 'a',
'b' and
Some time ago I have suggested to add support to vector
comparisons in D, because this is sometimes useful and in the
modern SIMD units there is hardware support for such operations:
double[] a = [1.0, 1.0, -1.0, 1.0, 0.0, -1.0];
bool[] t = a[] 0;
assert(t == [true, true, false, true, false,
11 matches
Mail list logo