Re: It's official: Sociomantic Labs has been acquired by dunnhumby Ltd

2014-04-06 Thread Andrei Alexandrescu
On 4/4/14, 2:06 AM, Don wrote: On Friday, 4 April 2014 at 02:38:58 UTC, Andrei Alexandrescu wrote: On 4/3/14, 7:04 AM, Don wrote: https://www.sociomantic.com/dunnhumby-acquires-sociomantic/ Congratulations to all involved! How will this impact the use of D at dunnhumby? Andrei This is

Re: I'm joining Facebook

2014-04-06 Thread Andrei Alexandrescu
On 4/5/14, 3:13 AM, Peter Alexander wrote: 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. Good luck, and

Re: Interesting rant about Scala's issues

2014-04-06 Thread Andrei Alexandrescu
On 4/6/14, 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that makes sense only because you are used to the current semantics, not

Re: Interesting rant about Scala's issues

2014-04-06 Thread Walter Bright
On 4/6/2014 4:26 AM, bearophile wrote: So do you have an example of this risk? Algol is a rather famous one. A counterexample is Go, which has gotten a lot of traction with a simple syntax.

Re: Interesting rant about Scala's issues

2014-04-06 Thread Walter Bright
On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that makes sense only because you are used to the current semantics, not

Re: Interesting rant about Scala's issues

2014-04-06 Thread Eric
On Sunday, 6 April 2014 at 16:46:12 UTC, Andrei Alexandrescu wrote: On 4/6/14, 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that

Re: Interesting rant about Scala's issues

2014-04-06 Thread Ola Fosheim Grøstad
On Sunday, 6 April 2014 at 11:26:41 UTC, bearophile wrote: Walter Bright: Having special syntax for everything makes the language unusable. While there are ways to reach excesses in every design direction, and make things unusable, the risk discussed here seems remote to me. Too much

Re: Interesting rant about Scala's issues

2014-04-06 Thread Paulo Pinto
Am 06.04.2014 19:54, schrieb Walter Bright: On 4/6/2014 4:26 AM, bearophile wrote: So do you have an example of this risk? Algol is a rather famous one. A counterexample is Go, which has gotten a lot of traction with a simple syntax. It has more to do with Google than with the language's

Re: Interesting rant about Scala's issues

2014-04-06 Thread Araq
On Sunday, 6 April 2014 at 17:52:19 UTC, Walter Bright wrote: On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that

Re: Interesting rant about Scala's issues

2014-04-06 Thread Walter Bright
On 4/6/2014 2:26 PM, Araq wrote: The fact that you are unaware of how it's properly done (hint: Pascal got right with 'set of enum' being distinct from 'enum') makes it a historical accident. I wrote a Pascal compiler before the C one.

Re: Interesting rant about Scala's issues

2014-04-06 Thread Ola Fosheim Grøstad
On Sunday, 6 April 2014 at 19:53:43 UTC, Paulo Pinto wrote: A counterexample is Go, which has gotten a lot of traction with a simple syntax. It has more to do with Google than with the language's design. That, and being perceived as a http-server-language and having standard libraries and

Re: Interesting rant about Scala's issues

2014-04-06 Thread Andrei Alexandrescu
On 4/6/14, 10:52 AM, Walter Bright wrote: On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that makes sense only because

DAuth - Authentication Utility Lib (initial release - v.0.5.1)

2014-04-06 Thread Nick Sabalausky
I've put up an initial release of DAuth: A simple-yet-flexible salted password hash based authentication utility lib for D. Before you get too excited, know that actual cryptographic algorithms are outside the scope of this lib. Instead, it uses any Phobos-compatible digests and random number

Re: Interesting rant about Scala's issues

2014-04-06 Thread bearophile
Walter Bright: Having special syntax for everything makes the language unusable. While there are ways to reach excesses in every design direction, and make things unusable, the risk discussed here seems remote to me. So do you have an example of this risk? Or examples of languages that

