Re: I can't believe this !!

2015-11-13 Thread anonymous via Digitalmars-d-learn
On 14.11.2015 07:30, MesmerizedInTheMorning wrote: https://issues.dlang.org/show_bug.cgi?id=15331 but it's true ! There's **nothing** to check the availability of a Key. At least I would expect opIndex[string key] to return a JSONValue with .type == JSON_TYPE.NULL, but no... Also If it was

Re: Compiler doesn't complain with multiple definitions

2015-11-12 Thread anonymous via Digitalmars-d-learn
On 12.11.2015 06:27, ric maicle wrote: I was playing with __traits and tried the code below. Shouldn't the compiler emit a warning that I'm defining isPOD multiple times and/or I'm defining something that is built-in like isPOD? // DMD64 D Compiler v2.069 import std.stdio; struct isPOD { bool

Re: Rust's simple download script

2015-11-10 Thread anonymous via Digitalmars-d
On 10.11.2015 14:12, Márcio Martins wrote: Could then combine this with OS detection through user-agent on the website and show the user the most likely option and command-line suggestion. Relevant PR that detects the OS and adds a direct download link to the right file to the homepage:

Re: opCmp with structs

2015-11-10 Thread anonymous via Digitalmars-d-learn
On 07.11.2015 16:59, anonymous wrote: Wat. It even compiles with @safe. That's not good. Filed an issue: https://issues.dlang.org/show_bug.cgi?id=15315

Re: Error not callable with argument types but types matches

2015-11-08 Thread anonymous via Digitalmars-d-learn
On 08.11.2015 08:17, Sliya wrote: I am on Mac OS, but I still don't get it. If the import was not case-sensitive, I would not have any error since the good file would have been loaded... Here I have no error saying file not found yet the file is not loaded. I'd love to know what really happens.

Re: assert(0)

2015-11-07 Thread anonymous via Digitalmars-d
On 07.11.2015 21:38, Fyodor Ustinov wrote: 1. I should generally _not_, but I _can_. D lets you to shoot your own foot, yes. You're encouraged not to do it, though. 2. Without "-release" assert(0) launches scope(exit), scope(failure) and "finally" blocks. I.e. we get a completely different

Re: assert(0)

2015-11-07 Thread anonymous via Digitalmars-d
On 07.11.2015 22:00, Fyodor Ustinov wrote: We do not have way to in "scope(failure)" or "scope(exit)" detect - it's "assert" or "throw". Ah, I get what you mean now. I think you have a point. Executing scope(failure/exit) code when an Error has been thrown may be bad. I'm not aware of the

Re: assert(0)

2015-11-07 Thread anonymous via Digitalmars-d
On 07.11.2015 19:42, Fyodor Ustinov wrote: Well. assert(0) located in very-very dangerous place. If we suddenly got to this place - Program should die immediately, otherwise there will be something terrible. But without "-release" this place less dangerous? Why without "-release" this assert

Re: opCmp with structs

2015-11-07 Thread anonymous via Digitalmars-d-learn
On 07.11.2015 15:36, Mike Parker wrote: It's actually possible to use move one instance into another, though: void main() { import std.algorithm : move; ku k1 = ku(1); ku k2 = ku(2); k2.move(k1); assert(k1.id == 2); } Wat. It even compiles with @safe. That's not good.

Re: struct constructor co nfusion

2015-11-06 Thread anonymous via Digitalmars-d-learn
On 06.11.2015 20:05, Spacen Jasset wrote: Also, I had to add a dummy private constructor to make my structs 'createable', or is there another way? e.g. struct Texture { @disable this(); static Texture create() { return Texture(0); } ... private: this(int) {

Re: parallel

2015-11-05 Thread anonymous via Digitalmars-d-learn
On 05.11.2015 21:30, Handyman wrote: Seems that 4 cores go all out on first 4 dishes, then 1 core deals with the last dish. With 4 cores I expect diner is ready after 5/4 = 1.25 secs though. What did I do wrong? You describe the situation correctly. The unit of work is a dish. That is, the

Re: parallel

2015-11-05 Thread anonymous via Digitalmars-d-learn
On 05.11.2015 21:43, Handyman wrote: foreach (i; 0..50) Thread.sleep(20.msecs); But then my program still says: '2 secs'. Please enlighten me. Let's look at the line that does the `parallel` call: foreach (dish; parallel(dishes, 1)) dish.prepare(); This means that `dishes` is

Re: parallel

2015-11-05 Thread anonymous via Digitalmars-d-learn
On 05.11.2015 21:52, Handyman wrote: On Thursday, 5 November 2015 at 20:45:25 UTC, Ali Çehreli wrote: That's still 1 second per task. The function prepare() cannot be executed by more than one core. Thanks. OK. So 'prepare' is atomic? Then let's turn it around: how can I make the cores

Re: Please vote for the DConf logo

2015-11-04 Thread Anonymous via Digitalmars-d-announce
On Wednesday, 4 November 2015 at 09:30:30 UTC, Andrei Alexandrescu wrote: Reply to this with 1.1, 1.2, 2, or 3: 1) by ponce: Variant 1: https://github.com/p0nce/dconf.org/blob/master/2016/images/logo-sample.png Variant 2:

Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-11-03 Thread anonymous via Digitalmars-d-announce
On 04.11.2015 01:41, Andrei Alexandrescu wrote: So, while I'm away (I'll be traveling for most of this week), please let's vote on the two DConf logo proposals and choose one for http://dconf.org. I think you've missed mine which makes it three. 1) by ponce: Variant 1:

