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
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:
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
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 following
On 09/18/2011 06:55 PM, Ellery Newcomer wrote:
Just came across some old D code that does this:
version(linux){
extern(C):
}
Hundreds of OpenGL decls
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
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() {
auto
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
does D compatibility with C restrict D from evolving ?
and if D drop this will that prevent complexity?
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 or
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: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){
On 09/18/2011 04:09 PM, Trass3r wrote:
Am 18.09.2011, 18:55 Uhr, schrieb Ellery Newcomer
ellery-newco...@utulsa.edu:
Just came across some old D code that does this:
version(linux){
extern(C):
}
Hundreds of OpenGL decls
in dmd 2.055, the extern(C) is not being applied to the
Am 18.09.2011, 18:55 Uhr, schrieb Ellery Newcomer
ellery-newco...@utulsa.edu:
Just came across some old D code that does this:
version(linux){
extern(C):
}
Hundreds of OpenGL decls
in dmd 2.055, the extern(C) is not being applied to the OpenGL decls.
should it?
Walter once said
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:
import
Ellery Newcomer ellery-newco...@utulsa.edu 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
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
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 world will
On 9/19/2011 1:55 AM, Ellery Newcomer wrote:
Just came across some old D code that does this:
version(linux){
extern(C):
}
Hundreds of OpenGL decls
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.
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
Change it to the following, and you're golden.
extern(System):
Hundreds of OpenGL decls
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 09/19/2011 03:37 PM, Trass3r wrote:
Change it to the following, and you're golden.
extern(System):
Hundreds of OpenGL decls
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
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 09/18/2011 11:04 PM, Daniel Murphy wrote:
Ellery Newcomer ellery-newco...@utulsa.edu 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
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.
});
code golf
or
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 Mon, 19 Sep 2011 23:20:47 +0200, bearophile bearophileh...@lycos.com
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[]);
Simen Kjaeraas wrote:
On Mon, 19 Sep 2011 23:20:47 +0200, bearophile bearophileh...@lycos.com
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() {
On 09/20/2011 12:50 AM, Adam Burton wrote:
Simen Kjaeraas wrote:
On Mon, 19 Sep 2011 23:20:47 +0200, bearophilebearophileh...@lycos.com
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,
Excellent!
Thanks so much for your feedback!. I am excited to get into C++ and D now.
30 matches
Mail list logo