Re: Interesting rant about Scala's issues

2014-04-06 Thread Leandro Lucarella
Walter Bright, el 5 de April a las 21:15 me escribiste: 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

Re: Interesting rant about Scala's issues

2014-04-06 Thread Walter Bright
On 4/6/2014 4:17 PM, Andrei Alexandrescu wrote: On 4/6/14, 10:52 AM, Walter Bright wrote: I use enums a lot in D. I find they work very satisfactorily. The way they work was deliberately designed, not a historical accident. Sorry, I think they ought to have been better. -- Andrei Sorry, yer

Issues With dblog.aldacron.net

2014-04-06 Thread Mike Parker
Anyone visiting my D blog (The One With D) or the Derelict forums recently will likely (hopefully!) have seen a malware warning. The problem is coming from the blog, where Google detected some script injection going on. Using cURL, I was able to see where it's happening, but I've been unable

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

2014-04-06 Thread Joakim
On Saturday, 5 April 2014 at 23:56:49 UTC, John Colvin wrote: 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. Sorry, I made a mistake. Dmd simply invokes the system C compiler and the linker that it uses. I

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

2014-04-06 Thread Simen Kjærås
On 2014-04-05 21:06, Nick Sabalausky wrote: 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 -

Re: Reviving YAGE

2014-04-06 Thread Andrej Mitrovic
On 4/4/14, Ryan Voots simcop2...@simcop2387.info wrote: I started updating things so that the demos build seperately with dub but can't confirm anything about them building as expected yet. Yeah I've tried running dub --config=demo1 but I get back: Error executing command run: Unknown build

Re: Dream Feature Regarding Default Arguments

2014-04-06 Thread JN
On Sunday, 6 April 2014 at 01:26:21 UTC, Nick Sabalausky wrote: Such a big mess for such a trivially simple API: func( [optionalFoo], [optionalBar] ) It would be *fantastic* if D recognized the disambiguation of using incompatible types and permitted this: interface Foo {}

How to tell if the GC is running?

2014-04-06 Thread Tomer Filiba
I'm writing a logger/tracer that emits a line for every function entry/exit. It naturally makes use of the GC, as it manipulates strings (and calls to!string on arguments, etc). Traced functions may be called normally, but sometimes they are called from a destructor (during a collection).

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Andrei Alexandrescu
On 4/6/14, 2:49 AM, Nordlöw wrote: I recommend the lead developers of DMD to look into activating more warnings in the dmd/src/posix.mak. GCC 4.8.2 and especially Clang 3.4, both prepackage on Ubuntu 13.10/14.04 give a *lot* of warnings that seems to indicate potential bugs in the DMD source

Re: How to tell if the GC is running?

2014-04-06 Thread safety0ff
Please post more of the stack trace, it looks like you're allocating while it is running the destructors / finalization (#11408.) https://d.puremagic.com/issues/show_bug.cgi?id=11408

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Orvid King
On Sunday, 6 April 2014 at 16:27:50 UTC, Andrei Alexandrescu wrote: On 4/6/14, 2:49 AM, Nordlöw wrote: I recommend the lead developers of DMD to look into activating more warnings in the dmd/src/posix.mak. GCC 4.8.2 and especially Clang 3.4, both prepackage on Ubuntu 13.10/14.04 give a *lot*

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

2014-04-06 Thread eles
On Saturday, 5 April 2014 at 21:06:14 UTC, Nick Sabalausky wrote: On 4/4/2014 8:51 PM, Simen Kjærås wrote: On 2014-04-04 02:10, dnewbie wrote: I remember watching the changelog and wondering if the next version after v0.99 was going to be v1.0. Yes, yes! I remember that it was some

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread bearophile
Orvid King: On the topic of actual warnings, I would be careful with them, because compiling DMD with MSVC with the maximum warning level (essentially -Wall), it produces 150k lines of output, most of them about stuff being inlined, and quite a bit of other stuff that you quite simply, don't

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

