Someone who has actually done a C or C++ application or two which used D code
should answer this question. I know that there are at least a few folks around
here who have done that, but I've never done it myself.
http://stackoverflow.com/questions/7480046/implementing-a-c-api-in-d
On Tuesday, September 20, 2011 08:35:52 Mirko Pilger wrote:
> > Is there any usable profiler for D2?
>
> dmd -profile
I don't believe that it doesn't currently work with 64-bit binaries though, so
if you want to run the profiler, you're going to need to do it with a 32-bit
binary (which as all
Is there any usable profiler for D2?
dmd -profile
Is there any usable profiler for D2?
Excellent!
Thanks so much for your feedback!. I am excited to get into C++ and D now.
On 09/20/2011 12:50 AM, Adam Burton wrote:
Simen Kjaeraas wrote:
On Mon, 19 Sep 2011 23:20:47 +0200, bearophile
wrote:
A tiny puzzle I've shown on IRC. This is supposed to create an inverted
array of cards, but what does it print instead?
import std.stdio, std.algorithm, std.range;
void main
Simen Kjaeraas wrote:
> On Mon, 19 Sep 2011 23:20:47 +0200, bearophile
> wrote:
>
>> A tiny puzzle I've shown on IRC. This is supposed to create an inverted
>> array of cards, but what does it print instead?
>>
>> import std.stdio, std.algorithm, std.range;
>> void main() {
>> int[52] cards;
On 09/19/2011 11:20 PM, bearophile wrote:
A tiny puzzle I've shown on IRC. This is supposed to create an inverted array
of cards, but what does it print instead?
import std.stdio, std.algorithm, std.range;
void main() {
int[52] cards;
copy(iota(cards.length - 1, -1, -1), cards[]);
On Mon, 19 Sep 2011 23:20:47 +0200, bearophile
wrote:
A tiny puzzle I've shown on IRC. This is supposed to create an inverted
array of cards, but what does it print instead?
import std.stdio, std.algorithm, std.range;
void main() {
int[52] cards;
copy(iota(cards.length - 1, -1, -1)
A tiny puzzle I've shown on IRC. This is supposed to create an inverted array
of cards, but what does it print instead?
import std.stdio, std.algorithm, std.range;
void main() {
int[52] cards;
copy(iota(cards.length - 1, -1, -1), cards[]);
writeln(cards);
}
Bye,
bearophile
On 09/19/2011 08:59 AM, Timon Gehr wrote:
>
> You could use the C preprocessor ;). Or this, that does the same thing:
>
> version(V1) private enum _v1=true;
> else private enum _v1=false;
> mixin((_v1?"extern(System):":"extern(C):")~q{
> // all declarations that should be affected.
> });
o
On 09/18/2011 11:04 PM, Daniel Murphy wrote:
> "Ellery Newcomer" wrote in message
> news:j557r6$vgt$1...@digitalmars.com...
>> Just came across some old D code that does this:
>>
>> version(linux){
>> extern(C):
>> }
>>
>
> Are the prototypes extern(Windows) when not on linux, by any chance? Th
On 18-09-2011 21:47, Timon Gehr wrote:
On 09/18/2011 08:57 PM, bearophile wrote:
I don't know what is the right design in this case. Intrinsics are
useful because they sometimes give more performance, but normal
functions are sometimes more handy because they allow more
flexibility, like taking
On 9/19/11 3:32 PM, Alex Rønne Petersen wrote:
On 18-09-2011 21:47, Timon Gehr wrote:
On 09/18/2011 08:57 PM, bearophile wrote:
I don't know what is the right design in this case. Intrinsics are
useful because they sometimes give more performance, but normal
functions are sometimes more handy b
On 09/19/2011 03:37 PM, Trass3r wrote:
Change it to the following, and you're golden.
extern(System):
That only fixes this particular issue.
I once had the following case that can't be done:
version(V1)
{
extern(System):
}
else
{
extern(C):
}
You could use the C preprocessor ;). Or this,
Change it to the following, and you're golden.
extern(System):
That only fixes this particular issue.
I once had the following case that can't be done:
version(V1)
{
extern(System):
}
else
{
extern(C):
}
On 9/19/2011 1:55 AM, Ellery Newcomer wrote:
Just came across some old D code that does this:
version(linux){
extern(C):
}
in dmd 2.055, the extern(C) is not being applied to the OpenGL decls.
should it?
Change it to the following, and you're golden.
extern(System):
So, my question is THIS:
Can I write a "windows" DLL file in D that would have functions that can
be accessible from a compiled C++ program? (Actually, in this case, it's
UnrealScript that is compiled into a C++ exe.)
It's perfectly possible to create DLLs with D, also see
http://www.d-prog
lsc9x:
> So, I was poking around looking at C++ books and I wondered "Gee, I know there
> were languages A, C, C, C++ and C#, I wonder if there is a "D" language.
>
> Surprise! There is!
>
> Not only that, but D sounds like a better language for me to learn than C++
The best language of the wo
Dear Friends,
I have a pretty technical question about D that I might be making more or less
complex based on my lack of knowledge about C++.
Any help would be appreciated!
I'm a novice programmer who is more into the design end of game design, but I
want to learn programming. I know some very
"Ellery Newcomer" wrote in message
news:j557r6$vgt$1...@digitalmars.com...
> Just came across some old D code that does this:
>
> version(linux){
> extern(C):
> }
>
Are the prototypes extern(Windows) when not on linux, by any chance? That
is the only combination I've ever had to use, and is su
Timon Gehr:
> As to
> source-level compatibility, the only "guarantee" that Ds design gives is
> that C code will either compile as D code with identical semantics or
> not compile at all.
In practice there are few differences, try to compile this in C and D, swapping
the import/include:
imp
On 09/18/2011 04:09 PM, Trass3r wrote:
> Am 18.09.2011, 18:55 Uhr, schrieb Ellery Newcomer
> :
>
>> Just came across some old D code that does this:
>>
>> version(linux){
>> extern(C):
>> }
>>
>>
>>
>>
>>
>> in dmd 2.055, the extern(C) is not being applied to the OpenGL decls.
>> should it?
>
Am 18.09.2011, 18:55 Uhr, schrieb Ellery Newcomer
:
Just came across some old D code that does this:
version(linux){
extern(C):
}
in dmd 2.055, the extern(C) is not being applied to the OpenGL decls.
should it?
Walter once said it was deliberate.
That extern(C) is only valid in
On 09/18/2011 10:46 PM, Ellery Newcomer wrote:
On 09/18/2011 01:02 PM, Timon Gehr wrote:
If you are asking, if the D compiler is wrong here: No, it is by design,
you can check with the D grammar.
Nah, just confirming that failure to apply the externs is a bug.
version(linux){
extern(C):
On 09/18/2011 01:02 PM, Timon Gehr wrote:
>
> If you are asking, if the D compiler is wrong here: No, it is by design,
> you can check with the D grammar.
Nah, just confirming that failure to apply the externs is a bug.
On 09/18/2011 10:08 PM, %u wrote:
does D compatibility with C restrict D from evolving ?
Binary compatibility as in extern(C) certainly does not. As to
source-level compatibility, the only "guarantee" that Ds design gives is
that C code will either compile as D code with identical semantics o
does D compatibility with C restrict D from evolving ?
and if D drop this will that prevent complexity?
On 09/18/2011 08:57 PM, bearophile wrote:
I don't know what is the right design in this case. Intrinsics are useful because they
sometimes give more performance, but normal functions are sometimes more handy because
they allow more flexibility, like taking their address ("first class
functions
I don't know what is the right design in this case. Intrinsics are useful
because they sometimes give more performance, but normal functions are
sometimes more handy because they allow more flexibility, like taking their
address ("first class functions"):
import std.math;
void main() {
aut
On 09/18/2011 06:55 PM, Ellery Newcomer wrote:
Just came across some old D code that does this:
version(linux){
extern(C):
}
in dmd 2.055, the extern(C) is not being applied to the OpenGL decls.
should it?
Yes they should be applied, unless they declare D functions, which is
seld
Just came across some old D code that does this:
version(linux){
extern(C):
}
in dmd 2.055, the extern(C) is not being applied to the OpenGL decls.
should it?
On Friday, September 16, 2011 23:15:16 Kiith-Sa wrote:
> Jonathan M Davis wrote:
> > On Friday, September 16, 2011 12:47 Kiith-Sa wrote:
> >> I've just installed a new system - Ubuntu 11.10 beta x64 and can't get
> >> dmd/phobos 2.055 to work.
> >>
> >> When I try to compile file hello.d with the
On 09/18/2011 05:14 PM, Andrej Mitrovic wrote:
struct Bar { int x; }
struct Foo
{
Bar _bar;
Bar bar()
{
return _bar;
}
}
void main()
{
Foo foo;
with (foo.bar)
{
}
}
Error: foo.bar() is not an lvalue
I've made a getter because I want to control h
On Tuesday, September 13, 2011 04:32:28 Vladimir Panteleev wrote:
> The simplest way I found is:
> TickDuration.from!"hnsecs"(duration.total!"hnsecs")
>
> Is there a simpler way?
There's now a pull request which adds opCast to Duration which casts to
TickDuration: https://github.com/D-Programmin
struct Bar { int x; }
struct Foo
{
Bar _bar;
Bar bar()
{
return _bar;
}
}
void main()
{
Foo foo;
with (foo.bar)
{
}
}
Error: foo.bar() is not an lvalue
I've made a getter because I want to control how _bar is manipulated.
I've lost the ability to use the w
36 matches
Mail list logo