Is this a compiler bug?
struct Foo
{
int a;
}
Foo foo;
alias foo.a b;
void main()
{
b = 5; // -- Error
}
dmd test.d
test.d(11): Error: need 'this' to access member a
I did this on DMD 2.055
My thanks to everyone who responded. I learned something new, which is
always a good thing, plus my program now works correctly!
Take care,
Jim
- Original Message -
From: Jonathan M Davis jmdavisp...@gmx.com
To: digitalmars.D.learn digitalmars-d-learn@puremagic.com
Sent: Thursday,
On 10/22/2011 09:28 AM, Nick Sabalausky wrote:
Is this a compiler bug?
struct Foo
{
int a;
}
Foo foo;
alias foo.a b;
void main()
{
b = 5; //-- Error
}
dmd test.d
test.d(11): Error: need 'this' to access member a
I just downloaded the starter package and it gives to following errors:
ants.d
-line 64: data.splitlines()=splitlines(data)
-line 65:line.strip().toLower()=line.strip().toLower()
-line 104: data.splitlines()=splitlines(data)
-line 111:tokens[0].toLower=tolower(tokens[0])
-line
On Sat, 22 Oct 2011 03:21:09 +, Sean Silva wrote:
I'm struggling with this on 4 fronts:
1. What is `this`, when opAssign is called off of the type? (does it
even make sense to call a member function without an instance?)
Please file a bug on http://d.puremagic.com/issues/
The example
I downloaded the starter pack last night and everything compiled. 2.055
and 2.054
On Sat, 22 Oct 2011 18:30:55 +0200, maarten van damme wrote:
I just downloaded the starter package and it gives to following errors:
ants.d -line 64: data.splitlines()=splitlines(data)
-line
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
The built-in sort on arrays is going away. std.algorithm.sort should
be used
instead. I'm afraid that I don't understand what your comments on
the STL have
to do with the GC though. And stuff in Phobos (such as
std.algorithm) is
On Saturday, October 22, 2011 17:04:57 Sean Silva wrote:
I don't doubt anything that you just said. But as you said, Phobos
*currently* doesn't have what I want, which is an issue if I am
wanting to develop code now or soon. The path of least resistance in
the interim is to just implement some
Timon Gehr timon.g...@gmx.ch wrote in message
news:j7u9ld$i8t$1...@digitalmars.com...
alias has never worked for instance members, even if they are accessible
at compile time.
Any idea if it's supposed to work?
On 10/22/2011 11:03 PM, Nick Sabalausky wrote:
Timon Gehrtimon.g...@gmx.ch wrote in message
news:j7u9ld$i8t$1...@digitalmars.com...
alias has never worked for instance members, even if they are accessible
at compile time.
Any idea if it's supposed to work?
I do not know. But if it was
I saw someone mention ZeroMQ in a subthread the other day. I watched a
few videos, and it looks to me like a good fit for D. The philosophies
matches pretty well: small, clean api, no bloat (only transport, no
protocols), very flexible setup/usage and message passing for communication.
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
On Saturday, October 22, 2011 17:04:57 Sean Silva wrote:
The main planned changes that I'm aware of are to
1. Make all containers final classes (Array and SList are currently
reference-
counted structs).
What is the rationale for
On Sunday, October 23, 2011 00:01:42 Sean Silva wrote:
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
On Saturday, October 22, 2011 17:04:57 Sean Silva wrote:
The main planned changes that I'm aware of are to
1. Make all containers final classes (Array and SList are
Timon Gehr timon.g...@gmx.ch wrote in message
news:j7ve1p$2rds$1...@digitalmars.com...
On 10/22/2011 11:03 PM, Nick Sabalausky wrote:
Timon Gehrtimon.g...@gmx.ch wrote in message
news:j7u9ld$i8t$1...@digitalmars.com...
alias has never worked for instance members, even if they are accessible
I think I've misunderstood something about .di files:
$ cat testDI.d
private int foo(){ return 1; }
$ dmd -H -c testDI.d
$ cat testDI.di
// D import file generated from 'testDI.d'
private int foo()
{
return 1;
}
Why does the .di file include the body of foo? In fact, why does it have foo
at
It's because the function is small enough to be inlineable, you can't
inline it if you've only got the prototype in the header file. So it's
optimizations at play.
On Sat, Oct 22, 2011 at 9:49 PM, Andrej Mitrovic andrej.mitrov...@gmail.com
wrote:
It's because the function is small enough to be inlineable, you can't
inline it if you've only got the prototype in the header file. So it's
optimizations at play.
Interestingly, it looks like GNU ld should
It could also be considered a little bit dangerous. E.g. you could
forget to regenerate header files after compilation and potentially
leave the user code with an old function body.
Thanks for all the answers.
Steven Schveighoffer:
a ~ b should technically be assignable to char[], since it's alread new
memory. We may yet get there with pure functions being able to implicit
cast to immutable.
Isn't that kind of the opposite?
Is this already in Bugzilla?
Some
Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message
news:mailman.331.1319338165.24802.digitalmars-d-le...@puremagic.com...
It's because the function is small enough to be inlineable, you can't
inline it if you've only got the prototype in the header file. So it's
optimizations at play.
Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message
news:mailman.333.1319338819.24802.digitalmars-d-le...@puremagic.com...
It could also be considered a little bit dangerous. E.g. you could
forget to regenerate header files after compilation and potentially
leave the user code with an
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
On Sunday, October 23, 2011 00:01:42 Sean Silva wrote:
They're all supposed to be reference types.
What prompted the decision for that? Doesn't that incur an extra heap
allocation for the
containers, and an extra level of
On Sunday, October 23, 2011 03:25:48 Sean Silva wrote:
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
On Sunday, October 23, 2011 00:01:42 Sean Silva wrote:
They're all supposed to be reference types.
What prompted the decision for that? Doesn't that incur an extra heap
Hi all,
I would be interested in having a closer look at gtkD.
Is there any documentation/tutorial available anywhere?
Thanks.
On Tue, 18 Oct 2011 14:44:24 +, %u wrote:
24 matches
Mail list logo