I have a class that creates a task in it's constructor. How do I store this
created task as one of it's value members and later on call .yieldForce()?
On Saturday, 1 August 2015 at 14:42:47 UTC, vit wrote:
Exist in phobos something like Import template?
public import std.traits;
template Import(alias Module){
mixin(import ~ moduleName!Module ~ ;);
}
class C;
struct Test{
Import!(std.typecons).Rebindable!C test;
On Saturday, 1 August 2015 at 17:22:40 UTC, NX wrote:
I wonder if the followings are compiler bugs:
class stuff_class
{
byte[1024*1024*16] arr; // Error: index 16777216 overflow
for static array
}
struct stuff
{
byte[1024*1024*16] arr; // Error: index 16777216 overflow
for static
On Saturday, 1 August 2015 at 09:35:53 UTC, DLearner wrote:
Does the D language set in stone that the first element of an
array _has_ to be index zero?
For the builtin slice types? Yes, set in stone.
Wouldn't starting array elements at one avoid the common
'off-by-one' logic error, it does
Typo:
*scenario
But it's std.parallelism's task...
And how can I use get!T if I don't know the type of the task?
2015-08-01 19:02 GMT+02:00 Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com:
On Saturday, 1 August 2015 at 16:41:54 UTC, maarten van damme wrote:
I was afraid I would have
I wonder if the followings are compiler bugs:
class stuff_class
{
byte[1024*1024*16] arr; // Error: index 16777216 overflow for
static array
}
struct stuff
{
byte[1024*1024*16] arr; // Error: index 16777216 overflow for
static array
}
My project has just stopped for this reason, I
On Saturday, 1 August 2015 at 17:29:54 UTC, Adam D. Ruppe wrote:
On Saturday, 1 August 2015 at 17:22:40 UTC, NX wrote:
I wonder if the followings are compiler bugs:
No, it is by design, the idea is to keep static arrays smallish
so null references will be caught by the processor. (An overly
On Saturday, 1 August 2015 at 16:41:54 UTC, maarten van damme
wrote:
I was afraid I would have to do that. Templatizing the class on
the value doesn't work as I later on want to create a hashmap
of these classes. When I assign a task to a variant, how do I
call .yieldForce later on?
You can
On 31/07/15 19:21, Ali Çehreli via Digitalmars-d-learn wrote:
On 07/26/2015 04:29 AM, Joseph Rushton Wakeling via Digitalmars-d-learn wrote:
is this design idea even feasible in principle, or just a bad
idea from the get-go?
As I understand it, it is against one of fundamental D
Exist in phobos something like Import template?
public import std.traits;
template Import(alias Module){
mixin(import ~ moduleName!Module ~ ;);
}
class C;
struct Test{
Import!(std.typecons).Rebindable!C test;//symbols
}
On Saturday, 1 August 2015 at 17:22:40 UTC, NX wrote:
I wonder if the followings are compiler bugs:
No, it is by design, the idea is to keep static arrays smallish
so null references will be caught by the processor. (An overly
large static array could allow indexing it through a null pointer
On Saturday, 1 August 2015 at 12:10:43 UTC, Joseph Rushton
Wakeling wrote:
On 31/07/15 19:21, Ali Çehreli via Digitalmars-d-learn wrote:
On 07/26/2015 04:29 AM, Joseph Rushton Wakeling via
Digitalmars-d-learn wrote:
is this design idea even feasible in principle, or just a
bad
idea from
On Wednesday, 29 July 2015 at 09:25:50 UTC, Snape wrote:
I'm in the early stages of building a little game with OpenGL
(in D) and I just want to know the facts about the GC before I
decide to either use it or work around it. Lots of people have
said lots of things about it, but some of that
On 31/07/15 13:40, Kagamin via Digitalmars-d-learn wrote:
On Sunday, 26 July 2015 at 12:16:30 UTC, Joseph Rushton Wakeling wrote:
Example:
Unique!Random rng = new Random(unpredictableSeed);
rng.take(10).writeln;
My aim by contrast is to _allow_ that kind of use, but render the original
On Saturday, 1 August 2015 at 15:37:46 UTC, maarten van damme
wrote:
I have a class that creates a task in it's constructor. How do
I store this created task as one of it's value members and
later on call .yieldForce()?
If the class itself isn't templated on the type, you'll want to
use
On Saturday, 1 August 2015 at 14:42:47 UTC, vit wrote:
Exist in phobos something like Import template?
What would you use that for? You can just use the import
keyword...
On Saturday, 1 August 2015 at 09:35:53 UTC, DLearner wrote:
Does the D language set in stone that the first element of an
array _has_ to be index zero?
Wouldn't starting array elements at one avoid the common
'off-by-one' logic error, it does
seem more natural to begin a count at 1.
Actually,
On Saturday, 1 August 2015 at 18:07:51 UTC, NX wrote:
Sorry, I can't see _the_ point in that.
Yeah, especially since you can jsut break up the array and get
the same effect anyway...
so like if you don't want to dynamically allocate the memory, you
could also try:
byte[1024*1024*8]
I was afraid I would have to do that. Templatizing the class on the value
doesn't work as I later on want to create a hashmap of these classes.
When I assign a task to a variant, how do I call .yieldForce later on?
2015-08-01 18:28 GMT+02:00 Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 1 August 2015 at 18:47:00 UTC, Daniel Kozak wrote:
Still same problem, You can`t allocate more then 16M on stack.
Use dynamic allocation
I don't think new MyStruct allocates on stack, actually
allocating ~16MB on stack will immediatelly crash the program
which is not the case
V Sat, 01 Aug 2015 19:21:36 +
NX via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno:
On Saturday, 1 August 2015 at 18:50:09 UTC, Daniel Kozak wrote:
No you don't. You still use static allocation for array
Can clarify why does that happen and I still suspect it's a
On Friday, 31 July 2015 at 11:09:39 UTC, anonymous wrote:
Definitely a bug. Please file an issue at
https://issues.dlang.org/.
https://issues.dlang.org/show_bug.cgi?id=14858
On Saturday, 1 August 2015 at 18:07:51 UTC, NX wrote:
On Saturday, 1 August 2015 at 17:29:54 UTC, Adam D. Ruppe wrote:
Sorry, I can't see _the_ point in that. I understand that could
be a problem if it was a global array but this scenery is
completely wrong in my view. I'm already going to
Hey, I have found this great source of tutorials for simple game
development, yet i am unable to run it properly on Windows 8.1.
https://github.com/d-gamedev-team/opengl-tutorials/tree/master/ports/opengl-tutorial.org/tutorials/01_window
Can someone tell me how can i run all those examples? I
On Saturday, 1 August 2015 at 17:55:06 UTC, John Colvin wrote:
On Saturday, 1 August 2015 at 09:35:53 UTC, DLearner wrote:
Does the D language set in stone that the first element of an
array _has_ to be index zero?
For the builtin slice types? Yes, set in stone.
Wouldn't starting array
On 8/1/15, DLearner via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
D is a C derivative, so it seems a shame not to identify causes
of bugs in C,
and design them out in D.
This has already been done! D defines an array to be a struct with a
pointer and a length. See this
On Saturday, 1 August 2015 at 04:11:02 UTC, Laeeth Isharc wrote:
Walter observes that if you are a Java programmer and start
writing D, you will write D like you write Java. And so I
suppose one will see what one doesn't have in Java, but not so
much the benefits of D. That's true of other
On Saturday, 1 August 2015 at 18:50:09 UTC, Daniel Kozak wrote:
No you don't. You still use static allocation for array
Can clarify why does that happen and I still suspect it's a
static allocation it would increase output exe if it was really
that static..?
V Sat, 01 Aug 2015 19:16:16 +
NX via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno:
On Saturday, 1 August 2015 at 18:47:00 UTC, Daniel Kozak wrote:
Still same problem, You can`t allocate more then 16M on stack.
Use dynamic allocation
I don't think new MyStruct
On Saturday, 1 August 2015 at 19:33:26 UTC, Daniel Kozak wrote:
My fault It is not on stack, but still it is a static allocation
I think you're misusing static allocation and static
declaration for each other.
On Saturday, 1 August 2015 at 19:04:10 UTC, Andrej Mitrovic wrote:
On 8/1/15, DLearner via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
D is a C derivative, so it seems a shame not to identify causes
of bugs in C,
and design them out in D.
This has already been done! D defines
On 08/01/2015 08:37 AM, maarten van damme via Digitalmars-d-learn wrote:
I have a class that creates a task in it's constructor. How do I store this
created task as one of it's value members and later on call .yieldForce()?
Tasks can be created with a function pointer 'function parameter' as
On Saturday, 1 August 2015 at 22:14:45 UTC, nikolai wrote:
Hey, I have found this great source of tutorials for simple
game development, yet i am unable to run it properly on Windows
8.1.
On Saturday, 1 August 2015 at 17:50:28 UTC, John Colvin wrote:
I'm not sure how good an idea it is to totally enforce a range
to be non-copyable, even if you could deal with the function
call chain problem. Even in totally save-aware code, there can
still be valid assignment of a range type.
V Sat, 01 Aug 2015 18:07:50 +
NX via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno:
On Saturday, 1 August 2015 at 17:29:54 UTC, Adam D. Ruppe wrote:
On Saturday, 1 August 2015 at 17:22:40 UTC, NX wrote:
I wonder if the followings are compiler bugs:
No, it is by
Does the D language set in stone that the first element of an
array _has_ to be index zero?
Wouldn't starting array elements at one avoid the common
'off-by-one' logic error, it does
seem more natural to begin a count at 1.
Actually, maybe even better to allow array definitions of form
int
On 1/08/2015 9:35 p.m., DLearner wrote:
Does the D language set in stone that the first element of an array
_has_ to be index zero?
Wouldn't starting array elements at one avoid the common 'off-by-one'
logic error, it does
seem more natural to begin a count at 1.
Actually, maybe even better to
38 matches
Mail list logo