Re: Interesting rant about Scala's issues

2014-04-05 Thread Leandro Lucarella
bearophile, el 4 de April a las 18:39 me escribiste: Walter Bright: Thank you for the answers. Here's one: enum Index { A, B, C } T[Index.max] array; // Error: Index.max is not an int ... array[B] = t; // Error: B is not an int In the last months I've grown a moderate

I'm joining Facebook

2014-04-05 Thread Peter Alexander
Well, I didn't considering this D.announce worthy, but Andrei suggested I post the news. As the title suggests, after over 5 years in the games industry I've decided to shake things up a bit and join Facebook at their London office. Unfortunately, that's about all there is to say at the

Re: I'm joining Facebook

2014-04-05 Thread Rikki Cattermole
Good luck! Will definately be looking forward to hearing how the influence of D is spreading at Facebook over the next year or so.

Re: Mono-D 1.9 - opIndex/opSlice overload recognition + completion

2014-04-05 Thread Alexander Bothe
On Friday, 4 April 2014 at 19:20:18 UTC, Adam Wilson wrote: If that's not possible then it's still nice to know that I am working with a type and not an identifier. I furthermore fixed some reference finding + highlighting bugs, some NREs, an SO regression and some further bugs, they're all

Re: I'm joining Facebook

2014-04-05 Thread Paulo Pinto
Am 05.04.2014 12:13, schrieb Peter Alexander: Well, I didn't considering this D.announce worthy, but Andrei suggested I post the news. As the title suggests, after over 5 years in the games industry I've decided to shake things up a bit and join Facebook at their London office. Unfortunately,

Re: I'm joining Facebook

2014-04-05 Thread Dicebot
Promising! Congratulations and looking forward to more Facebook + D announcements :)

Re: I'm joining Facebook

2014-04-05 Thread Andrej Mitrovic
On 4/5/14, Peter Alexander peter.alexander...@gmail.com wrote: Well, I didn't considering this D.announce worthy, but Andrei suggested I post the news. Congrats! As the title suggests, after over 5 years in the games industry I've decided to shake things up a bit and join Facebook at their

Re: Interesting rant about Scala's issues

2014-04-05 Thread Marc Schütz
On Friday, 4 April 2014 at 01:54:16 UTC, Ben Boeckel wrote: There is *zero* rationale as to why this would be a compilable implementation of comparison: int compare(int a, int b) { return a * b; } The fact that this compiles when used as a comparison is *insane* when you take

Re: Interesting rant about Scala's issues

2014-04-05 Thread Timon Gehr
On 04/03/2014 04:45 AM, Walter Bright wrote: On 4/2/2014 6:55 PM, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg at about 44:00: I begged them not to do them [AST macros]. :-) (This is a misquote.)

Re: Interesting rant about Scala's issues

2014-04-05 Thread Walter Bright
On 4/5/2014 2:40 AM, Leandro Lucarella wrote: enum Symbolic { Dogs, Cars, Trees }// not implicitly casteable (and // maybe not even expose the // internal value) ? struct Symbolic { private static struct

Re: I'm joining Facebook

2014-04-05 Thread Walter Bright
On 4/5/2014 3:13 AM, Peter Alexander wrote: Huge thanks to Andrei for referring me, and to Facebook for hiring me! Congratulations!

Re: Interesting rant about Scala's issues