2014-04-06 Thread Walter Bright
On 4/6/2014 2:56 AM, Marc Schütz schue...@gmx.net wrote: And wouldn't it clash with D's std package? Yes. But D has numerous methods of disambiguation.

Re: mysql-native: newbie questions

2014-04-06 Thread salvari
On Tuesday, 18 February 2014 at 01:04:10 UTC, simendsjo wrote: .. preamble The rejectedsoftware repo is based on an earlier version of mine which in turn is based on the original by Steve Teale (britseye). (... lots of compiler errors ...) What you are seeing are missing dependencies. DMD

Re: mysql-native: newbie questions

2014-04-06 Thread Martin Nowak
On 02/18/2014 01:29 PM, simendsjo wrote: On Tuesday, 18 February 201hanks for the nod. It's good to see that all those hours were not wast4 at 11:56:23 UTC, Steve Teale wrote: On Tuesday, 18 February 2014 at 01:04:10 UTC, simendsjo wrote: The rejectedsoftware repo is based on an earlier

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Nordlöw
On Sunday, 6 April 2014 at 17:39:38 UTC, bearophile wrote: Orvid King: On the topic of actual warnings, I would be careful with them, because compiling DMD with MSVC with the maximum warning level (essentially -Wall), it produces 150k lines of output, most of them about stuff being inlined,

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

2014-04-06 Thread Ola Fosheim Grøstad
On Saturday, 5 April 2014 at 23:26:30 UTC, Walter Bright wrote: I feel that C++ messed up namespace design because: 1. namespaces are not closed 2. they have no relationship with modules Namespaces are not as powerful as they could have been, but being able to add symbols to an external

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

2014-04-06 Thread Andrej Mitrovic
On 4/4/14, dnewbie r...@myopera.com wrote: Please vote now! http://www.easypolls.net/poll.html?p=533e10e4e4b0edddf89898c5 I remember trying D1 many years ago, but I got put off by the whole choose tango or phobos thing back then. I'm glad to see those days are behind us.

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread David Nadlinger
On Sunday, 6 April 2014 at 17:39:38 UTC, bearophile wrote: I'd like dmd/ldc2 compilers to compile with warnings active on default, plus to have a switch to disable them. LDC is actually built with -Wall -Wextra by default. The warnings are disabled for the DMD source files though, as leaving

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

2014-04-06 Thread Walter Bright
On 4/6/2014 12:39 PM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: On Saturday, 5 April 2014 at 23:26:30 UTC, Walter Bright wrote: I feel that C++ messed up namespace design because: 1. namespaces are not closed 2. they have no relationship with modules Namespaces are not

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

2014-04-06 Thread Ola Fosheim Grøstad
On Sunday, 6 April 2014 at 20:17:09 UTC, Walter Bright wrote: It's seriously wrong to allow such. It makes a larger code base nearly impossible to reliably reason about, leading one to rely on conventions like don't add stuff to namespaces. Depends on how it is done. For BETA, there was a

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

2014-04-06 Thread Ola Fosheim Grøstad
Btw, cross-cutting programming is indeed meant to cater for programming in the large: http://en.wikipedia.org/wiki/Aspect-oriented_programming

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread bearophile
Nordlöw: Could you give me a priority list of the typical warning types sorted an descending severity? I can't, I don't understand your question, and I don't understand why you want such list. Bye, bearophile

Re: mysql-native: newbie questions

2014-04-06 Thread Nick Sabalausky
On 4/6/2014 3:05 PM, salvari wrote: Following Nick advice I've completed my project by using dmd and specifying dependencies manually, it's a tiny project after all. Everything seems to work fine. So... After seen your tutorials (at youtube, by the way very useful indeed) I'm now trying to

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

