Bug? aliasing member of instance

2011-10-22 Thread Nick Sabalausky
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

Re: char and string with umlauts

2011-10-22 Thread Jim Danley
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,

Re: Bug? aliasing member of instance

2011-10-22 Thread Timon Gehr
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

Re: AI Challenge - Ants

2011-10-22 Thread maarten van damme
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

Re: opAssign for structs

2011-10-22 Thread Jesse Phillips
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

Re: AI Challenge - Ants

2011-10-22 Thread Jesse Phillips
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

Re: Looking for documentation of D's lower-level aspects.

2011-10-22 Thread Sean Silva
== 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

Re: Looking for documentation of D's lower-level aspects.

2011-10-22 Thread Jonathan M Davis
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

Re: Bug? aliasing member of instance

2011-10-22 Thread Nick Sabalausky
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?

Re: Bug? aliasing member of instance

2011-10-22 Thread Timon Gehr
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

ZeroMQ wrapper for D2

2011-10-22 Thread simendsjo
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.

Re: Looking for documentation of D's lower-level aspects.

2011-10-22 Thread Sean Silva
== 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

Re: Looking for documentation of D's lower-level aspects.

2011-10-22 Thread Jonathan M Davis
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

Re: Bug? aliasing member of instance

2011-10-22 Thread Nick Sabalausky
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

.di files have implementation??

2011-10-22 Thread Nick Sabalausky
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

Re: .di files have implementation??

2011-10-22 Thread Andrej Mitrovic
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.

Re: .di files have implementation??

2011-10-22 Thread Andrew Wiley
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

Re: .di files have implementation??

2011-10-22 Thread Andrej Mitrovic
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.

Re: Chars sorting and copies

2011-10-22 Thread bearophile
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

Re: .di files have implementation??

2011-10-22 Thread Nick Sabalausky
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.

Re: .di files have implementation??

2011-10-22 Thread Nick Sabalausky
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

Re: Looking for documentation of D's lower-level aspects.

2011-10-22 Thread Sean Silva
== 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

Re: Looking for documentation of D's lower-level aspects.

2011-10-22 Thread Jonathan M Davis
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

Re: gtkD problems and general gui question.

2011-10-22 Thread Adrian Mercieca
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: