On Monday, 13 July 2015 at 02:52:11 UTC, Laeeth Isharc wrote:
I am venturing in territory still new to me, but I think that
was his point - foreach with tuples looks like it is looping,
but really it is unpacking them statically at compile time.
And similarly with the recursive version. I d
On Monday, 13 July 2015 at 19:07:55 UTC, Márcio Martins wrote:
On Monday, 13 July 2015 at 16:11:03 UTC, codenstuff wrote:
[...]
This is not really a game development forum but here you go:
auto rads = atan2(object.velocity.y, object.velocity.x); //
returns radians
auto degs = angle * (180.0f
Does the standard library have a way to create a forward link
between two variables of the same type?
One variable is the source and the other is the sink.
When the source variable is changed, the sink variable is too.
Changing the sink variable has no effect on the source variable.
I have alrea
On Sunday, 12 July 2015 at 12:56:17 UTC, Adam D. Ruppe wrote:
On Sunday, 12 July 2015 at 08:38:01 UTC, Tofu Ninja wrote:
Is it even possible?
Yes, though you need to use an entirely different approach for
closures: make a struct.
[...]
This seems like a reasonable solution, even though it
On Monday, 13 July 2015 at 16:11:03 UTC, codenstuff wrote:
I've been using Dgame framework for simple simulations.
I need moving object to be aligned to their velocity vectors.
How is it possible to do that using Dgame?
I see that shape object has setRotation and setRotationCenter.
Not sure h
On Monday, 13 July 2015 at 17:18:53 UTC, Jesse Phillips wrote:
On Monday, 13 July 2015 at 14:41:36 UTC, Steven Schveighoffer
wrote:
You can also do a temporary lambda that you call immediately,
but I'm not 100% sure of the syntax. Someone will chime in
with the answer :)
-Steve
Syntax is ea
On Monday, 13 July 2015 at 14:41:36 UTC, Steven Schveighoffer
wrote:
You can also do a temporary lambda that you call immediately,
but I'm not 100% sure of the syntax. Someone will chime in with
the answer :)
-Steve
Syntax is easy:
void main() {
bool condition;
const x = {
i
I've been using Dgame framework for simple simulations.
I need moving object to be aligned to their velocity vectors.
How is it possible to do that using Dgame?
I see that shape object has setRotation and setRotationCenter.
Not sure how to use these to achieve the effect. I realize that
defau
On 7/13/15 3:11 AM, Yuxuan Shui wrote:
How can I do something like this?
const(A) x;
if (condition) {
x = func1();
} else {
x = func2();
}
This is a valid use case, and to make this work I'll have to use
Rebindable, which is really inconvenient.
auto xvalue() {
if(condition) {
r
On 7/11/15 12:57 PM, flamencofantasy wrote:
On Thursday, 9 July 2015 at 15:14:43 UTC, Binarydepth wrote:
This is my code :
import std.stdio : writeln, readf;
void main(){
int[3] nums;
float prom;
foreach(nem; 0..2){
writeln("input a number : ");
readf(" %d", &
On Mon, 13 Jul 2015 09:08:13 +, Yuxuan Shui wrote:
> No! What I want to do is to assign to 'const' only ONCE. So it is
> basically an initialization.
it is forbidden to do assigning to `const`. and D has *no* "uninitialized
variable" thingy, even `x = void` is initialization too (in technica
On Monday, 13 July 2015 at 08:56:07 UTC, Yuxuan Shui wrote:
On Monday, 13 July 2015 at 07:43:16 UTC, Marc Schütz wrote:
On Monday, 13 July 2015 at 07:11:33 UTC, Yuxuan Shui wrote:
How can I do something like this?
const(A) x;
if (condition) {
x = func1();
} else {
x = func2();
}
This is a
I have written a script that visits all directories in the
current directory and executes a command. In my case, "git pull".
When running the script serially, everything is fine. All git
repositories are pulled.
But I'd like to pull multiple repositories in parallel to speed
things up.
So I
On Monday, 13 July 2015 at 09:08:14 UTC, Yuxuan Shui wrote:
On Monday, 13 July 2015 at 09:05:25 UTC, ketmar wrote:
On Mon, 13 Jul 2015 08:56:05 +, Yuxuan Shui wrote:
[...]
as i wrote, what you really want is the ability to assign to
`const`, which is forbidden in D. initialization of `x
On Monday, 13 July 2015 at 09:05:25 UTC, ketmar wrote:
On Mon, 13 Jul 2015 08:56:05 +, Yuxuan Shui wrote:
On Monday, 13 July 2015 at 07:43:16 UTC, Marc Schütz wrote:
On Monday, 13 July 2015 at 07:11:33 UTC, Yuxuan Shui wrote:
[...]
const(A) = condition ? func1() : func2();
Well I sho
On Mon, 13 Jul 2015 09:02:34 +, Yuxuan Shui wrote:
> IMO this is too restrictive. Can't we just spit compile error for uses
> before initialization, and allow const variables to be initialized
> somewhere other than where it is defined?
there is no "use before initialization", `x` is initiali
On Mon, 13 Jul 2015 08:56:05 +, Yuxuan Shui wrote:
> On Monday, 13 July 2015 at 07:43:16 UTC, Marc Schütz wrote:
>> On Monday, 13 July 2015 at 07:11:33 UTC, Yuxuan Shui wrote:
>>> How can I do something like this?
>>>
>>> const(A) x;
>>> if (condition) {
>>> x = func1();
>>> } else {
>>>
On Monday, 13 July 2015 at 08:55:00 UTC, ketmar wrote:
On Mon, 13 Jul 2015 07:11:32 +, Yuxuan Shui wrote:
How can I do something like this?
const(A) x;
if (condition) {
x = func1();
} else {
x = func2();
}
This is a valid use case, and to make this work I'll have to
use Rebindable,
On Sun, 12 Jul 2015 12:45:10 +, Adam D. Ruppe wrote:
> On Sunday, 12 July 2015 at 11:42:09 UTC, ketmar wrote:
>> nope. there is no way to overload context allocation function,
>> afaik. at least without patching druntime, and i still don't know what
>> one have to patch. ;-)
>
> _d_allocmemor
On Monday, 13 July 2015 at 07:43:16 UTC, Marc Schütz wrote:
On Monday, 13 July 2015 at 07:11:33 UTC, Yuxuan Shui wrote:
How can I do something like this?
const(A) x;
if (condition) {
x = func1();
} else {
x = func2();
}
This is a valid use case, and to make this work I'll have to
use Rebi
On Mon, 13 Jul 2015 07:11:32 +, Yuxuan Shui wrote:
> How can I do something like this?
>
> const(A) x;
> if (condition) {
>x = func1();
> } else {
>x = func2();
> }
>
> This is a valid use case, and to make this work I'll have to use
> Rebindable, which is really inconvenient.
p.s.
On Monday, 13 July 2015 at 07:11:33 UTC, Yuxuan Shui wrote:
How can I do something like this?
const(A) x;
if (condition) {
x = func1();
} else {
x = func2();
}
This is a valid use case, and to make this work I'll have to
use Rebindable, which is really inconvenient.
const(A) = condition
How can I do something like this?
const(A) x;
if (condition) {
x = func1();
} else {
x = func2();
}
This is a valid use case, and to make this work I'll have to use
Rebindable, which is really inconvenient.
23 matches
Mail list logo