On Monday, 18 January 2016 at 23:33:53 UTC, Jay Norwood wrote:
I'm playing with the example below. I noticed a few things.
1. The ndslice didn't support the extra index, i, in the
foreach, so had to add extra i,j.
2. I couldn't figure out a way to use sliced on the original
'a' array. Is slic
On Tuesday, 19 January 2016 at 07:46:59 UTC, Mike Parker wrote:
It's not that he's seeing them as special, it's just that
indexing them in D is different than doing so in C or C++. It
trips a lot of people up.
No, the difference is actually in C/C++ 's declaration syntax;
the way that indexin
On Mon, 2016-01-18 at 21:50 +0100, Jacob Carlborg via Digitalmars-d-
learn wrote:
> On 2016-01-18 19:11, Russel Winder via Digitalmars-d-learn wrote:
>
> > It seems DStep is producing somewhat strange D from complicated C
> > unions.
>
> Please report any issues to [1] with a test case. C code, e
On Tuesday, 19 January 2016 at 08:27:56 UTC, tsbockman wrote:
The only relevant difference between the two, is that the order
of the row and column specification is swapped in *the
declaration*, not when indexing.
Newcomers to D tend to think in terms of C when they declare
arrays, so the co
On Monday, 18 January 2016 at 12:46:31 UTC, Jonathan M Davis
wrote:
In general, using floating point values with time is an
incredibly bad idea. It can certainly make sense when printing
stuff out, but using it in calculations is just asking for
trouble given all of the unnecessary imprecision
On Tuesday, 19 January 2016 at 13:00:19 UTC, Mike Parker wrote:
Newcomers to D tend to think in terms of C when they declare
arrays, so the confusion comes when they find out they have to
index it in a way that is the reverse of what they expect. Yes,
it's because the declaration syntax is diff
On Tuesday, 19 January 2016 at 14:58:51 UTC, tsbockman wrote:
Anyway, I'll give it a rest now. I thought this way of looking
at it would make things easier to understand, but I guess not...
In my experience, it's focusing on the types in the D array
syntax, rather than the actual ordering, th
On Tuesday, 19 January 2016 at 14:07:50 UTC, Borislav Kosharov
wrote:
On Monday, 18 January 2016 at 12:46:31 UTC, Jonathan M Davis
wrote:
[...]
I want to use float time in a game where I call the update
method passing the delta time as float seconds. It's more easy
to multiply the dt with a
On Tuesday, 19 January 2016 at 15:25:58 UTC, wobbles wrote:
On Tuesday, 19 January 2016 at 14:07:50 UTC, Borislav Kosharov
wrote:
On Monday, 18 January 2016 at 12:46:31 UTC, Jonathan M Davis
wrote:
[...]
I want to use float time in a game where I call the update
method passing the delta time
On 01/17/2016 08:09 PM, data pulverizer wrote:
On Sunday, 17 January 2016 at 02:08:06 UTC, Timon Gehr wrote:
On 01/16/2016 11:50 PM, data pulverizer wrote:
I guess the constraints are that of a static language.
(This is not true.)
Could you please explain?
E.g., a few of the systems discu
So guys: Ali, Mike Parker and tsbockman thanks for all your
explanation, in fact looking now I and after making some tests I
really got it.
So:
int[2]a1; // Array of 2 elements of type int
int[2][5] a2; // Array of 2 elements of type int divided in 5
rows
writeln(a2[0]); // = a
On Tuesday, January 19, 2016 14:07:50 Borislav Kosharov via Digitalmars-d-learn
wrote:
> On Monday, 18 January 2016 at 12:46:31 UTC, Jonathan M Davis
> wrote:
> > In general, using floating point values with time is an
> > incredibly bad idea. It can certainly make sense when printing
> > stuff ou
On Tuesday, 19 January 2016 at 19:14:30 UTC, alb wrote:
So guys: Ali, Mike Parker and tsbockman thanks for all your
explanation, in fact looking now I and after making some tests
I really got it.
So:
int[2]a1; // Array of 2 elements of type int
int[2][5] a2; // Array of 2 elements o
I just attempted to add one ubyte to another and store the result
in a ubyte but apparently ubytes get converted to ints when being
added... and converting what becomes an int becomes impossible to
store in a ubyte without an explicit cast...
ubyte a, b;
ubyte c = a + b; // Error: cannot impli
Soviet Friend píše v Út 19. 01. 2016 v 22:12 +:
> I just attempted to add one ubyte to another and store the result
> in a ubyte but apparently ubytes get converted to ints when being
> added... and converting what becomes an int becomes impossible to
> store in a ubyte without an explicit c
On 01/19/2016 02:12 PM, Soviet Friend wrote:
> ubytes get converted to ints when being added...
It's a common feature involving all integral type in languages like C,
C++, and D:
https://dlang.org/spec/type.html#integer-promotions
> On the topic of complaining about casting... array length
On Tuesday, 19 January 2016 at 22:12:06 UTC, Soviet Friend wrote:
I don't care if my computer needs to do math on a 4 byte basis,
I'm not writing assembly.
x86 actually doesn't need to do math that way, if you were
writing assembly, it would just work. This is just an annoying
rule brought ov
Hi,
I have the following code:
auto appendMapped(alias f, R, T)(R r, T elem) {
r ~= f(elem);
return r;
}
int minus(int i) {
return -i;
}
unittest {
int[] ar;
// here I do partial application of minus function
alias appendMinus(S,T) = appendMapped
On 01/19/2016 03:37 PM, QAston wrote:
Hi,
I have the following code:
auto appendMapped(alias f, R, T)(R r, T elem) {
r ~= f(elem);
return r;
}
int minus(int i) {
return -i;
}
unittest {
int[] ar;
// here I do partial application of minus function
alias append
On Tue, 19 Jan 2016 23:32:57 +0100, Daniel Kozak wrote:
> Soviet Friend píše v Út 19. 01. 2016 v 22:12 +:
>> I just attempted to add one ubyte to another and store the result in a
>> ubyte but apparently ubytes get converted to ints when being added...
>> and converting what becomes an int bec
On Wednesday, 20 January 2016 at 00:12:16 UTC, Ali Çehreli wrote:
On 01/19/2016 03:37 PM, QAston wrote:
Hi,
I have the following code:
auto appendMapped(alias f, R, T)(R r, T elem) {
r ~= f(elem);
return r;
}
int minus(int i) {
return -i;
}
unittest {
int[] ar;
/
On 01/19/2016 04:22 PM, QAston wrote:
On Wednesday, 20 January 2016 at 00:12:16 UTC, Ali Çehreli wrote:
On 01/19/2016 03:37 PM, QAston wrote:
Hi,
I have the following code:
auto appendMapped(alias f, R, T)(R r, T elem) {
r ~= f(elem);
return r;
}
int minus(int i) {
return -i;
On Sunday, 17 January 2016 at 02:08:06 UTC, Timon Gehr wrote:
On 01/16/2016 11:50 PM, data pulverizer wrote:
I guess the constraints are that of a static language.
(This is not true.)
I'm playing with the design of such a language myself. Basically,
anything can create/use/return type objec
23 matches
Mail list logo