2014-04-06 Thread monarch_dodra
On Sunday, 6 April 2014 at 20:17:09 UTC, Walter Bright wrote: D has closed scopes, and members can be added to external classes just fine, using CTFE. You mean UFCS? As in, for example, front for arrays? It doesn't work as well as advertised though. The issue is that the added members are

Re: Dream Feature Regarding Default Arguments

2014-04-06 Thread Nick Sabalausky
On 4/6/2014 10:47 AM, JN wrote: Wouldn't it be better to have named parameters like in Python or C#? That way you could call the function like: func(foo=myFoo) or func(bar=myBar) or func(foo=myFoo, bar=myBar) and there would be no ambiguity. Named parameters would be a good compliment to

Re: How to tell if the GC is running?

2014-04-06 Thread Tomer Filiba
On Sunday, 6 April 2014 at 16:34:02 UTC, safety0ff wrote: Please post more of the stack trace, it looks like you're allocating while it is running the destructors / finalization (#11408.) https://d.puremagic.com/issues/show_bug.cgi?id=11408 Yes, I know I'm allocating while the GC is

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Nordlöw
I can't, I don't understand your question, and I don't understand why you want such list. Just so I know where I should begin digging ;)

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

2014-04-06 Thread Walter Bright
On 4/6/2014 2:00 PM, monarch_dodra wrote: On Sunday, 6 April 2014 at 20:17:09 UTC, Walter Bright wrote: D has closed scopes, and members can be added to external classes just fine, using CTFE. You mean UFCS? Yes, my mistake. As in, for example, front for arrays? It doesn't work as well

Re: mysql-native: newbie questions

2014-04-06 Thread Martin Nowak
On 04/06/2014 09:05 PM, salvari wrote: In my code, at 'dub.json' file I've wrote: dependencies: { mysql-native : =0.0.12 } When trying to build, I've got an error from mysql-native code: $HOME/.dub/packages/mysql-native-0.0.12/source/mysql/connection.d(333): Error:

Re: From next C#

2014-04-06 Thread Idan Arye
On Saturday, 5 April 2014 at 21:17:53 UTC, bearophile wrote: 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

Re: Dream Feature Regarding Default Arguments

2014-04-06 Thread Frustrated
On Sunday, 6 April 2014 at 21:06:44 UTC, Nick Sabalausky wrote: On 4/6/2014 10:47 AM, JN wrote: Wouldn't it be better to have named parameters like in Python or C#? That way you could call the function like: func(foo=myFoo) or func(bar=myBar) or func(foo=myFoo, bar=myBar) and there would

Re: How to tell if the GC is running?

2014-04-06 Thread Etienne
On 2014-04-06 5:20 PM, Tomer Filiba wrote: On Sunday, 6 April 2014 at 16:34:02 UTC, safety0ff wrote: Please post more of the stack trace, it looks like you're allocating while it is running the destructors / finalization (#11408.) https://d.puremagic.com/issues/show_bug.cgi?id=11408 Yes, I

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

2014-04-06 Thread Jacob Carlborg
On 2014-04-05 22:42, Walter Bright wrote: 2. C++ namespaces are very low hanging fruit, with a significant payoff. It's worthwhile. I think it's very low hanging fruit to add support for basic C++ namespaces. Support for basically just set the mangled name in a somewhat nice way, a pragma

Typo in Types page

2014-04-06 Thread Gustavo
In the page http://dlang.org/type.html I believe there is a typo stating that bool is 1 byte instead of 1 bit.

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

2014-04-06 Thread Ola Fosheim Grøstad
I think it's very low hanging fruit to add support for basic C++ namespaces. Support for basically just set the mangled name in a somewhat nice way, a pragma for example. I think it is more important to think in term of strategic positions than whether it takes 1 or 2 weeks to implement a

Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Nordlöw
I recommend the lead developers of DMD to look into activating more warnings in the dmd/src/posix.mak. GCC 4.8.2 and especially Clang 3.4, both prepackage on Ubuntu 13.10/14.04 give a *lot* of warnings that seems to indicate potential bugs in the DMD source code. This setting gives useful

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

