Re: A different vector op

2011-07-17 Thread Wilfried Kirschenmann
On Sat, Jul 2, 2011 at 04:12, bearophile wrote: > Currently this is not allowed, but do you desire a feature like this? > > > struct Foo { >    int x, y; >    int[100] array; > } > void main() { >    auto foos = new Foo[100]; >    foos[].y += 10; // *** > } In fact, I would be more interested in

Re: std.concurrency.spawn does not accept delegates

2011-07-17 Thread Jonathan M Davis
On Sunday 17 July 2011 19:29:02 teo wrote: > It looks like std.concurrency.spawn does not accept delegates. Is there > any reason for that? Probably because it would have to accept a delegate where every variable that it had access too outside of its own scope was immutable, and I don't think th

Re: Calling D from C++

2011-07-17 Thread Johann MacDonagh
On 7/17/2011 3:53 PM, Loopback wrote: On 2011-07-17 21:45, Loopback wrote: Hello! As of my understanding you can write usable c libraries in D by using extern(C). The problem is that I haven't found any other threads asking the same question about C++ (since extern for c++ exists as well). So I

Re: Calling D from C++

2011-07-17 Thread Loopback
On 2011-07-17 21:45, Loopback wrote: Hello! As of my understanding you can write usable c libraries in D by using extern(C). The problem is that I haven't found any other threads asking the same question about C++ (since extern for c++ exists as well). So I have two questions, is it possible to

Calling D from C++

2011-07-17 Thread Loopback
Hello! As of my understanding you can write usable c libraries in D by using extern(C). The problem is that I haven't found any other threads asking the same question about C++ (since extern for c++ exists as well). So I have two questions, is it possible to write a dll in D usable in c++ code, a

std.concurrency.spawn does not accept delegates

2011-07-17 Thread teo
It looks like std.concurrency.spawn does not accept delegates. Is there any reason for that?

Re: Scope of lambdas and closures

2011-07-17 Thread Daniel Murphy
That would be http://d.puremagic.com/issues/show_bug.cgi?id=2634 "Rolv Seehuus" wrote in message news:ivug6b$o7o$1...@digitalmars.com... > Hi all, > > First post - I'm learning D, 10yrs exp. with C++. > > While trying to generate a static table of functions using lambdas compile > time using mi

Scope of lambdas and closures

2011-07-17 Thread Rolv Seehuus
Hi all, First post - I'm learning D, 10yrs exp. with C++. While trying to generate a static table of functions using lambdas compile time using mixins, I ran in to this little (for me) conundrum. Given that we have this function available: static void foo(){ writefln("Hohum"); } This compi

Re: Comparing floating point: == vs is

2011-07-17 Thread Daniel Murphy
"Jonathan M Davis" wrote in message news:mailman.1708.1310882400.14074.digitalmars-d-le...@puremagic.com... > I'm on Linux. > > I need to do whatever will result in the correct value with == if that is > at > all possible. The question the is twofold: > > 1. How to make it so that swapping the e

Re: is there such a thing as a "static" function template that isn't inside of a class?

2011-07-17 Thread Jacob Carlborg
On 2011-07-16 23:34, Christopher the Magnificent wrote: I see this code AT THE TOP (MODULE) LEVEL of one of Michel Fortin's D/Objective-C bridge source files and I'm trying to wrap my head around it. /** Wrap an object instance within an object of this class. */ static Object objcCreateWrapper(T