Re: Implicit cast to immutable

2011-10-21 Thread Christophe
"Daniel Murphy" , dans le message (digitalmars.D.learn:30139), a écrit : > "bearophile" wrote in message > news:j7jepi$prp$1...@digitalmars.com... >> Daniel Murphy: >> >>> 2) >>> immutable(int[]) fun() { return new int[]; } // conversion happens here >>> immutable x = fun(); >>> >>> Bearophile's

Re: Chars sorting and copies

2011-10-21 Thread Kagamin
bearophile Wrote: > I have many strings and I want to use as associative array kay a sorted > concat of two strings (it's a signature of the two strings): > > > import std.algorithm; > void main() { > string a = "red"; > string b = "green"; > int[string] aa; > //aa[(a ~ b).sort]

Re: AI Challenge - Ants

2011-10-21 Thread Marco Leise
Am 21.10.2011, 06:31 Uhr, schrieb Jonathan M Davis : On Friday, October 21, 2011 06:22:43 Marco Leise wrote: Hi! I've been part of the team behind http://aichallenge.org/. We just started our next challenge about 30 minutes ago. This will be the first time that DMD 2.054 is supported there and

creating a proxy dll

2011-10-21 Thread maarten van damme
I'm trying to create a proxy dll( a dll forwarding all it's functions to another dll) I renamed the dll I want to replace (let's call him foo) to oldfoo.dll then I created the import library oldfoo.lib and created oldfoo.def with as syntax " LIBRARY "oldfoo" IMPORTS internalbar=oldfoo.bar

Re: AI Challenge - Ants

2011-10-21 Thread maarten van damme
great, I'm going to try it out. I've been looking for something fun to do while improving programming skill for ages and this looks great :)

Cannot use auto return while using class invariants

2011-10-21 Thread simendsjo
Is this a temporary restriction? class C { invariant() { } auto f() { return 1; } } Error: function C.f post conditions are not supported if the return type is inferred

Re: Cannot use auto return while using class invariants

2011-10-21 Thread Jonathan M Davis
On Friday, October 21, 2011 16:51 simendsjo wrote: > Is this a temporary restriction? > > class C { > invariant() { } > auto f() { > return 1; > } > } > > Error: function C.f post conditions are not supported if the return type > is inferred http://d.puremagic.com/issues/show_bug.cgi?id=5039

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

2011-10-21 Thread Sean Silva
== Quote from Trass3r (u...@known.com)'s article > Am 20.10.2011, 00:06 Uhr, schrieb Sean Silva : > > == Quote from Jesse Phillips (jessekphillip...@gmail.com)'s article > >> Right now D isn't ready to be used in this fashion > > > > It looks there's a more-or-less functional kernel written in D (a

Re: Cannot use auto return while using class invariants

2011-10-21 Thread simendsjo
On 22.10.2011 02:06, Jonathan M Davis wrote: On Friday, October 21, 2011 16:51 simendsjo wrote: Is this a temporary restriction? class C { invariant() { } auto f() { return 1; } } Error: function C.f post conditions are not supported if the return type is inferred http://d.puremagic.com/issu

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

2011-10-21 Thread Jonathan M Davis
On Saturday, October 22, 2011 01:20:05 Sean Silva wrote: > == Quote from Trass3r (u...@known.com)'s article > > > Am 20.10.2011, 00:06 Uhr, schrieb Sean Silva > > : > > > == Quote from Jesse Phillips (jessekphillip...@gmail.com)'s > > article > > > >> Right now D isn't ready to be used in this

opAssign for structs

2011-10-21 Thread Sean Silva
In the language definition , it says: > Struct assignment t=s is defined to be semantically equivalent to: > t = S.opAssign(s); > where opAssign is a member function of S: > S* opAssign(S s) > { ... bitcopy *this into tmp ... > ... bitc

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

2011-10-21 Thread Sean Silva
> You _can_ use D with no to minimal GC, but you have to be very careful. A good > chunk of the standard library would be completely unusable without the GC > (primarily anything which might allocate or append to an array), you have to > be very careful when using arrays (since appending to them wo

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

2011-10-21 Thread Jonathan M Davis
On Saturday, October 22, 2011 04:12:36 Sean Silva wrote: > > You _can_ use D with no to minimal GC, but you have to be very careful. > > A good chunk of the standard library would be completely unusable > > without the GC (primarily anything which might allocate or append to an > > array), you have