2014-04-06 Thread Tove
On Sunday, 6 April 2014 at 02:33:38 UTC, Walter Bright wrote: 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();

Re: Typo in Types page

2014-04-06 Thread Kelet
On Sunday, 6 April 2014 at 09:30:47 UTC, Gustavo wrote: In the page http://dlang.org/type.html I believe there is a typo stating that bool is 1 byte instead of 1 bit. I don't think it's a typo. Memory is typically byte-addressable and thus data types are either a byte or larger. Having a data

Re: Typo in Types page

2014-04-06 Thread Philpax
On Sunday, 6 April 2014 at 09:30:47 UTC, Gustavo wrote: In the page http://dlang.org/type.html I believe there is a typo stating that bool is 1 byte instead of 1 bit. While a boolean is by definition a single bit, it is represented by programming languages as a byte for various reasons

Re: Dream Feature Regarding Default Arguments

2014-04-06 Thread Mason McGill
On Sunday, 6 April 2014 at 01:33:36 UTC, Nick Sabalausky wrote: 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 {}

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

2014-04-06 Thread Marc Schütz
On Saturday, 5 April 2014 at 21:43:03 UTC, Walter Bright wrote: 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

Re: 2.065 compiler problem

2014-04-06 Thread Ondrej Pokorny
Ty, you made my day.

Re: mysql-native: newbie questions

2014-04-06 Thread Nick Sabalausky
On Sunday, 6 April 2014 at 22:37:08 UTC, Martin Nowak wrote: You can use ~master to get the latest version of a package. http://code.dlang.org/package-format#version-specs I thought that was deprecated (according to the format description at code.dlang.org)

Re: Dream Feature Regarding Default Arguments

2014-04-06 Thread Nick Sabalausky
On Sunday, 6 April 2014 at 23:08:10 UTC, Frustrated wrote: How bout func(,,x,,y) That isn't too bad (VB6 had it IIRC), but the caller still has to care about the order of the params they're ignoring. Ie if you have func([foo],[bar]) then you can't just pass in a one-param foo-only or

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

2014-04-06 Thread Michel Fortin
On 2014-04-06 19:39:31 +, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com said: Unfortunately that seems to be years into the future? Although clang has begun implementing something: http://clang.llvm.org/docs/Modules.html I've got at feeling that if clang gets something working

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

2014-04-06 Thread Manu
On 4 April 2014 12:10, dnewbie r...@myopera.com 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 results are a bit disappointing. Ideally

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

2014-04-06 Thread Kapps
On Monday, 7 April 2014 at 02:00:37 UTC, Manu wrote: On 4 April 2014 12:10, dnewbie r...@myopera.com 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

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

2014-04-06 Thread Manu
On 7 April 2014 12:34, Kapps opantm2+s...@gmail.com wrote: On Monday, 7 April 2014 at 02:00:37 UTC, Manu wrote: On 4 April 2014 12:10, dnewbie r...@myopera.com wrote: Please vote now! http://www.easypolls.net/poll.html?p=533e10e4e4b0edddf89898c5 See also results from previous years: -

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Iain Buclaw
On 6 Apr 2014 21:15, David Nadlinger c...@klickverbot.at wrote: On Sunday, 6 April 2014 at 17:39:38 UTC, bearophile wrote: I'd like dmd/ldc2 compilers to compile with warnings active on default, plus to have a switch to disable them. LDC is actually built with -Wall -Wextra by default. The

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Suliman
Who could explain. AFAIK D was position as language without warnings. The idea was in that code maybe correct or wrong, without any intermediate state, and now I am reading about warnings.

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Iain Buclaw
On 7 Apr 2014 06:20, Suliman everm...@live.ru wrote: Who could explain. AFAIK D was position as language without warnings. The idea was in that code maybe correct or wrong, without any intermediate state, and now I am reading about warnings. This thread is talking about the compiler