Re: Capturing __FILE__ and __LINE in a variadic templated function

2015-11-01 Thread anonymous via Digitalmars-d-learn
On 01.11.2015 23:49, Adam D. Ruppe wrote: Yeah, just make the other args normal runtime instead of template: Or make it two nested templates: template show(T ...) { void show(string file = __FILE__, uint line = __LINE__, string fun = __FUNCTION__)() { ... } }

Re: Static constructors in structs.

2015-10-30 Thread anonymous via Digitalmars-d-learn
On 30.10.2015 21:23, TheFlyingFiddle wrote: Is this intended to work? struct A { __gshared static this() { //Add some reflection info to some global stuff. addReflectionInfo!(typeof(this)); } } I just noticed this works in 2.069, is this intended? static

Re: #ifdef hell

2015-10-30 Thread anonymous via Digitalmars-d
On Thursday, 29 October 2015 at 23:10:38 UTC, Walter Bright wrote: On 10/29/2015 3:23 PM, rsw0x wrote: On Thursday, 29 October 2015 at 22:18:11 UTC, Walter Bright wrote: https://www.cqse.eu/en/blog/living-in-the-ifdef-hell/ Another voice on what is wrong with the snarl of #ifdef's. how does

Re: DIP 84: Static Inheritance

2015-10-30 Thread anonymous via Digitalmars-d
On Friday, 30 October 2015 at 14:39:47 UTC, Atila Neves wrote: From the discussion here: http://forum.dlang.org/post/tgnxocozkurfvmxqo...@forum.dlang.org, I thought a library solution would do to fix the issue of getting decent error messages when a type fails to satisfy a template constraint

Re: Merging two named Tuples

2015-10-29 Thread anonymous via Digitalmars-d-learn
On 29.10.2015 19:59, Edwin van Leeuwen wrote: On Saturday, 24 October 2015 at 11:04:14 UTC, Edwin van Leeuwen wrote: I am trying to write a function to merge two named structs, but am completely stuck on how to do that and was wondering if anyone good provide any help. I know I can access the

Re: `clear`ing a dynamic array

2015-10-25 Thread anonymous via Digitalmars-d-learn
On Sunday, 25 October 2015 at 11:45:53 UTC, Shriramana Sharma wrote: http://dlang.org/arrays.html#resize says: """Also, you may wish to utilize the phobos reserve function to pre-allocate array data to use with the append operator.""" I presume this means

Re: Playing SIMD

2015-10-25 Thread anonymous via Digitalmars-d
On 25.10.2015 20:37, Iakh wrote: Full exaple with comparation of algorithms (SIMD, naive, binary search): http://dpaste.dzfl.pl/f3b8989841e3 From there: void runBinary() { static int i = 0; naiveIndexOf(cast(ubyte)(i++/ArraySize + 1), arr); } runBinary calls naiveIndexOf. You're not

Re: `clear`ing a dynamic array

2015-10-24 Thread anonymous via Digitalmars-d-learn
On 24.10.2015 15:18, Shriramana Sharma wrote: int a[] = [1,2,3,4,5]; Aside: `int[] a;` is the preferred style for array declarations. How to make it so that after clearing `a`, `b` will also point to the same empty array? IOW the desired output is: [1, 2, 3, 4, 5] [1, 2, 3, 4, 5] [] []

Re: Converting Unicode Escape Sequences to UTF-8

2015-10-22 Thread anonymous via Digitalmars-d-learn
On Thursday, October 22, 2015 08:10 PM, Nordlöw wrote: > How do I convert a `string` containing Unicode escape sequences > such as "\u" into UTF-8? Ali explained that "\u" is already UTF-8. But if you actually want to interpret such escape sequences from user input or some such, then

Re: Converting Unicode Escape Sequences to UTF-8

2015-10-22 Thread anonymous via Digitalmars-d-learn
On 22.10.2015 21:13, Nordlöw wrote: Hmm, why isn't this already in Phobos? I think parsing only Unicode escape sequences is not a common task. You usually need to parse some larger language of which escape sequences are only a part. For example, parsing JSON or XML are common tasks, and we

Re: Overloading an imported function

2015-10-22 Thread anonymous via Digitalmars-d-learn
On 22.10.2015 06:14, Shriramana Sharma wrote: anonymous wrote: Huh. I can't find any specification on this, but apparently the local overload set shadows any imported overload sets completely. Should I file a bug on this then? I'm not sure. Maybe make a thread on the main group first. It's

Re: can't zip a char[5], string[5], real[5]

2015-10-21 Thread anonymous via Digitalmars-d-learn
On Wednesday, 21 October 2015 at 14:06:54 UTC, Shriramana Sharma wrote: import std.stdio, std.range; void mywrite(char [5] chars, real[5] vals) { static string [5] fmts = ["%9.4f, ", "%9.4f; ", "%3d, ", "%3d, ", "%3d\n"]; foreach (e; zip(chars, fmts, vals)) write(e[0], " = ",

Re: "tuple unpacking" with zip?

2015-10-21 Thread anonymous via Digitalmars-d
On Wednesday, October 21, 2015 06:21 PM, Shriramana Sharma wrote: > Dear me... I meant UTF-8 encoded byte, rather than "codepoint", Also known as: code unit.

Re: Overloading an imported function

2015-10-21 Thread anonymous via Digitalmars-d-learn
On Wednesday, October 21, 2015 08:28 PM, Shriramana Sharma wrote: > Kagamin wrote: > >> http://dlang.org/hijack.html > > Thanks people, but even as per the rules: > > 1. Perform overload resolution independently on each overload set > 2. If there is no match in any overload set, then error >

Re: Implicit conversion rules

2015-10-21 Thread anonymous via Digitalmars-d-learn
On Wednesday, October 21, 2015 07:53 PM, Sigg wrote: > void func() { > int a = -10; > ulong b = 0; > ulong c = a + b; > writefln("%s", c); > } > > out: 18446744073709551574 > > But shouldn't declaring c as auto force compiler to go extra step >

Re: s/TypeTuple/AliasSeq/g?

2015-10-20 Thread anonymous via Digitalmars-d
On Wednesday, October 21, 2015 06:49 AM, Shriramana Sharma wrote: > BTW "isExpressions" – what kind of singular/plural grammar is that? When > renaming `isExpressionsTuple`, I would think it more appropriate to have > "isExpressionSeq" since it's an `AliasSeq` containing only expressions and > no

Re: Enough introspection to report variable name of calling argument

2015-10-19 Thread anonymous via Digitalmars-d-learn
On Monday, October 19, 2015 04:14 PM, Handyman wrote: > Is the following possible in D? To call a (unary) function f > with variable a, and let f print: > >> Called with argument named 'a'. > > I am of course asking for a generic solution, independent of the > actual variable name (in this

Re: Check Instance of Template for Parameter Type/Value

2015-10-19 Thread anonymous via Digitalmars-d-learn
On Monday, October 19, 2015 04:51 PM, Stewart Moth wrote: > struct Vector(type, int dimension_){ ... } > > Where type is going to be an int/float/etc and dimension_ is > 2/3/4. > > I could write a bunch of functions for each case, but I'd rather > not... I'd like to use something like the

Re: 0 in version number?

2015-10-18 Thread anonymous via Digitalmars-d
On Sunday, October 18, 2015 05:09 AM, Shriramana Sharma wrote: > By `ls -v1` I was illustrating that directory listing utilities are > capable of sorting numbers meaningfully, so there is no need for leading > zeroes for *that* purpose... You only showed that ls can do it, and you need a special

Re: what is wrong with this code??

2015-10-17 Thread anonymous via Digitalmars-d-learn
On Saturday, October 17, 2015 04:17 PM, steven kladitis wrote: > // it thows a range exception On which line?

Re: what is wrong with this code??

2015-10-17 Thread anonymous via Digitalmars-d-learn
On Saturday, October 17, 2015 04:50 PM, steven kladitis wrote: > core.exception.RangeError@sokuban.d(84): Range violation Line 84 being this: sDataBuild ~= sMap[ch]; Where sMap is: /*static*/ immutable sMap = [' ':' ', '.':'.', '@':' ', '#':'#', '$':' '];

Re: Compiling a .d file both as library and executable

2015-10-17 Thread anonymous via Digitalmars-d-learn
On Saturday, October 17, 2015 05:36 PM, Shriramana Sharma wrote: > In Python there is: > > if __name__ == "__main__": > > to allow the same source file to be treated as both an importable library > and as an executable script. In D is there any such mechanism to make a > main() compiled

Re: Idiomatic adjacent_difference

2015-10-16 Thread anonymous via Digitalmars-d-learn
On Friday, October 16, 2015 02:03 PM, Per Nordlöw wrote: > zip(r, r.dropOne).map!((t) => t[1]-t[0]); You should r.save one or both of those. The dropOne may affect both instances if you don't .save. By the way, what's the point of `dropOne` over `drop(1)`? It's not shorter. Does it do

Re: Why can't function expecting immutable arg take mutable input?

2015-10-16 Thread anonymous via Digitalmars-d-learn
On Friday, October 16, 2015 12:35 PM, Shriramana Sharma wrote: > Why can't a function that takes an immutable argument be called with a > mutable input at the call site? > > IOW, why isn't mutable implicitly convertible to immutable? immutable says that the data won't ever change. If references

Re: Builtin array and AA efficiency questions

2015-10-15 Thread anonymous via Digitalmars-d-learn
On Thursday, October 15, 2015 11:48 PM, Random D user wrote: > Should array have clear() as well? > Basically wrap array.length = 0; array.assumeSafeAppend(); > At least it would then be symmetric (and more intuitive) with > built-in containers. No. "clear" is too harmless a name for it to

Re: Regarding std.array.Appender

2015-10-13 Thread anonymous via Digitalmars-d-learn
On Tuesday 13 October 2015 15:47, Suliman wrote: > something like: auto content = file.byLine.map!("start " ~ a=>a ~ > " end"); That's not how it works at all. Maybe stick to the examples of whatever resource you're learning from, for now.

Re: Regarding std.array.Appender

2015-10-13 Thread anonymous via Digitalmars-d-learn
On Tuesday 13 October 2015 15:42, Suliman wrote: > map!(a=> a~=" +") work fine, but how to add before > at same time? Use ~ instead of ~=, like so: map!(a => "+" ~ a ~ "+")

Re: Struct toString works but not std.conv.to!string

2015-10-13 Thread anonymous via Digitalmars-d-learn
On Tuesday, 13 October 2015 at 22:21:43 UTC, Ali Çehreli wrote: Reduced with a workaround: struct UTCOffset { import std.conv : to;// Move to module scope to compile This introduces UTCOffset.to as an alias to std.conv.to. string toString() const { return "hello";

Re: DMD Compiler 'switches'

2015-10-12 Thread anonymous via Digitalmars-d-learn
On Monday 12 October 2015 17:38, ric maicle wrote: > I'm wondering if this small irregularity should be made consistent or > maybe I misunderstood something. As far as I know, the difference just happened, and there is point to it. The style without "=" is older and wasn't followed when new

Re: Ternary if and ~ does not work quite well

2015-10-12 Thread anonymous via Digitalmars-d-learn
On Monday 12 October 2015 17:39, TheFlyingFiddle wrote: > "foo" ~ true > > How does this compile? All i can see is a user trying to append a > boolean to a string which is obvously a type error. Or are they > converted to ints and then ~ would be a complement operator? In > that case..

Re: DMD Compiler 'switches'

2015-10-12 Thread anonymous via Digitalmars-d-learn
On Monday 12 October 2015 19:46, anonymous wrote: > and there is point to it Ugh, should have been: and there is *no* point to it.

Re: Class, constructor and inherance.

2015-10-11 Thread anonymous via Digitalmars-d-learn
On Monday 12 October 2015 07:28, Ali Çehreli wrote: > For example, you cannot get current time at run time. I think you mean compile time here.

Re: Ternary if and ~ does not work quite well

2015-10-11 Thread anonymous via Digitalmars-d-learn
On Monday 12 October 2015 07:23, Rikki Cattermole wrote: > On 12/10/15 6:19 PM, Andre wrote: [...] >> // assert("foo "~ true ? "bar" : "baz" == "foo bar"); does not compile [...] > I read it as: > > assert("foo "~ (true ? ("bar") : ("baz" == "foo bar"))); > > Oh hey look: >

Re: Comparing arrays of floats?

2015-10-09 Thread anonymous via Digitalmars-d-learn
On Saturday 10 October 2015 00:14, Straivers wrote: > Is it a bit-by-bit comparison, no > is the std.math.approxEqual function get called for > each element, no > or is it byte-by-byte across the entire array? no After comparing the lengths, the elements are checked for equality one by

Re: Beta D 2.069.0-b1

2015-10-08 Thread anonymous via Digitalmars-d-announce
On Thursday 08 October 2015 06:14, extrawurst wrote: > `The -property switch has been deprecated.` Does that mean > @property has no effect anymore ? Yes. I've made a pull request to mention that (and put a note on the spec page). https://github.com/D-Programming-Language/dlang.org/pull/1119

Re: Beta D 2.069.0-b1

2015-10-08 Thread anonymous via Digitalmars-d-announce
On Thursday 08 October 2015 16:34, anonymous wrote: > On Thursday 08 October 2015 06:14, extrawurst wrote: > >> `The -property switch has been deprecated.` Does that mean >> @property has no effect anymore ? > > Yes. Correction: @property has at least one effect without -property. typeof acts

Re: Varargs and default arguments

2015-10-07 Thread anonymous via Digitalmars-d-learn
On Wednesday 07 October 2015 02:22, Steven Schveighoffer wrote: > On 10/6/15 4:27 PM, anonymous wrote: [...] >> void foo(T...)(string str=null, T args = T.init) { [...] > I find it quite fascinating that in anonymous' solution, the T.init > doesn't ever actually get used! It's not used with

Re: What is the postfix for min long value?

2015-10-06 Thread anonymous via Digitalmars-d-learn
On Tuesday 06 October 2015 17:39, Ali Çehreli wrote: > I would expect the following to work: > > writeln( -9_223_372_036_854_775_808L); > > But it doesn't compile: > >Error: signed integer overflow > > It looks like a compiler bug to me. If so, a very embarrassing one. :)

Re: Bug? 0 is less than -10

2015-10-06 Thread anonymous via Digitalmars-d-learn
On Tuesday, 6 October 2015 at 14:46:56 UTC, tcak wrote: Maybe I am just too stressed out to see the problem. [code] import std.stdio; void main(){ size_t dec = 0; writeln( dec, " ", (dec <= -10), " ", (dec >= 10), " ", ((dec <= -10) || (dec >= 10)) ); } [/code] [output] 0 true

Re: Varargs and default arguments

2015-10-06 Thread anonymous via Digitalmars-d-learn
On Tuesday 06 October 2015 22:01, Nick Sabalausky wrote: > Ok, D-style varargs can accept a parameter length of zero: > > --- > void foo(T...)(T args) { > //... > } > foo(); > foo(t1, t2); > --- Terminology fun: The spec uses the term "D-style variadic function"

Re: This Week in D: livestreaming and we're moving forward on Windows bindings!

2015-10-05 Thread anonymous via Digitalmars-d-announce
On Monday 05 October 2015 21:29, Adam D. Ruppe wrote: > http://arsdnet.net/this-week-in-d/oct-04.html Quoting the the article: > which generates Microsoft format object files and the MS linker even on 32 bit I think you a word there. > past time pastime > avaiable available > D headers

Re: D 2015/2016 Vision?

2015-10-05 Thread anonymous via Digitalmars-d
On Monday 05 October 2015 21:07, Meta wrote: > There's a critical flaw in `scoped`. Observe: > > import std.stdio; > import std.typecons; > > class A > { > string name; > > this(string name) > { > this.name = name; > writeln("Creating A"); >

Re: This Week in D: livestreaming and we're moving forward on Windows bindings!

2015-10-05 Thread anonymous via Digitalmars-d-announce
On Monday 05 October 2015 23:30, Andy Smith wrote: > On Monday, 5 October 2015 at 19:35:53 UTC, anonymous wrote: [...] >> Quoting the the article: > > 'the the' ???!!! hehe [...] >> I think you a word there. >> > > I think you a grammatical error there. That one was on purpose, just like

Re: Range of variables

2015-09-30 Thread anonymous via Digitalmars-d-learn
On Wednesday, 30 September 2015 at 20:11:56 UTC, Freddy wrote: Is there a way to make a range of a variables lazily? --- int var1; int var2; void func() { int var3; auto range = /*range of var1,var2,var3*/ ; } --- There's std.range.only which gives you a range over the arguments you

Re: Idioms you use

2015-09-29 Thread anonymous via Digitalmars-d
On Tuesday 29 September 2015 15:06, Cauterite wrote: > some statements Buf of course! I totally didn't think of multiple statements. Thanks.

Re: Idioms you use

2015-09-29 Thread anonymous via Digitalmars-d
On Monday 28 September 2015 23:40, Freddy wrote: > Are any D idioms you use that you like to share? > Heres one of mine > --- > enum ctfe = > { > return 0xdead & 0xbad; > }(); > --- Why not just `enum ctfe = 0xdead & 0xbad;`? Are there cases where `enum foo = {return bar;}();` works but

Re: Interval Arithmetic

2015-09-29 Thread anonymous via Digitalmars-d-learn
On Tuesday, 29 September 2015 at 21:04:06 UTC, Wulfrick wrote: Is there an interval arithmetic library in D? I couldn’t find one. None I am aware of. In case I had to write my own, I understand that the IEEE standard floating point arithmetic provides operations for rounding up or down

Re: Move Semantics

2015-09-29 Thread anonymous via Digitalmars-d-learn
On Tuesday 29 September 2015 16:38, Alex wrote: > Another question on move semantics from the cheap seats... > > See my code here: http://dpaste.dzfl.pl/995c5af59dd6 [...] > The first (minor) question is: > I have to initialize some dummy inner objects, before I can apply > the move action. Is

Re: Server side command execution.

2015-09-28 Thread anonymous via Digitalmars-d-learn
On Monday 28 September 2015 12:40, anonymous wrote: > The client probably sends a newline; i.e. buffer[0 .. received] is > "exit\n". Or more likely it's "exit\r\n".

Re: Server side command execution.

2015-09-28 Thread anonymous via Digitalmars-d-learn
On Monday 28 September 2015 11:59, holo wrote: > I changed my condition to: > > if(to!string(buffer[0..received]) == "exit") > { > > break; > } > > > But it still dint help. The client probably sends a newline; i.e. buffer[0 .. received] is "exit\n".

Re: Parallel processing and further use of output

2015-09-26 Thread anonymous via Digitalmars-d-learn
On Saturday 26 September 2015 14:18, Zoidberg wrote: > I've run into an issue, which I guess could be resolved easily, > if I knew how... > > [CODE] > ulong i = 0; > foreach (f; parallel(iota(1, 100+1))) > { > i += f; > } > thread_joinAll(); >

Re: Parallel processing and further use of output

2015-09-26 Thread anonymous via Digitalmars-d-learn
On Saturday, 26 September 2015 at 13:09:54 UTC, Meta wrote: On Saturday, 26 September 2015 at 12:33:45 UTC, anonymous wrote: foreach (f; parallel(iota(1, 100+1))) { synchronized i += f; } Is this valid syntax? I've never seen synchronized used like this before. I'm

Re: reggae v0.5.0: new features in the D meta-build system

2015-09-25 Thread anonymous via Digitalmars-d-announce
On Friday 25 September 2015 23:27, Atila Neves wrote: > How does one compile 3 files "at the same time" and generate 3 > object files? There was a reference to a -multiobj option in that > post but that's not even in the man page. dmd -c foo.d bar.d baz.d rdmd would probably do this by now,

Re: reggae v0.5.0: new features in the D meta-build system

2015-09-25 Thread anonymous via Digitalmars-d-announce
On Saturday 26 September 2015 01:24, Atila Neves wrote: > There have been threads about this before. It turns out that > compiling per file is usually slower than compiling the whole > package/app at once. It's not intuitive, but it's true (I > measured it myself). reggae has an option to

Re: Why are static arrays not ranges?

2015-09-21 Thread anonymous via Digitalmars-d-learn
On Monday 21 September 2015 22:33, Jack Stouffer wrote: > import std.range; > > void main() { > int[6] a = [1, 2, 3, 4, 5, 6]; > > pragma(msg, isInputRange!(typeof(a))); > pragma(msg, isForwardRange!(typeof(a))); > pragma(msg, isRandomAccessRange!(typeof(a))); > } > > $ dmd

Re: OS minimum version

2015-09-21 Thread anonymous via Digitalmars-d-learn
On Monday 21 September 2015 14:47, ponce wrote: > 1. What is the minimum Windows version required by programs > created with DMD? http://dlang.org/dmd-windows.html says: "Windows XP or later, 32 or 64 bit".

Re: Question about Object.destroy

2015-09-20 Thread anonymous via Digitalmars-d-learn
On Sunday 20 September 2015 20:34, Lambert Duijst wrote: > On Sunday, 20 September 2015 at 18:21:52 UTC, Adam D. Ruppe wrote: [...] >> So after calling destroy(s), s is null, so it segfaults when >> you try to use it. [...] > Also when I print the address of s it gives me some hex number, > but

Re: Moving back to .NET

2015-09-20 Thread anonymous via Digitalmars-d
On Sunday 20 September 2015 19:39, Andrei Alexandrescu wrote: > Off the top of your head, can you list a few of the worst error messages > you've encountered? Not Adam, but this is on the top of my head as it just happened:

Re: Simple template constraint question

2015-09-19 Thread anonymous via Digitalmars-d-learn
On Saturday 19 September 2015 19:09, WhatMeWorry wrote: > And a more open ended question. Is there a more elegant solution > for the > below function? Maybe a one-liner? I have a knack for making > simple solutions > complex :) > > > > // Calculate the number of components for openGL

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-19 Thread anonymous via Digitalmars-d-learn
On Sunday 20 September 2015 00:09, Random D user wrote: > class Gui > { > enum MouseButton { Left = 0, Right }; > > private: > > struct ClickPair > { > MouseButton button = MouseButton.Left; > }; > > struct ClickPair // Second struct ClickPair with the enum

Re: Passing Arguments on in Variadic Functions

2015-09-17 Thread anonymous via Digitalmars-d-learn
On Thursday 17 September 2015 23:27, jmh530 wrote: > I think I could figure out how to look through the arguments for > a bool, but wouldn't that make me give up the default value for > the bool? If you don't find a bool, you use the default value.

Re: Final templated interface method not found

2015-09-15 Thread anonymous via Digitalmars-d-learn
On Wednesday 16 September 2015 06:14, Andre wrote: > Hi, > > following coding shoud work, or? > It doesn't compile with v2.068.0. > > Kind regards > André > > interface IfStatement > { > void execute(); > > final void execute(T...)(T t) > { > execute(); >

Re: Initalizing complex array types or some other problem ;/

2015-09-15 Thread anonymous via Digitalmars-d-learn
On Wednesday 16 September 2015 03:46, Prudence wrote: > In any case, Maybe you are not as smart as you think you are if > you can't understand it? kthxbye

Re: Initalizing complex array types or some other problem ;/

2015-09-15 Thread anonymous via Digitalmars-d-learn
On Tuesday 15 September 2015 22:09, Prudence wrote: > The code below doesn't work. Please be more specific in how it doesn't work. Mention the error message if there is one, or say how the code behaves differently from what you'd expect. Trying to compile the code (after kicking getch out), I

Re: chaining chain Result and underlying object of chain

2015-09-14 Thread anonymous via Digitalmars-d-learn
On Monday 14 September 2015 16:17, Laeeth Isharc wrote: > chain doesn't seem to compile if I try and chain a chain of two > strings and another string. > > what should I use instead? Please show code, always. A simple test works for me: import std.algorithm: equal; import std.range:

Re: chaining chain Result and underlying object of chain

2015-09-14 Thread anonymous via Digitalmars-d-learn
On Monday 14 September 2015 17:01, Laeeth Isharc wrote: >auto chain1 = chain("foo", "bar"); >chain1 = chain(chain1, "baz"); > > Realized that in this case it was much simpler just to use the > delegate version of toString and sink (which I had forgotten > about). But I

Re: Passing Arguments on in Variadic Functions

2015-09-14 Thread anonymous via Digitalmars-d-learn
On Monday 14 September 2015 21:59, jmh530 wrote: > This approach gives the correct result, but dmd won't deduce the > type of the template. So for instance, the second to the last > line of the unit test requires explicitly stating the types. I > may as well use the alternate version that

Re: [D Cookbook]about "Communicating with external processes" part.

2015-09-13 Thread anonymous via Digitalmars-d-learn
On Sunday 13 September 2015 15:32, xky wrote: > [ pipe.d ]: > == > import std.process; > import std.stdio; > > void main(){ > auto info = pipeProcess("child.exe"); > scope(exit) wait(info.pid); > >

Re: alias for regular expressions

2015-09-13 Thread anonymous via Digitalmars-d-learn
On Sunday 13 September 2015 21:47, Thunderbird wrote: > Some special interest thingamabob: > > I've tried to redefine "else if" as "elif" using "alias elif = > else if;". No matter what to no avail. > > I know this is probably useless fancy stuff, but is there any way > to get this done

Re: I guess this is a bug?

2015-09-12 Thread anonymous via Digitalmars-d-learn
On Saturday 12 September 2015 20:28, Random D user wrote: > prints (with option B): > bar: 0.00, 0.00 // BUG?? > baz: 1.00, 2.00 Looks like a bug to me. Please file an issue at https://issues.dlang.org/

Re: Mixin templates accessing mixed out scope

2015-09-12 Thread anonymous via Digitalmars-d-learn
On Saturday 12 September 2015 16:30, Ali Çehreli wrote: > Reduced: [...] > Error: type SingleStore is not an expression Reduced further: class MyStore { class SingleStore { static void New() // Removing 'static' compiles { new SingleStore(); }

Re: Mixin templates accessing mixed out scope

2015-09-12 Thread anonymous via Digitalmars-d-learn
On Saturday 12 September 2015 19:36, Prudence wrote: > On Saturday, 12 September 2015 at 17:11:04 UTC, anonymous wrote: [...] >> class MyStore >> { >> class SingleStore >> { >> static void New() // Removing 'static' compiles >> { >> new SingleStore(); >>

Re: Floating point in the type system

2015-09-12 Thread anonymous via Digitalmars-d
On Saturday 12 September 2015 18:08, Robert wrote: > It's unusual, because `float.nan != float.nan`, so one might > expect that `typeof(Foo!(float.nan) != Foo!(float.nan))`, whereas > this is clearly not the case, even with both the static assert > and runtime assert failing. I'm just curious

Re: Is this a bug?

2015-09-11 Thread anonymous via Digitalmars-d-learn
On Friday 11 September 2015 12:33, Rene Zwanenburg wrote: > The following fails to compile with an 'cannot deduce function > from argument types' error. When using an array of something > other than TypeInfo_Class everything works as expected. > > void main() > { > import

Re: Beta D 2.068.2-b1

2015-09-10 Thread anonymous via Digitalmars-d-announce
On Thursday, 10 September 2015 at 03:38:31 UTC, Martin Nowak wrote: Due to a regression in 2.068.1 we'll directly follow up with an unplanned point release 2.068.2. This is the beta for that point release. http://downloads.dlang.org/pre-releases/2.x/2.068.2/ Please test any of your code

Re: Beta D 2.068.2-b1

2015-09-10 Thread anonymous via Digitalmars-d-announce
On Thursday, 10 September 2015 at 09:56:40 UTC, wobbles wrote: Maybe try running dub build --force (to make it rebuild all of vibes dependencies also. Might solve it... no effect:(

Re: Sum and other algorithm functions

2015-09-10 Thread anonymous via Digitalmars-d-learn
On Thursday 10 September 2015 15:48, Namal wrote: > Hello, > > how can I define the range for the sum function which I want to > sum up? For instance how do I sum up the first 3 elements of an > array > > int[] a = [1,2,3,4,5,6,7,8,9]; > > or the last 3? First you slice the first/last 3,

Re: Beta D 2.068.2-b1

2015-09-10 Thread anonymous via Digitalmars-d-announce
On Thursday, 10 September 2015 at 11:44:42 UTC, anonymous wrote: On Thursday, 10 September 2015 at 09:56:40 UTC, wobbles wrote: Maybe try running dub build --force (to make it rebuild all of vibes dependencies also. Might solve it... no effect:( After uninstalling dmd 2.068 andinstalling

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread anonymous via Digitalmars-d
On Thursday, 10 September 2015 at 17:55:06 UTC, Prudence wrote: Of course, this hides the names outside the lambda, but a warning could be issued(no different than if one does it explicitly. This makes the parameter names part of the API. The author of a library is unable to rename parameter

Re: ref parameter qualifier and static arrays

2015-09-09 Thread anonymous via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 20:18:57 UTC, Paul wrote: Is it possible to call a function like this... void foo(ref int[] anArray) ...with slices of static arrays? I thought I might be able to use [0..$-1] but to no avail - I get an error like this (which is confusing!): Note that the

Re: ref parameter qualifier and static arrays

2015-09-09 Thread anonymous via Digitalmars-d-learn
On Wednesday 09 September 2015 22:18, Paul wrote: > > Is it possible to call a function like this... > > void foo(ref int[] anArray) > > ...with slices of static arrays? I thought I might be able to use > [0..$-1] but to no avail - I get an error like this (which is > confusing!): > > (ref

Re: Range functions expand char to dchar

2015-09-08 Thread anonymous via Digitalmars-d
On Tuesday 08 September 2015 20:28, Matt Kline wrote: > If we have a range of char elements, won't that do? regex() uses > the standard isSomeString!S constraint to take any range of chars. isSomeString!S doesn't check if S is a range. It checks if S is "some string", meaning: "Char[], where

Re: Range functions expand char to dchar

2015-09-08 Thread anonymous via Digitalmars-d
On Tuesday 08 September 2015 19:52, Matt Kline wrote: > An example: > > import std.algorithm; > import std.range; > import std.stdio; > import std.regex; > > void main() > { > // One would expect this to be a range of chars > auto test = chain("foo", "bar", "baz"); > // prints

Re: Release D 2.068.1

2015-09-07 Thread anonymous via Digitalmars-d-announce
On Monday 07 September 2015 00:32, Martin Nowak wrote: > http://downloads.dlang.org/releases/2.x/2.068.1/ Trying to download the 7z Windows file gives me a 403. http://downloads.dlang.org/releases/2015/dmd.2.068.1.windows.7z

Re: What are (dis)advantages of using pure and immutable by default?

2015-09-07 Thread anonymous via Digitalmars-d-learn
On Monday 07 September 2015 13:12, Bahman Movaqar wrote: > I was under the impression that when a variable, that is declared > as `immutable`, is passed to a function, a copy of the value is > passed. > > However based on "marks" I can imagine that since the data is > marked as `immutable`

<    1   2   3   4   5   6   7   8   9   >