2014-04-05 Thread Walter Bright
On 4/5/2014 10:10 AM, Timon Gehr wrote: On 04/03/2014 04:45 AM, Walter Bright wrote: On 4/2/2014 6:55 PM, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg at about 44:00: I begged them not to do them [AST macros]. :-) (This

Re: Interesting rant about Scala's issues

2014-04-05 Thread Seth Tisue
On Saturday, 5 April 2014 at 18:47:50 UTC, Walter Bright wrote: In response to a question about macros reflection: I begged them not to, not to just export the compiler to I begged them I begged them not to do it. A reboot is in progress on this, too: http://scalareflect.org

Re: Interesting rant about Scala's issues

2014-04-05 Thread Leandro Lucarella
Walter Bright, el 5 de April a las 11:04 me escribiste: On 4/5/2014 2:40 AM, Leandro Lucarella wrote: enum Symbolic { Dogs, Cars, Trees }// not implicitly casteable (and // maybe not even expose the // internal value)

Re: Interesting rant about Scala's issues

2014-04-05 Thread Walter Bright
On 4/5/2014 6:28 PM, Leandro Lucarella wrote: Walter Bright, el 5 de April a las 11:04 me escribiste: Of course, you can hide all this in a template. Well, you can emulate enums as they are now with structs too, so that doesn't change anything in the argument about why to provide syntax

Re: Problems with dlang.org ?

2014-04-05 Thread uri
On Saturday, 5 April 2014 at 03:06:30 UTC, cmplx wrote: Why all the links not opening ? Forbidden You don't have permission to access /download.html on this server. Forbidden You don't have permission to access /comparison.html on this server. Forbidden You don't have permission to

Re: Poll - How long have you been in D?

2014-04-05 Thread Paolo Invernizzi
On Friday, 4 April 2014 at 02:10:15 UTC, dnewbie wrote: Please vote now! http://www.easypolls.net/poll.html?p=533e10e4e4b0edddf89898c5 See also results from previous years: - http://d.darktech.org/2012.png - http://d.darktech.org/2013.png I've checked the repositories, D in production since

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Ola Fosheim Grøstad
On Friday, 4 April 2014 at 22:17:45 UTC, Dicebot wrote: #2 should not compile. D currently does not have any notion of namespaces other than modules / aggregates and I am against introducing those just for the sake of interfacing with C++. If you want to interface with C++ you should do it

Re: Problems with dlang.org ?

2014-04-05 Thread Théo.Bueno
On Saturday, 5 April 2014 at 03:06:30 UTC, cmplx wrote: Why all the links not opening ? Forbidden Same here ... forum is online but main website is unavailable.

Re: sfloat24 Floating Point DataType - Request for Comments

2014-04-05 Thread ponce
Wow many questions. I'll try my best but I'm not the most knowledgeable person out there. On Friday, 4 April 2014 at 01:20:43 UTC, Bill Buckels wrote: On Thursday, 3 April 2014 at 21:06:52 UTC, Andrej Mitrovic wrote: This seems out of place? What about D for .NET? That was really my

Re: Linker not working under dmd

2014-04-05 Thread Mike Wey
On 04/05/2014 02:28 AM, Adam D. Ruppe wrote: I had this problem too with the new dmd version on a CentOS server. My solution was to link it manually. First, run your dmd command with -v at the end to get the verbose output. The last line it outputs will be the linking command. Copy/paste that

Re: Problems with dlang.org ?

2014-04-05 Thread Christof Schardt
cmplx magii...@mail.ru schrieb im Newsbeitrag news:jvdtaskuqavqdiucf...@forum.dlang.org... Why all the links not opening ? Still down here. Is there another way to access the phobos doc?

Re: Problems with dlang.org ?

2014-04-05 Thread uri
On Saturday, 5 April 2014 at 11:22:03 UTC, Christof Schardt wrote: cmplx magii...@mail.ru schrieb im Newsbeitrag news:jvdtaskuqavqdiucf...@forum.dlang.org... Why all the links not opening ? Still down here. Is there another way to access the phobos doc? I can still access Phobos on the web

Re: Problems with dlang.org ?

2014-04-05 Thread uri
On Saturday, 5 April 2014 at 11:31:41 UTC, uri wrote: On Saturday, 5 April 2014 at 11:22:03 UTC, Christof Schardt wrote: cmplx magii...@mail.ru schrieb im Newsbeitrag news:jvdtaskuqavqdiucf...@forum.dlang.org... Why all the links not opening ? Still down here. Is there another way to access

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Dicebot
On Saturday, 5 April 2014 at 08:42:27 UTC, Ola Fosheim Grøstad wrote: On Friday, 4 April 2014 at 22:17:45 UTC, Dicebot wrote: #2 should not compile. D currently does not have any notion of namespaces other than modules / aggregates and I am against introducing those just for the sake of

Re: Forcing weak-pure

2014-04-05 Thread Artur Skawina
On 03/25/14 14:30, Steven Schveighoffer wrote: Of course naturally, with all things this low-level, we have to make decisions as to what is *provably* @safe/pure/nothrow, and what is *logically* @safe/pure/nothrow. The most obvious example is memory allocation -- It is technically not pure

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Ola Fosheim Grøstad
On Saturday, 5 April 2014 at 12:07:36 UTC, Dicebot wrote: D has own tools to disambugate symbols. Introducing new ones is equivalent to admitting D module system does not work by design. I think it is primarily a notation issue. Should the notation help you discern what is C++ and what is D,

Re: Static override?

2014-04-05 Thread Atila Neves
That works too. I think I like the solution above better for now, I just have to figure out how to generalise it into a template mixin so I don't have to write it out over and over again. Atila On Friday, 4 April 2014 at 14:24:55 UTC, Dicebot wrote: On Friday, 4 April 2014 at 09:22:16 UTC,

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Dicebot
On Saturday, 5 April 2014 at 12:30:28 UTC, Ola Fosheim Grøstad wrote: Should the notation help you discern what is C++ and what is D, or do you have to memorize symbols? How much extra notational work is it acceptable to impose on the programmer? It shouldn't. The fact how entity is exposed

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Ola Fosheim Grøstad
On Saturday, 5 April 2014 at 12:58:54 UTC, Dicebot wrote: It shouldn't. The fact how entity is exposed via some external binary interface should not have any notable impact on D side of things (unless you dwell into ABI realm). This is a design philosophical issue, you can make it normative

Re: Problems with dlang.org ?

2014-04-05 Thread Christof Schardt
uri gm...@gmail.com schrieb im Newsbeitrag news:utskrusuysuoimrnh...@forum.dlang.org... On Saturday, 5 April 2014 at 11:31:41 UTC, uri wrote: On Saturday, 5 April 2014 at 11:22:03 UTC, Christof Schardt wrote: cmplx magii...@mail.ru schrieb im Newsbeitrag

Re: Proper C Pointer Binding

2014-04-05 Thread Róbert László Páli
Thanks for the suggestions! I think then I will stay with a wrapping struct. How would I make the extern C functions invisible for other sources? extern (C) c_ulong loadFont(char * path); extern (C) void render(c_ulong font, char * text); extern (C) void destroyFont(c_ulong font); struct Font

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Timon Gehr
On 04/03/2014 09:55 PM, Andrei Alexandrescu wrote: ... Anyhow de gustibus. There's good and bad taste.

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Ola Fosheim Grøstad
Not that I ever do this, but I think you need to deal with this C++ construct: namespace exposed_ns { using namespace internal_ns_2134zxdssdffrandomblablah; using namespace internal_ns_2634zasdsfsdrandomblablah; using namespace internal_ns_2993adsfadsfrandomblablah; } To do this in D you

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Dicebot
On Saturday, 5 April 2014 at 13:11:27 UTC, Ola Fosheim Grøstad wrote: On Saturday, 5 April 2014 at 12:58:54 UTC, Dicebot wrote: It shouldn't. The fact how entity is exposed via some external binary interface should not have any notable impact on D side of things (unless you dwell into ABI

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Ola Fosheim Grøstad
On Saturday, 5 April 2014 at 15:24:32 UTC, Dicebot wrote: This is very practical thing. By introducing special constructs to support some foreign language you open the can of worms. Yep, but I believe C++ is increasingly going to replace C as a language for writing basic libraries and engines

Re: Problems with dlang.org ?

2014-04-05 Thread Vladimir Panteleev
On Saturday, 5 April 2014 at 03:06:30 UTC, cmplx wrote: Why all the links not opening ? Appears to be fixed now.

Re: Problems with dlang.org ?

2014-04-05 Thread Andrei Alexandrescu
On 4/4/14, 8:06 PM, cmplx wrote: Why all the links not opening ? Apologies, it was a runaway chmod. Fixed now. Andrei

Re: Proper C Pointer Binding

2014-04-05 Thread Marc Schütz
On Saturday, 5 April 2014 at 13:55:27 UTC, Róbert László Páli wrote: When released as a library I would simply not put them in the di Files, but I do not really want to use di-s for developing the lib, but generate them for release. Can I declare these extern C functions inline the methods using

Re: Poll - How long have you been in D?

2014-04-05 Thread Meta
On Friday, 4 April 2014 at 02:10:15 UTC, dnewbie wrote: Please vote now! http://www.easypolls.net/poll.html?p=533e10e4e4b0edddf89898c5 See also results from previous years: - http://d.darktech.org/2012.png - http://d.darktech.org/2013.png I'd been aware of D since around 2008, but didn't

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Mason McGill
On Saturday, 5 April 2014 at 15:24:32 UTC, Dicebot wrote: This is very practical thing. By introducing special constructs to support some foreign language you open the can of worms. Where does one stop? Should we also expect adding some new idioms for better JNI support? Or Python? I can't see

Re: (DO NOT POST TO HACKERNEWS/REDDIT/ETC.) RFC for a Community Newsletter for D: What's New in D Draft #1

2014-04-05 Thread Dāvis
On Thursday, 3 April 2014 at 16:07:06 UTC, Meta wrote: On Wednesday, 2 April 2014 at 14:31:49 UTC, Wyatt wrote: This is a good base. In general, I would suggest not shying away from subheadings. It gives you more opportunities to catch the eye and tends to allow readers to see the parts that

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Walter Bright
On 4/5/2014 8:24 AM, Dicebot wrote: This is very practical thing. By introducing special constructs to support some foreign language you open the can of worms. Where does one stop? Should we also expect adding some new idioms for better JNI support? Or Python? I can't see any reason why C++ has

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Walter Bright
On 4/2/2014 3:07 PM, Walter Bright wrote: One downside of this proposal is that if we ever (perish the thought!) attempted to interface to C++ templates, this design would preclude that. Yes, this seems to be a fatal flaw. Another design that has evolved from these discussions and my

Re: Poll - How long have you been in D?

2014-04-05 Thread Nick Sabalausky
On 4/4/2014 8:51 PM, Simen Kjærås wrote: On 2014-04-04 02:10, dnewbie wrote: Please vote now! http://www.easypolls.net/poll.html?p=533e10e4e4b0edddf89898c5 See also results from previous years: - http://d.darktech.org/2012.png - http://d.darktech.org/2013.png These things make me feel old.

From next C#

2014-04-05 Thread bearophile
Upcoming features in C# (the text contains some extraneous chars, like in the 0b0010\_1110; literal): https://gist.github.com/anonymous/9997622 Declaring out arguments at the calling point is nice, but returning a tuple as in Python/Haskell is better: GetCoordinates(out var x, out var y);

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Tove
On Saturday, 5 April 2014 at 20:47:29 UTC, Walter Bright wrote: On 4/2/2014 3:07 PM, Walter Bright wrote: One downside of this proposal is that if we ever (perish the thought!) attempted to interface to C++ templates, this design would preclude that. Yes, this seems to be a fatal flaw.

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Walter Bright
On 4/5/2014 2:31 PM, Tove wrote: How could this common pattern look? std::string boost::fun(std::string arg) alias cpp= extern (C++, namespace = std); alias boost = extern (C++, namespace = boost); cpp.string boost.fun(cpp.string arg) ? extern (C++, namespace = std) { struct string

A very fast linker to replace gcc's ld

2014-04-05 Thread Asman01
Today I've found a good alternative to slow gcc's linker: gold. Written by Google in C++ it's a linker writen for large code bases with C++ in mind. The author claims it's about 5 times fast than gcc's one. It does support ELF only and UNIX-like symtem I think it's enough to dmd on linux or

Re: [OT] Good alternative to StartSSL?

2014-04-05 Thread Nick Sabalausky
On 4/5/2014 1:54 AM, Martin Nowak wrote: On 04/02/2014 08:34 AM, Nick Sabalausky wrote: Sorry for asking this here, but I'm in a bit of a bind: Anyone know of a decent alternative to StartSSL? No free alternative that I know of. Digging around, I found http://www.cacert.org/ which I think I

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Michel Fortin
On 2014-04-05 20:47:32 +, Walter Bright newshou...@digitalmars.com said: On 4/2/2014 3:07 PM, Walter Bright wrote: One downside of this proposal is that if we ever (perish the thought!) attempted to interface to C++ templates, this design would preclude that. Yes, this seems to be a

Re: A very fast linker to replace gcc's ld

2014-04-05 Thread Joakim
On Saturday, 5 April 2014 at 21:47:33 UTC, Asman01 wrote: Today I've found a good alternative to slow gcc's linker: gold. Written by Google in C++ it's a linker writen for large code bases with C++ in mind. The author claims it's about 5 times fast than gcc's one. It does support ELF only and

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Walter Bright
On 4/5/2014 2:55 PM, Michel Fortin wrote: I like this idea. But... should this potentially useful thing really be restricted to extern C++ things? I've seen at least one attempt to create a namespace using what D currently offers [1], and frankly something like the above would make much more

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread bearophile
Michel Fortin: Here's a suggestion: @namespace A.B { // can create two levels at once, yeah! void foo(); void bar(); } @namespace C { void foo(); } Make those C++ declarations, it does not look too foreign

Re: A very fast linker to replace gcc's ld

2014-04-05 Thread John Colvin
On Saturday, 5 April 2014 at 22:30:28 UTC, Joakim wrote: on Arch that's gold. it is? Not for me, unless I'm missing something.

Re: A very fast linker to replace gcc's ld

2014-04-05 Thread Asman01
On Saturday, 5 April 2014 at 22:30:28 UTC, Joakim wrote: On Saturday, 5 April 2014 at 21:47:33 UTC, Asman01 wrote: Today I've found a good alternative to slow gcc's linker: gold. Written by Google in C++ it's a linker writen for large code bases with C++ in mind. The author claims it's about

Re: A very fast linker to replace gcc's ld

2014-04-05 Thread deadalnix
On Saturday, 5 April 2014 at 22:30:28 UTC, Joakim wrote: Dmd already uses whatever the system linker is and on Arch that's gold. The Android NDK also uses gold by default, though they also provide the original bfd ld and a newer llvm-based linker started by MediaTek, mclinker:

Re: A very fast linker to replace gcc's ld

2014-04-05 Thread Asman01
On Sunday, 6 April 2014 at 00:26:12 UTC, deadalnix wrote: On Saturday, 5 April 2014 at 22:30:28 UTC, Joakim wrote: Dmd already uses whatever the system linker is and on Arch that's gold. The Android NDK also uses gold by default, though they also provide the original bfd ld and a newer

Re: A very fast linker to replace gcc's ld

2014-04-05 Thread Andrei Alexandrescu
On 4/5/14, 2:47 PM, Asman01 wrote: Today I've found a good alternative to slow gcc's linker: gold. Written by Google in C++ it's a linker writen for large code bases with C++ in mind. The author claims it's about 5 times fast than gcc's one. It does support ELF only and UNIX-like symtem I think

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Michel Fortin
On 2014-04-05 20:47:32 +, Walter Bright newshou...@digitalmars.com said: Yes, this seems to be a fatal flaw. Another design that has evolved from these discussions and my discussions with Andrei on it: extern (C++, namespace = A.B) { void foo(); void bar(); } extern (C++,

Dream Feature Regarding Default Arguments

2014-04-05 Thread Nick Sabalausky
I realize this isn't the time for such a thing to be added to D, but I thought I'd put the idea out there, FWIW: I find myself frequently needing to design APIs that work like this: func( [optionalFoo], [optionalBar] ) Typically, that's not permitted in C-style languages, including D.

Re: Dream Feature Regarding Default Arguments

2014-04-05 Thread Nick Sabalausky
On 4/5/2014 9:26 PM, Nick Sabalausky wrote: It would be *fantastic* if D recognized the disambiguation of using incompatible types and permitted this: interface Foo {} interface Bar {} class FooBar : Foo, Bar {} void func(Foo foo=someFoo, Bar bar=someBar) {...}

Get millisecond difference between 2 times

2014-04-05 Thread MrOverkill
Dear sirs and madams and... Other things on internet forums, I am attempting to write a program, and I was wondering how to get the time difference between point a and point b. For example long a, b; int thingy; this() { a = 0; // Or whatever function should be used to set an initial

Re: Get millisecond difference between 2 times

2014-04-05 Thread safety0ff
On Sunday, 6 April 2014 at 02:12:41 UTC, MrOverkill wrote: Dear sirs and madams and... Other things on internet forums, I am attempting to write a program, and I was wondering how to get the time difference between point a and point b. You should look into:

Re: Specifying C++ symbols in C++ namespaces

2014-04-05 Thread Walter Bright
On 4/5/2014 6:26 PM, Michel Fortin wrote: What if you also have a C++ foo at global scope? It'll work exactly the same as import does. module cpptest; extern (C++) void foo(); extern (C++, namespace = A) void foo(); foo(); // ambiguous A.foo(); // works

Re: Get millisecond difference between 2 times

2014-04-05 Thread MrOverkill
On Sunday, 6 April 2014 at 02:31:29 UTC, safety0ff wrote: On Sunday, 6 April 2014 at 02:12:41 UTC, MrOverkill wrote: Dear sirs and madams and... Other things on internet forums, I am attempting to write a program, and I was wondering how to get the time difference between point a and point b.

Re: Table lookups - this is pretty definitive

2014-04-05 Thread Marco Leise
Am Wed, 02 Apr 2014 18:05:32 -0700 schrieb Walter Bright newshou...@digitalmars.com: On 4/2/2014 3:06 PM, bearophile wrote: Walter Bright: I don't see why not. Note that we couldn't do this for extern(C) functions, or variadics, or caller functions with parameters that need

Re: They are not the same

2014-04-05 Thread John Colvin
On Saturday, 5 April 2014 at 01:28:06 UTC, bearophile wrote: Can you spot the difference between foo1 and foo2? import std.algorithm: map; import std.range: iota; void foo1(in int[] a, in int[] b) pure { int[] r; foreach (immutable i; 0 .. a.length) r ~= (i % 2) ? a[i] : b[i];

Re: They are not the same

2014-04-05 Thread bearophile
John Colvin: I think there's an argument that this should work, on the grounds that the context pointer is just another argument and therefore the lambda can be weakly pure. Was this discussed in the forum? Do you think you can ask for an enhancement in Bugzilla? Bye, bearophile

Some issues (bugs?) with generated header files

2014-04-05 Thread Andre
Hi, i want to generate header (di) files for a library I developed and faced some issues. The project structure is: source -wba --com ---defintions.d ---... --dispatcher.d --... --package.d MonoDevelop generated following statement for me: C:\D\dmd2\windows\bin\dmd.exe -debug -gc

Re: Some issues (bugs?) with generated header files

2014-04-05 Thread evilrat
On Saturday, 5 April 2014 at 10:00:13 UTC, Andre wrote: Hi, i want to generate header (di) files for a library I developed and faced some issues. The project structure is: source -wba --com ---defintions.d ---... --dispatcher.d --... --package.d MonoDevelop generated following statement for

Re: Some issues (bugs?) with generated header files

2014-04-05 Thread evilrat
On Saturday, 5 April 2014 at 10:00:13 UTC, Andre wrote: 2) property methods doesn't work with header files. For this coding: @property docHostUIHandler() { return this._docHostUIHandler; } This di coding was created: @property docHostUIHandler();

Re: Some issues (bugs?) with generated header files

2014-04-05 Thread Andre
Am 05.04.2014 12:49, schrieb evilrat: i have little info about this, but let me clear something for you. - interface generation is outdated/broken - .di files should be avoided now, this is why import looking for .d only, but idk why. - to avoid @property issue you can try adding export

Re: Some issues (bugs?) with generated header files

2014-04-05 Thread evilrat
On Saturday, 5 April 2014 at 10:55:19 UTC, evilrat wrote: // recommended, manual type @property HostUIHandlerType() { return this._docHostUIHandler; } oops. this of course should be like normal function.

Re: When this will be freed?

2014-04-05 Thread Jacob Carlborg
On 2014-04-04 15:25, Marc Schütz schue...@gmx.net wrote: This is unfortunately only true on x86 32-bit. For x86_64, the calling conventions (MS, SysV [1]) say that the first few parameters are passed in registers, and the same is probably true for other architectures. I'm not so familiar with

Re: When this will be freed?

2014-04-05 Thread Marc Schütz
On Saturday, 5 April 2014 at 11:28:36 UTC, Jacob Carlborg wrote: On 2014-04-04 15:25, Marc Schütz schue...@gmx.net wrote: This is unfortunately only true on x86 32-bit. For x86_64, the calling conventions (MS, SysV [1]) say that the first few parameters are passed in registers, and the same

Why cant I place a stuct on a funciton stack without blitting it

2014-04-05 Thread Byron
And why is RAII verbose? I have a transactional struct: struct Tans { bool committed; this(..) { committed = false; .. set up } void commit() { .. commit committed = true; } ~this() { if(!committed) { .. roll back commit } } } I want to use this in a lot of

Re: Why cant I place a stuct on a funciton stack without blitting it

2014-04-05 Thread Byron
On Sat, 05 Apr 2014 15:40:13 +, Byron wrote: And why is RAII verbose? I have a transactional struct: struct Tans { bool committed; this(..) { committed = false; .. set up } void commit() { .. commit committed = true; } ~this() { if(!committed) {

Re: Why cant I place a stuct on a funciton stack without blitting it

2014-04-05 Thread Ali Çehreli
On 04/05/2014 08:48 AM, Byron wrote: Tans trans(...); would not work It works in C++. The following is one way of constructing in D: Tans trans = Tans(42); Ali

Re: porting GCC macro to D

2014-04-05 Thread ketmar
A regular function would work too: alas, no inline guarantee. and speed is critical there.

Re: Why cant I place a stuct on a funciton stack without blitting it

2014-04-05 Thread monarch_dodra
On Saturday, 5 April 2014 at 15:40:13 UTC, Byron wrote: auto tans = Tans(...); /// calls destructor on the blit? This does NOT call postblit nor destructor. It's an actual declaration syntax. auto tans = Tans.init; Will not call postblit either. Finally: auto tans =

Re: When this will be freed?

2014-04-05 Thread Jacob Carlborg
On 2014-04-05 15:08, Marc Schütz schue...@gmx.net wrote: Yes, but it doesn't necessarily contain `s` anymore. Today's compilers are intelligent enough to see that `s` is never used after the function call, and therefore don't even allocate a stack slot for it. Ok, I see. `foo` could be

Re: They are not the same

2014-04-05 Thread Timon Gehr
On 04/05/2014 11:53 AM, bearophile wrote: John Colvin: I think there's an argument that this should work, on the grounds that the context pointer is just another argument and therefore the lambda can be weakly pure. Was this discussed in the forum? I've been bringing this up time and time

Re: They are not the same

2014-04-05 Thread bearophile
Timon Gehr: It's a plain bug. In fact, you have commented on it: https://d.puremagic.com/issues/show_bug.cgi?id=9148 That issue is significant. Thank you Timon. Apparently my memory is not very good :-) Bye, bearophile

Re: They are not the same

2014-04-05 Thread Artur Skawina
On 04/05/14 21:51, Timon Gehr wrote: On 04/05/2014 11:53 AM, bearophile wrote: John Colvin: I think there's an argument that this should work, on the grounds that the context pointer is just another argument and therefore the lambda can be weakly pure. Was this discussed in the forum?

Query Context at Source File and Offset in DMD

2014-04-05 Thread Nordlöw
I'm working on a feature in DMD to query lexical, syntactic and semantic context at a given byte offset in a given source file. In the long run my vision is to add libclang-like functionality directly into DMD and a specific mode in DMD that just starts up DMD to query some information at a

Re: They are not the same

2014-04-05 Thread Timon Gehr
On 04/05/2014 10:33 PM, Artur Skawina wrote: On 04/05/14 21:51, Timon Gehr wrote: On 04/05/2014 11:53 AM, bearophile wrote: John Colvin: I think there's an argument that this should work, on the grounds that the context pointer is just another argument and therefore the lambda can be weakly

running my program with shared libraries

2014-04-05 Thread Harpo
Hello all! I am having trouble running a program I am writing without using a script. Here is what I am using to compile. dmd main.d fileloader.d tokenizer.d globals.d namefunctions.d misc.d math.d questions.d functions.d -L-ldl -gc Then in a runner script I have this. LD_LIBRARY_PATH=.

How to obtain a list of all the elements of an enum?

2014-04-05 Thread dnspies
If I have an enum: enum x {A : 1, B : 2, C : 100}; How can I get a list of all of its elements? x.get_list() (returns [A, B, C])

Re: Does D have reflection?

2014-04-05 Thread Adam D. Ruppe
On Sunday, 6 April 2014 at 02:25:32 UTC, dnspies wrote: For instance, could I write a generic function to reconstruct any object of any type from a JSON object? Yes, you can use __traits(allMembers) at compile time to build a runtime function that does the setting. .tupleof can do it too,

Re: How to obtain a list of all the elements of an enum?

2014-04-05 Thread Mike
On Sunday, 6 April 2014 at 02:18:57 UTC, dnspies wrote: If I have an enum: enum x {A : 1, B : 2, C : 100}; How can I get a list of all of its elements? x.get_list() (returns [A, B, C]) I believe this is what you're looking for:

Re: How to do a checked cast from base-type to enum-type

2014-04-05 Thread Chris Nicholson-Sauls
On Sunday, 6 April 2014 at 02:21:35 UTC, dnspies wrote: Is there a way to do a checked cast from a base type to an enum-type (so that an exception is thrown if it fails)? ie something like enum x : dchar { A : 'a', B : 'b', C : 'c' }; x get_x() { dchar r = get_char(); return cast(x)r;

Re: running my program with shared libraries

2014-04-05 Thread Adam D. Ruppe
On Sunday, 6 April 2014 at 00:12:00 UTC, Harpo wrote: Then in a runner script I have this. LD_LIBRARY_PATH=. ./main This kind of thing is common in Linux, in fact, a lot of Linux software consists of a runner script that sets LD_LIBRARY_PATH and a separate binary file and its library .so

Empty array and AA literals

2014-04-05 Thread dnspies
What's the syntax for a new empty dynamic array or associative array? Every time I want to set a AA, I have to say: (supposing I already have some variable int[int] aa which points to the wrong one) int[int] throwaway; aa = throwaway; Is there a way to say something like: aa = new

Re: Empty array and AA literals

2014-04-05 Thread Adam D. Ruppe
You can just set it to null. Then, next time you add anything to it, a new one will be automatically created.

Re: Empty array and AA literals

2014-04-05 Thread dnspies
On Sunday, 6 April 2014 at 03:23:17 UTC, Adam D. Ruppe wrote: You can just set it to null. Then, next time you add anything to it, a new one will be automatically created. What about if I have a 2D array (ie int[][]) and I want to append an empty int[] on the end? Will this work? int[][]

Set differences

2014-04-05 Thread Josh
Can anyone please explain why this works: auto numbers = sequence!(n)(); auto trimmed = setDifference(setDifference(numbers, sequence!(n * a[0])(2)), sequence!(n * a[0])(3)); but this doesn't? auto numbers = sequence!(n)(); auto trimmed = setDifference(numbers,

[Issue 12522] New: (void delegate() f) is not callable using argument types (void function() pure nothrow @safe)

2014-04-05 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12522 Summary: (void delegate() f) is not callable using argument types (void function() pure nothrow @safe) Product: D Version: D2 Platform: All OS/Version: All

[Issue 12523] New: false type deduced with inout append

2014-04-05 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12523 Summary: false type deduced with inout append Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal

[Issue 12523] false type deduced with inout append

2014-04-05 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12523 --- Comment #1 from Martin Nowak c...@dawg.eu 2014-04-05 02:30:24 PDT --- The const is added here. https://github.com/D-Programming-Language/dmd/blob/aac09e539f7c3d9bd882d05f5c331f64733c6a29/src/statement.c#L1602 -- Configure issuemail:

  1   2   >