Re: Recommendation: Compile DMD with More Warnings

2014-04-06 Thread Walter Bright
On 4/6/2014 9:45 AM, Orvid King wrote: If you want, I have the results of a static analysis of DMD that I could post, as processed in 23 hours and 58 minutes by Intel's C compiler, using 10gb of RAM the entire time. If I can figure out how to have it not skip any methods (there were still a

Re: Empty array and AA literals

2014-04-06 Thread Chris Nicholson-Sauls
On Sunday, 6 April 2014 at 03:28:50 UTC, dnspies wrote: 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

CTFE log2 functions

2014-04-06 Thread Shire
Another one ctfe log2, integer and real versions: [code] module util.ctfelog2; uint ctfe_ilog2(ulong arg) pure { assert(arg != 0); uint result = 0; while(arg = 1) result++; return result; } ulong ctfe_log2(real arg, uint fracBits) pure { import std.math : sqrt, SQRT2;

Re: Empty array and AA literals

2014-04-06 Thread Timon Gehr
On 04/06/2014 05:28 AM, dnspies wrote: int[][] nested; nested ~= null; ~ is overloaded, so how does it know what type I intend null to be? How can I specify it? (int[]).init

Re: Empty array and AA literals

2014-04-06 Thread JR
On Sunday, 6 April 2014 at 09:52:04 UTC, monarch_dodra wrote: An Dynamic Array is merelly a fat pointer that holds both pointer and length. There is no need to create or new a Dynamic Array. new allows for setting the length immediately, though. auto arr = new int[](99); //

Re: Empty array and AA literals

2014-04-06 Thread monarch_dodra
On Sunday, 6 April 2014 at 19:48:37 UTC, JR wrote: On Sunday, 6 April 2014 at 09:52:04 UTC, monarch_dodra wrote: An Dynamic Array is merelly a fat pointer that holds both pointer and length. There is no need to create or new a Dynamic Array. new allows for setting the length immediately,

Re: Query Context at Source File and Offset in DMD

2014-04-06 Thread Nordlöw
The Lexer's constructor takes a Module as the first parameter [1]. A Module has the original argument name [2], I assume that's the filename. Just store the module/filename as an instance variable in the lexer and access it where you need it. [1]

Re: templates, enums, CT reflection: compiler bug or not?

2014-04-06 Thread captaindet
no one any ideas? well, i filed two bug reports for now: https://d.puremagic.com/issues/show_bug.cgi?id=12532 https://d.puremagic.com/issues/show_bug.cgi?id=12533

Re: Best way to convert and apply floor()

2014-04-06 Thread anonymous
On Sunday, 6 April 2014 at 08:23:16 UTC, Daniele M. wrote: For example, is this the best way to perform a conversion + floor? Input 'x' is a floating point expression that is never big enough to justify usage of double or real type, but I picked real because I noticed that it was the

Re: Empty array and AA literals

2014-04-06 Thread bearophile
dnspies: 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[][] nested; nested ~= null; ~ is overloaded, so how does it know what type I intend null to be? How can I specify it? You can increase by one of the length of the

Re: Best way to convert and apply floor()

2014-04-06 Thread monarch_dodra
On Sunday, 6 April 2014 at 09:23:21 UTC, anonymous wrote: Conversion to int drops the fractional part, so you don't really need floor. But if you think it makes the intent clearer, feel free to leave it in. Well, conversion to int drops the fractional part, rounding *towards* 0, whereas floor

Re: Empty array and AA literals

2014-04-06 Thread anonymous
On Sunday, 6 April 2014 at 09:41:10 UTC, bearophile wrote: dnspies: 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[][] nested; [...] You can increase by one of the length of the outer array, or you can append an empty

Re: Empty array and AA literals

2014-04-06 Thread monarch_dodra
On Sunday, 6 April 2014 at 03:17:25 UTC, dnspies wrote: 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;

Re: Empty array and AA literals

2014-04-06 Thread bearophile
anonymous: You can increase by one of the length of the outer array, or you can append an empty one: [...] nested ~= []; That doesn't add an element. [] is interpreted to be an empty int[][]. You need to write [[]] which is an int[][] holding one empty int[]. Thank you catching my

Re: running my program with shared libraries

2014-04-06 Thread Marc Schütz
On Sunday, 6 April 2014 at 02:49:15 UTC, Adam D. Ruppe wrote: 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

Re: Set differences

2014-04-06 Thread bearophile
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,

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

2014-04-06 Thread monarch_dodra
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]) EnumMembers (http://dlang.org/phobos/std_traits.html#EnumMembers) should do what you need. It will give

Re: execute commands in the terminal OSX

2014-04-06 Thread Joel
I've course I tried these things, but there doesn't seem to be some thing to do the same thing as 'system'. At least to clear the terminal. On Thursday, 3 April 2014 at 09:00:26 UTC, Gary Willoughby wrote: On Thursday, 3 April 2014 at 04:58:12 UTC, Joel wrote: It says in the Language

[Issue 11777] [ICE] dmd memory corruption as `Scope::pop` `free`s `fieldinit` used also in `enclosing`

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=11777 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|REOPENED|RESOLVED

[Issue 12523] wrong foreach argument type with ref and inout

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12523 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 12523] wrong foreach argument type with ref and inout

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12523 --- Comment #3 from github-bugzi...@puremagic.com 2014-04-05 22:58:50 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/dmd

