V Thu, 31 Jul 2014 02:03:35 +
Puming via Digitalmars-d-learn
napsáno:
> Hi,
>
> I'm writing this global Config class, with an AA member:
>
> ```d
> module my.config;
>
> class Config
> {
> Command[string] commands;
> }
>
> __gshared Config CONFIG;
> ```
>
> and initialize it in anot
On Tuesday, 12 February 2013 at 01:07:35 UTC, bearophile wrote:
In practice at the moment I am maintaining all the D entries of
Rosettacode.
I modified the Hamming numbers code in a personal exercise.
It now uses considerably less memory but is slower.
I've posted the code here in case it
Hi,
I'm writing this global Config class, with an AA member:
```d
module my.config;
class Config
{
Command[string] commands;
}
__gshared Config CONFIG;
```
and initialize it in another module:
```d
module my.app;
import my.config;
void main()
{
CONFIG = new Config();
CONFIG.command
V Wed, 30 Jul 2014 14:33:51 +
seany via Digitalmars-d-learn
napsáno:
> In Ali's excllent book, somehow one thing has escaped my
> attention, and that it the mentioning of pointer arrays.
>
> Can pointers of any type of pointed variable be inserted in an
> int array? Using to!(int) perhaps?
Can't you call it directly?
extern(C)
{
int add (int a, int b)';
}
// ...
auto ret = add(123, 456);
LMB
On Wed, Jul 30, 2014 at 2:55 PM, seany via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
>
>
>> Can you post the signatures of some of the C functions you're tryin
Can you post the signatures of some of the C functions you're
trying to
interface with?
let us take a simple function :
int add (int a, int b)
On Wed, 30 Jul 2014 15:44:14 +, seany wrote:
> However some code is in C, legacy code, and for speed resons. So in some
> cases, I would like to send a bunch of variables , ints, dubles and
> floats to an external C function. The thing is, I do not always know the
> number of variables, so my
On Wednesday, 30 July 2014 at 16:14:56 UTC, Jesse Phillips wrote:
On Wednesday, 30 July 2014 at 07:08:17 UTC, Kozzi11 wrote:
#main.d:
import m.f;
class A {
//class main.A member m is not accessible
//mixin(t!(typeof(this), "m"));
void m() {};
//here is ok
//mixin(t!(typeof(this),
On Wednesday, 30 July 2014 at 07:08:17 UTC, Kozzi11 wrote:
#main.d:
import m.f;
class A {
//class main.A member m is not accessible
//mixin(t!(typeof(this), "m"));
void m() {};
//here is ok
//mixin(t!(typeof(this), "m"));
}
The compiler is trying to construct type A. The fi
Actually, I am writing a climate simulation software, and I would
love to use D for parts of it.
However some code is in C, legacy code, and for speed resons. So
in some cases, I would like to send a bunch of variables , ints,
dubles and floats to an external C function. The thing is, I do
no
Justin's answers seems correct to me, and I don't know anything about your
specific use case, but I cannot resist to add:
Think twice before doing this kind of things. I know that sometimes this is
necessary or handy, but one of the great things about D is that it provides
so many higher-level ab
On Wed, 30 Jul 2014 14:33:51 +, seany wrote:
> In Ali's excllent book, somehow one thing has escaped my attention, and
> that it the mentioning of pointer arrays.
>
> Can pointers of any type of pointed variable be inserted in an int
> array? Using to!(int) perhaps? If not directly, then what
In Ali's excllent book, somehow one thing has escaped my
attention, and that it the mentioning of pointer arrays.
Can pointers of any type of pointed variable be inserted in an
int array? Using to!(int) perhaps? If not directly, then what
else would achieve the same effect?
On Wed, Jul 30, 2014 at 11:46 AM, Philippe Sigaud
wrote:
>> I expected such an answer and I do understand the decisions behind it. Yet,
>> you gave me a really GOOD news! Having to write cast(ubyte) 1 was way too
>> much verbose for my liking, while the new ubyte(1) is reasonable enough.
>
> Why n
> I expected such an answer and I do understand the decisions behind it. Yet,
> you gave me a really GOOD news! Having to write cast(ubyte) 1 was way too
> much verbose for my liking, while the new ubyte(1) is reasonable enough.
Why not use `1u`?
#main.d:
import m.f;
class A {
//class main.A member m is not accessible
//mixin(t!(typeof(this), "m"));
void m() {};
//here is ok
//mixin(t!(typeof(this), "m"));
}
void main(string[] args){}
#m.f
module m.f;
string t(alias cls, string method)() {
import std.traits;
s
16 matches
Mail list logo