Re: enum scope

2014-06-08 Thread Jacob Carlborg via Digitalmars-d
On 08/06/14 21:53, Walter Bright wrote: I see, so it is using the type of the lvalue to guide the symbol resolution of the rvalue. Andrei had proposed something like this a few years ago, but I talked him out of it :-) (I felt it would play havoc with overload resolution.) I'm pretty sure Sw

Re: [OT] Extra time spent

2014-06-08 Thread Andrei Alexandrescu via Digitalmars-d
On 6/8/14, 7:47 AM, safety0ff wrote: On Sunday, 8 June 2014 at 13:50:47 UTC, Andrei Alexandrescu wrote: Yah. One well-known fact about Facebook is it has an open layout which can be quite distracting. One less-known fact is it makes high quality headphones (both in-ear (Klipsch) and over-the-ea

Re: Linking libraries that are written in C++ with a C interface

2014-06-08 Thread Gerry via Digitalmars-d
On Monday, 9 June 2014 at 02:39:36 UTC, Paul O'Neil wrote: Do you need to link to a C++ runtime library? That might be expected to be dynamic even if you compile a static C++ library. Paul On 06/08/2014 10:12 PM, Gerry wrote: On Monday, 9 June 2014 at 01:47:57 UTC, Gerry wrote: Hello All,

Re: Linking libraries that are written in C++ with a C interface

2014-06-08 Thread Paul O'Neil via Digitalmars-d
Do you need to link to a C++ runtime library? That might be expected to be dynamic even if you compile a static C++ library. Paul On 06/08/2014 10:12 PM, Gerry wrote: On Monday, 9 June 2014 at 01:47:57 UTC, Gerry wrote: Hello All, I'm trying to link a library that is written in C++ that pro

Re: Linking libraries that are written in C++ with a C interface

2014-06-08 Thread Gerry via Digitalmars-d
On Monday, 9 June 2014 at 01:47:57 UTC, Gerry wrote: Hello All, I'm trying to link a library that is written in C++ that provides a C interface. Unfortunately the lib is proprietary, so I can't include the code. I'm getting undefined references to new and delete operators etc. This links fin

Linking libraries that are written in C++ with a C interface

2014-06-08 Thread Gerry via Digitalmars-d
Hello All, I'm trying to link a library that is written in C++ that provides a C interface. Unfortunately the lib is proprietary, so I can't include the code. I'm getting undefined references to new and delete operators etc. This links fine with gcc. I'm using the following command line to b

Re: dlang website: remove that quick try editor

2014-06-08 Thread John via Digitalmars-d
On Sunday, 8 June 2014 at 21:46:15 UTC, Martin Nowak wrote: Yeah, it's really slow right now. Please contact the DPaste people and help to find out why. http://dpaste.dzfl.pl/home Thanks for the link. I wrote to them through the message option on their contact page: Hi guys, I understand

Re: Need review: explicit package protection

2014-06-08 Thread Joseph Rushton Wakeling via Digitalmars-d
On 08/06/14 23:47, Dicebot via Digitalmars-d wrote: Of course it is possible but I don't think it is a good project structure to encourage. If these modules are so closely related they should be moved to single math-n-stuff package. Yea, I was concerned about the opposite, that you'd wind up wi

Re: Need review: explicit package protection

2014-06-08 Thread Dmitry Olshansky via Digitalmars-d
08-Jun-2014 19:37, Dicebot пишет: Finally got to cleanup and submit this PR: https://github.com/D-Programming-Language/dmd/pull/3651 While proposed change is very small (and backwards-compatible) and not worth separate DIP, it is still a language change and needs community approval. Copy of des

Re: What's going on with std.experimental.lexer?

2014-06-08 Thread Martin Nowak via Digitalmars-d
On 06/08/2014 08:21 PM, dennis luehring wrote: thats why im always puzzled when people start to optimze algorithms based on DMD results - currently one should always compare any results before optimization with GDC/LDC I second that, dmd results are easily misleading as you often optimize arou

Re: dlang website: remove that quick try editor

2014-06-08 Thread Martin Nowak via Digitalmars-d
On 06/08/2014 09:09 PM, John wrote: dlang.org website has a quick try editor with D code example. Please remove that feature (at least the buttons to run it) as it takes ages to run the example and leaves an impression that D is very slow!! This is only good if it can run quickly like the simila

Re: Need review: explicit package protection

2014-06-08 Thread Dicebot via Digitalmars-d
On Sunday, 8 June 2014 at 16:27:12 UTC, Joseph Rushton Wakeling via Digitalmars-d wrote: Is it possible to permit multiple packages access in this way? For example, package(std.math, std.random) void foo() { ... } Of course it is possible but I don't think it is a good project structure

Re: Need review: explicit package protection

2014-06-08 Thread Dicebot via Digitalmars-d
On Sunday, 8 June 2014 at 19:02:58 UTC, Jacob Carlborg wrote: Is the idea that anything nested in the specified package has access to the symbol? Yes, this is how it is implemented right now.

Re: dlang website: remove that quick try editor

2014-06-08 Thread ixid via Digitalmars-d
On Sunday, 8 June 2014 at 19:09:20 UTC, John wrote: dlang.org website has a quick try editor with D code example. Please remove that feature (at least the buttons to run it) as it takes ages to run the example and leaves an impression that D is very slow!! This is only good if it can run quic

Re: enum scope

2014-06-08 Thread Walter Bright via Digitalmars-d
On 6/8/2014 12:11 PM, Jacob Carlborg wrote: "An implicit member expression is an abbreviated way to access a member of a type, such as an enumeration case or a class method, in a context where type inference can determine the implied type. It has the following form: .member name For exampl

Re: enum scope

2014-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2014-06-08 19:51, Walter Bright wrote: That use of with never occurred to me! It's cool. It's very nice. I use it quite heavily in a project where I need to access enum members often. It's mostly useful when you need to access many enum members in the same scope. -- /Jacob Carlborg

Re: enum scope

2014-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2014-06-08 19:50, Walter Bright wrote: Does that apply to all symbols in Swift, or just enums? I'm not sure if it applies to all symbols but it's not limited to enums. The reference documentation [1] says: "An implicit member expression is an abbreviated way to access a member of a type

dlang website: remove that quick try editor

2014-06-08 Thread John via Digitalmars-d
dlang.org website has a quick try editor with D code example. Please remove that feature (at least the buttons to run it) as it takes ages to run the example and leaves an impression that D is very slow!! This is only good if it can run quickly like the similar feature available on the golan

Re: Need review: explicit package protection

2014-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2014-06-08 17:37, Dicebot wrote: Finally got to cleanup and submit this PR: https://github.com/D-Programming-Language/dmd/pull/3651 While proposed change is very small (and backwards-compatible) and not worth separate DIP, it is still a language change and needs community approval. Copy of d

Re: What's going on with std.experimental.lexer?

2014-06-08 Thread dennis luehring via Digitalmars-d
Am 07.06.2014 01:50, schrieb Brian Schott: On Friday, 6 June 2014 at 00:33:23 UTC, Brian Schott wrote: Implementing some SIMD code just in the lexWhitespace function causes a drop in total lexing time of roughly 3.7%. This looks promising so far, so I'm going to implement similar code in lexStri

Re: enum scope

2014-06-08 Thread Walter Bright via Digitalmars-d
On 6/7/2014 4:58 PM, deadalnix wrote: You can even use the with statement for code that use the enum intensively, for instance : final switch(myvar) with(UITableViewRowAnimation) { case Fade: // Do fading... case Right: // That's right... case Left: // That

Re: enum scope

2014-06-08 Thread Walter Bright via Digitalmars-d
On 6/8/2014 2:15 AM, Jacob Carlborg wrote: In Swift you don't have to specify the full enum name if the compiler can infer that it's an value of specific enum that is needed: void foo (UITableViewRowAnimation); foo(Fade); Actually in Swift you would append a dot to the enum value: foo(.Fade);

Re: [OT] Extra time spent

2014-06-08 Thread Nick Sabalausky via Digitalmars-d
On 6/7/2014 4:12 PM, Kagamin wrote: On Friday, 6 June 2014 at 02:21:45 UTC, Nick Sabalausky wrote: My coding music lately has been anywhere between not-entirely-mainstream rock/pop/electronic to industrial metal. Like Kotoko, KMFDM, Thrill Kill Kult, Manson Used to listen Manson too, though it

Re: [OT] Extra time spent

2014-06-08 Thread Nick Sabalausky via Digitalmars-d
On 6/7/2014 3:53 PM, Kagamin wrote: On Friday, 6 June 2014 at 02:21:45 UTC, Nick Sabalausky wrote: On 6/5/2014 6:08 PM, deadalnix wrote: On Thursday, 5 June 2014 at 14:11:32 UTC, H. S. Teoh via Digitalmars-d wrote: Ha! Though, truth be told, I can't stand modern pop music. My (completely u

Re: Need review: explicit package protection

2014-06-08 Thread Joseph Rushton Wakeling via Digitalmars-d
On 08/06/14 17:37, Dicebot via Digitalmars-d wrote: While proposed change is very small (and backwards-compatible) and not worth separate DIP, it is still a language change and needs community approval. Looks cool to me. :-) For example, if helpers in std.internal will be marked as package, o

Need review: explicit package protection

2014-06-08 Thread Dicebot via Digitalmars-d
Finally got to cleanup and submit this PR: https://github.com/D-Programming-Language/dmd/pull/3651 While proposed change is very small (and backwards-compatible) and not worth separate DIP, it is still a language change and needs community approval. Copy of description:

Re: How to best translate this C++ algorithm into D?

2014-06-08 Thread Joseph Rushton Wakeling via Digitalmars-d
On 08/06/14 10:18, logicchains via Digitalmars-d wrote: It's still slightly less than half the speed of the C++ version, but I'm out of ideas now. I thought the C++ version might be vectorised but I checked the objdump and it wasn't, and I made an attempt at vectorising the D version, via inline

Re: [OT] Extra time spent

2014-06-08 Thread safety0ff via Digitalmars-d
On Sunday, 8 June 2014 at 13:50:47 UTC, Andrei Alexandrescu wrote: Yah. One well-known fact about Facebook is it has an open layout which can be quite distracting. One less-known fact is it makes high quality headphones (both in-ear (Klipsch) and over-the-ear (Sennheiser)) available to all em

Re: For Chuck Allison: possible homework in D

2014-06-08 Thread Philippe Sigaud via Digitalmars-d
Yes indeed, you can provide a range interface on a tree. That's a good idea! But I suppose Chuck wants to teach his students generic notions such as mapping or folding. Ranges are more a D-specific thing. Also, what's interesting is that when mapping a tree, you can keep its 'shape', whereas pro

Re: [OT] Extra time spent

2014-06-08 Thread Andrei Alexandrescu via Digitalmars-d
On 6/8/14, 10:46 AM, SomeDude wrote: On Tuesday, 3 June 2014 at 18:14:29 UTC, Walter Bright wrote: On 6/2/2014 11:55 PM, Jacob Carlborg wrote: I'm also listening to music on the phone. I've damaged my ears from years of loud engines. I've read that most hearing damage comes from gunshots, roc

Free wildcard SSL certificates for OS projects

2014-06-08 Thread Dicebot via Digitalmars-d
Have just found https://www.globalsign.com/ssl/ssl-open-source/ , states to provides certificates (including wildcard ones) for free if your project complies to: - Must be licensed with a license approved by the Open Source Initiative - Project must be actively maintained - Order must meet al

Re: D Grammar in BNF Text Form?

2014-06-08 Thread Tom Browder via Digitalmars-d
On Sun, Jun 8, 2014 at 3:58 AM, Jacob Carlborg via Digitalmars-d wrote: ... > You can start by filing an issue, including the input source used. If you > then manage to reduce the test case that's even better. I just don't want > the issue to get lost. Issue just filed as #26. I got the test cas

Re: [OT] Extra time spent

2014-06-08 Thread Kagamin via Digitalmars-d
On Sunday, 8 June 2014 at 09:20:45 UTC, SomeDude wrote: Unfortunately, commercial's bonus is based on their selling performance, so they will sell anything they can, even if it doesn't exist yet. Especially if they need to win a contract in face of competitors. OTOH, if the contract is won, the c

Re: For Chuck Allison: possible homework in D

2014-06-08 Thread FreeSlave via Digitalmars-d
The good exercise would be implementing some traversal (walk) algorithms for the generic tree structures. There are many tree traversal algorithms (some kinds of depth search and breadth-first search) and they may have range interface, so you can use them just like other ranges and don't need t

Re: D Grammar in BNF Text Form?

2014-06-08 Thread Tom Browder via Digitalmars-d
On Sun, Jun 8, 2014 at 4:11 AM, Jacob Carlborg via Digitalmars-d wrote: > On 2014-06-08 10:33, Dicebot wrote: > >> AFAIR `gcc- E` output is not a valid C on its own, no wonder libclang >> chokes on it. Using llvm/clang toolchain with dstep results in much more >> pleasant experience (not surprisin

Re: [OT] Extra time spent

2014-06-08 Thread SomeDude via Digitalmars-d
On Friday, 6 June 2014 at 18:51:17 UTC, Mattcoder wrote: Well, some managers are mindless and that story about do it now or we will lose our customer, in most cases it's just a bluff/threat or call it what you want. Unfortunately, commercial's bonus is based on their selling performance, so

Re: enum scope

2014-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2014-06-08 01:58, deadalnix wrote: I'm not sure why it is usually done that way in D binding. This is idiotic (and all Deimos exhibit this). enum UITableViewRowAnimation { Fade, Right, Left, Top, Bottom, None, Middle, Automatic = 100 } Here you go. Yo

Re: D Grammar in BNF Text Form?

2014-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2014-06-08 10:33, Dicebot wrote: AFAIR `gcc- E` output is not a valid C on its own, no wonder libclang chokes on it. Using llvm/clang toolchain with dstep results in much more pleasant experience (not surprisingly as dstep is implemented on top of it) Hmm, it adds a bunch of lines looking l

Re: [OT] Extra time spent

2014-06-08 Thread SomeDude via Digitalmars-d
On Friday, 6 June 2014 at 19:49:48 UTC, deadalnix wrote: Techie A: Man we really fucked by choosing ruby on rails. Our codebase has become unmaintainable. We must do something. Technie B: Let's migrate to Node.js ... and use mongodb as our new shiny database. 'cuz it's so kewl and webscale.

Re: D Grammar in BNF Text Form?

2014-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2014-06-07 23:15, Tom Browder via Digitalmars-d wrote: Ditto. It might be a while, though. You can start by filing an issue, including the input source used. If you then manage to reduce the test case that's even better. I just don't want the issue to get lost. -- /Jacob Carlborg

Re: D Grammar in BNF Text Form?

2014-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2014-06-07 23:16, Tom Browder via Digitalmars-d wrote: That's another itch! That's what the dtoh tool is for. It might create bindings for C++, I'm not sure. -- /Jacob Carlborg

Re: [OT] Extra time spent

2014-06-08 Thread SomeDude via Digitalmars-d
On Friday, 6 June 2014 at 18:40:28 UTC, David Gileadi wrote: In my experience a good manager protects you from outrageous demands from the customer. Just the kinds of examples that were mentioned earlier in this thread, in fact. I'm lucky to have had a couple of managers that actually do th

Re: [OT] Extra time spent

2014-06-08 Thread SomeDude via Digitalmars-d
On Tuesday, 3 June 2014 at 18:14:29 UTC, Walter Bright wrote: On 6/2/2014 11:55 PM, Jacob Carlborg wrote: I'm also listening to music on the phone. I've damaged my ears from years of loud engines. I've read that most hearing damage comes from gunshots, rock concerts, and earphones. When usin

Re: [OT] Extra time spent

2014-06-08 Thread SomeDude via Digitalmars-d
On Monday, 2 June 2014 at 14:19:32 UTC, Steven Schveighoffer wrote: On Sun, 01 Jun 2014 15:22:44 -0400, Walter Bright wrote: On 5/30/2014 8:08 AM, Chris wrote: I like to re-invent the wheel too, because existing wheels might not be fit for your purpose. A few years back I invented a triang

Re: D Grammar in BNF Text Form?

2014-06-08 Thread Dicebot via Digitalmars-d
On Saturday, 7 June 2014 at 17:46:06 UTC, Tom Browder via Digitalmars-d wrote: On Sat, Jun 7, 2014 at 12:05 PM, Tom Browder wrote: On Sat, Jun 7, 2014 at 11:26 AM, Jacob Carlborg via Digitalmars-d wrote: ... There's already a tool for that [1]. It uses the JSON output from the compiler. [

Re: How to best translate this C++ algorithm into D?

2014-06-08 Thread logicchains via Digitalmars-d
On Saturday, 7 June 2014 at 15:39:54 UTC, monarch_dodra wrote: ... instead of keeping "true" to your code, there is a faster way than "sort" to remove duplicates. Hashing. The code becomes: bool[forest_t] hash; foreach (tree ; arr.partition!forest_invalid) hash[tree] = true;