[Issue 12509] Compiler performance highly depends on declared array size - for struct with long static array of structs

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12509 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||performance, pull

[Issue 12526] New: DDox possible issue with case sensitive file names

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12526 Summary: DDox possible issue with case sensitive file names Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2

[Issue 12527] New: Cannot make @system function/delegate alias in a @safe section

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12527 Summary: Cannot make @system function/delegate alias in a @safe section Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords:

[Issue 12526] DDox possible issue with case sensitive file names

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12526 S�nke Ludwig slud...@outerproduct.org changed: What|Removed |Added CC|

[Issue 12526] DDox possible issue with case sensitive file names

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12526 --- Comment #2 from Martin Nowak c...@dawg.eu 2014-04-06 08:03:48 PDT --- Aggregation seems feasible because the two entities have a close relation, i.e. usually the lower case is a constructor using IFTI.

[Issue 12179] [ICE](e2ir.c 1861) with array operation

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12179 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||diagnostic, ice, pull

[Issue 12528] New: foreach with inout ref argument cannot be interpreted at compile time

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12528 Summary: foreach with inout ref argument cannot be interpreted at compile time Product: D Version: D2 Platform: All OS/Version: All Status: NEW

[Issue 12528] [CTFE] cannot append elements from one inout array to another inout array

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12528 --- Comment #1 from Martin Nowak c...@dawg.eu 2014-04-06 09:25:29 PDT --- workaround: foreach (ref e; a) res ~= [e]; -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail

[Issue 12312] Regression (2.064): Diagnostic for void static arrays has gone bad

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12312 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||diagnostic, pull

[Issue 12529] New: Function/delegate type alias picks up @safe attribute from surrounding scope

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12529 Summary: Function/delegate type alias picks up @safe attribute from surrounding scope Product: D Version: D2 Platform: All OS/Version: All Status: NEW

[Issue 12527] Cannot make @system function/delegate alias in a @safe section

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12527 --- Comment #1 from Lars T. Kyllingstad bugzi...@kyllingen.net 2014-04-06 11:55:52 PDT --- Actually, I think the test case should compile even without the explicit @system attribute. I've filed a separate report about this, see issue 12529.

[Issue 12530] New: uniform initialization for type tuples too

2014-04-06 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=12530 Summary: uniform initialization for type tuples too Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2

  1   2   >