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 Ch

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 "dc

Re: AST like coding syntax. Easy upgrade!

2015-09-06 Thread anonymous via Digitalmars-d
On Monday 07 September 2015 02:24, Idan Arye wrote: > That's not considered as syntax check - that's an earlier stage > of the compilation process called "lexical > analysis"(https://en.wikipedia.org/wiki/Lexical_analysis) >From the Wikipedia article: "a lexer is generally combined with a parse

Re: AST like coding syntax. Easy upgrade!

2015-09-06 Thread anonymous via Digitalmars-d
On Monday 07 September 2015 00:37, cym13 wrote: > There already is a kind of "code string": > > interpret(q{ > var a = 2; > var b += a; > }); > > It doesn't do any kind of syntax check, but there again how do > you want to have syntax check for any language? The D

Re: Challenge

2015-08-30 Thread anonymous via Digitalmars-d
On Sunday 30 August 2015 16:43, rsw0x wrote: > Is there any reason that closure in this particular example can't > be created on the stack? Seems a bit weird. It may be possible to store it on the stack somehow, or as part of the map struct. I don't know. The point is, that's not what happens.

Re: Challenge

2015-08-30 Thread anonymous via Digitalmars-d
On Sunday 30 August 2015 12:21, rsw0x wrote: > import std.algorithm, std.range; > > auto foo(R)(R a, immutable int b) > { > return a.map!(x => x + b); > } > > @nogc @safe unittest > { > int[3] test = [1,2,3]; > > assert(test[].foo(3).equal(only(4,5,6))); > } > > does this count?

Re: Runtime error in code on main page

2015-08-25 Thread anonymous via Digitalmars-d
On Tuesday 25 August 2015 10:40, BBasile wrote: > please, stop spamming about that. [...] > and file an issue on the bug tracker. God damnit. Easy there. We don't want to discourage people from reporting bugs.

Re: Casting double to ulong weirdness

2015-08-24 Thread anonymous via Digitalmars-d
On Monday 24 August 2015 18:52, wrote: > import std.stdio; > void main() { >double x = 1.2; >writeln(cast(ulong)(x * 10.0)); >double y = 1.2 * 10.0; >writeln(cast(ulong)y); > } > > Output: > 11 > 12 > > > to!ulong instead of the cast does the right thing, and is a > viable work

Re: Wiki article: Starting as a Contributor

2015-08-22 Thread anonymous via Digitalmars-d
On Saturday 22 August 2015 11:05, ted wrote: > From here, I can go to 'Building DMD' and 'How to Fork and Build > dlang.org', which both seem to build DMD - I'm unsure of the overlap > aspects here. The 'dlang.org' project is the website. It deals with building dmd only insofar as you need a com

Re: string <-> null/bool implicit conversion

2015-08-20 Thread anonymous via Digitalmars-d
On Thursday, 20 August 2015 at 16:45:18 UTC, Márcio Martins wrote: Hi! string a = ""; string b; writeln(a ? "a" : "null"); writeln(b ? "b" : "null"); This program outputs: a null What? I suppose this is by design, but are there any plans to deprecate this? A compiler change disallowin

Re: cannot initialize static array by static this()

2015-08-20 Thread anonymous via Digitalmars-d
On Thursday 20 August 2015 08:33, aki wrote: > Is this a bug? Yes. Please file a bug at .

Re: dmd codegen improvements

2015-08-19 Thread anonymous via Digitalmars-d
On Wednesday, 19 August 2015 at 17:30:13 UTC, Walter Bright wrote: On 8/19/2015 7:34 AM, anonymous wrote: I have a about 30 lines of numerical code (using real) where the gap is about 200%-300% between ldc/gdc and dmd (linux x86_64). In fact dmd -O etc is at the level of ldc/gdc without any opt

Re: dmd codegen improvements

2015-08-19 Thread anonymous via Digitalmars-d
On Tuesday, 18 August 2015 at 10:45:49 UTC, Walter Bright wrote: So if you're comparing code generated by dmd/gdc/ldc, and notice something that dmd could do better at (1, 2 or 3), please let me know. Often this sort of thing is low hanging fruit that is fairly easily inserted into the back end

Re: dmd codegen improvements

2015-08-18 Thread anonymous via Digitalmars-d
On Tuesday, 18 August 2015 at 15:22:15 UTC, Joakim wrote: Also, soon the dmd compiler backend will be the only one written in D. :) Soon the front end will be written in D. And the front end is shared among dmd, gdc, ldc. Walter has expressed a desire to port the back end to D, too [1]. But t

Re: "else if" for template constraints

2015-08-17 Thread anonymous via Digitalmars-d
On Monday, 17 August 2015 at 22:32:10 UTC, Idan Arye wrote: On Monday, 17 August 2015 at 21:27:47 UTC, Meta wrote: [...] At that point, couldn't you just use static if inside the body of the template instead of using template constraints? No. Consider this: http://dpaste.dzfl.pl/a014aeba6e68.

Re: Bug in std.container: SList

2015-08-15 Thread anonymous via Digitalmars-d
On Friday, 14 August 2015 at 19:44:17 UTC, Xinok wrote: On Friday, 14 August 2015 at 18:12:42 UTC, anonymous wrote: Other insert* functions call the private function SList.initialize() which does the null-check for _root. I am working on a PR adding the missing call in insertAfter - that's a

Re: Passing parameters to thread functions

2015-08-15 Thread anonymous via Digitalmars-d
On Saturday, 15 August 2015 at 12:22:08 UTC, D_Starter wrote: int main() { uint var = 7; auto thread1 = new Thread(&thread_proc, val).start(); /* similar to C++ STL */ thread1.join(); return 0; } [/CODE] You might have guessed...this won't work. So how do I pass parameters t

Re: Bug in std.container: SList

2015-08-14 Thread anonymous via Digitalmars-d
On Friday, 14 August 2015 at 16:28:39 UTC, Xinok wrote: I can confirm that this is a bug but I'm not sure what the "correct" way is to fix it. SList creates a dummy node for the root of the list, but because structs don't allow default constructors, this dummy node is never allocated in the fir

Re: I'm confused about ranges (input and forward in practice, in algorithms)

2015-08-14 Thread anonymous via Digitalmars-d
On Friday, 14 August 2015 at 00:33:30 UTC, Luís Marques wrote: Despite using them all the time, I'm suddenly confused about ranges... My understanding is that (for library-worth code) algorithms that consume ranges are supposed to use .save() to be compatible with both ref type and value type

Re: Nested public imports - bug or feature?

2015-08-13 Thread anonymous via Digitalmars-d
On Thursday, 13 August 2015 at 15:29:19 UTC, Dicebot wrote: struct Something { public import a; } void main() { Something.foo(); } What's wrong with `import Something = a;`? Bugs?

Re: casting away const and then mutating

2015-07-26 Thread anonymous via Digitalmars-d
On Friday, 24 July 2015 at 21:12:57 UTC, Jonathan M Davis wrote: Well, regardless of whether mimicking inout like we're talking about with RedBlackTree should be considered defined behavior or not, I think that the spec should be updated so that the situation is clearer. It needs to be clear to

casting away const and then mutating

2015-07-23 Thread anonymous via Digitalmars-d
On a GitHub pull request, Steven Schveighoffer (schveiguy), Jonathan M Davis (jmdavis), and I (aG0aep6G) have been discussing if or when it's ok to cast away const and then mutate the data: https://github.com/D-Programming-Language/phobos/pull/3501#issuecomment-124169544 I've been under the im

Re: rust

2015-07-17 Thread anonymous via Digitalmars-d
On Friday, 17 July 2015 at 13:42:33 UTC, roaming wrote: On Thursday, 16 July 2015 at 12:06:46 UTC, Kagamin wrote: http://rainers.github.io/visuald/visuald/StartPage.html https://code.visualstudio.com/Updates/ can you do multiple dll on win yet? Do you ask this because of the runtime ?

Re: version: multiple conditions

2015-07-01 Thread anonymous via Digitalmars-d
On Monday, 15 June 2015 at 10:56:43 UTC, ketmar wrote: if only there is a way to define such enums from command line, akin to "- version"... +1. predefined versions can be easily set at CT as enum an used with static if() but with this feature is would make more sense.

Re: Analyze a D file for imports

2015-06-30 Thread anonymous via Digitalmars-d
On Tuesday, 30 June 2015 at 14:49:11 UTC, Atila Neves wrote: On Tuesday, 30 June 2015 at 13:21:18 UTC, anonymous wrote: [...] Here's a pull request to make rdmd do that: https://github.com/D-Programming-Language/tools/pull/170 [...] rdmd doesn't run on files that need updating; it always comp

Re: Analyze a D file for imports

2015-06-30 Thread anonymous via Digitalmars-d
On Tuesday, 30 June 2015 at 14:18:20 UTC, rsw0x wrote: you're skipping the part where they can be ran in parallel, dmd sees no benefit from this. Could you elaborate? Surely, one can run multiple instances of dmd in parallel, no? In my (possibly flawed) understanding, to get the quickest co

Re: Analyze a D file for imports

2015-06-30 Thread anonymous via Digitalmars-d
On Tuesday, 30 June 2015 at 04:02:00 UTC, Maaaks wrote: I want to make a simple build utility that will rebuild only those files which changed since last build and those files that depend on them. Which is the easiest and yet reliable way to parse a D source and find all imports in it (and fi

Re: Analyze a D file for imports

2015-06-30 Thread anonymous via Digitalmars-d
On Tuesday, 30 June 2015 at 13:22:10 UTC, rsw0x wrote: Be aware of the challenges: Compiling source files separately is slower than passing them all at once to the compiler. this is only true for dmd As far as I understand, the slowdown comes from parsing common dependencies again and again.

std.json.JsonOptions

2015-06-24 Thread anonymous via Digitalmars-d
On Tuesday, 23 June 2015 at 22:45:10 UTC, Vladimir Panteleev wrote: A rename can be proposed by creating a subthread: reply to this post, but change the name to the fully-qualified name of the identifier you'd like to see renamed. Please include a rationale and a proposed new name in your post.

Re: split up the changelog?

2015-06-20 Thread anonymous via Digitalmars-d
On Friday, 19 June 2015 at 21:28:11 UTC, anonymous wrote: For some reason the list stops at 2.023. I don't know if I messed something up, or if dmd is being silly. Will have to investigate. Filed issue 14717 - Ddoc macro recursion limit too low: https://issues.dlang.org/show_bug.cgi?id=14717

Re: split up the changelog?

2015-06-19 Thread anonymous via Digitalmars-d
On Friday, 19 June 2015 at 19:22:03 UTC, Steven Schveighoffer wrote: But, what about making the changelog menu an accordion expander, and then you have your version list right there on the left? Did that here: http://d-ag0aep6g.rhcloud.com/accordion/changelog/2.067.1.html I like it. I kept t

split up the changelog?

2015-06-19 Thread anonymous via Digitalmars-d
The changelog.html file is at about 1MB. That makes for a noticeable load time. And with all the issue lists, it's also a pretty solid wall of text: "Wait, is all this still for 2.067.0? Did I miss a version heading? I think I'm lost." Let's split it up by version! Pull request: https://githu

Re: Martin Nowak is officially MIA

2015-06-18 Thread anonymous via Digitalmars-d
On Thursday, 18 June 2015 at 14:43:15 UTC, Andrei Alexandrescu wrote: To wit, I wrote this to Martin and Walter on May 31st: Today is May 31st, so we're entering the last month of H1. I'd like to get an early start on updating the vision document, and before creating yet another rambling

Re: Martin Nowak is officially MIA

2015-06-18 Thread anonymous via Digitalmars-d
On Thursday, 18 June 2015 at 13:40:43 UTC, Craig Dillabaugh wrote: As others have said this seems a bit harsh. I presume that by 'we' you mean that yourself and Walter arrived at this decision together? If you really felt the need to remove Martin from this position, the appropriate way woul

Re: version: multiple conditions

2015-06-16 Thread anonymous via Digitalmars-d
On Tuesday, 16 June 2015 at 21:10:50 UTC, rsw0x wrote: On Tuesday, 16 June 2015 at 21:09:40 UTC, rsw0x wrote: On Tuesday, 16 June 2015 at 20:59:35 UTC, Walter Bright wrote: On 6/16/2015 1:46 PM, rsw0x wrote: You call it abuse, I call it developer freedom. #define BEGIN { #define END } Freed

Re: DIP80: phobos additions

2015-06-15 Thread anonymous via Digitalmars-d
On Sunday, 14 June 2015 at 21:50:02 UTC, Ola Fosheim Grøstad wrote: On Sunday, 14 June 2015 at 21:31:53 UTC, anonymous wrote: 2. Then write similar code with hardware optimized BLAS and benchmark where the overhead between pure C/LLVM and BLAS calls balance out to even. may there are more impor

Re: Scaling rdmd up: build package at a time

2015-06-14 Thread anonymous via Digitalmars-d
On Saturday, 6 June 2015 at 20:27:12 UTC, anonymous wrote: The seemingly obvious thing to do: Pass the source files that need rebuilding and the object files of other modules to one dmd invocation. I implemented this. Preliminary pull request: https://github.com/D-Programming-Language/tools/pu

Re: DIP80: phobos additions

2015-06-14 Thread anonymous via Digitalmars-d
1. Create generalised (only type template and my be flags) BLAS algorithms (probably slow) with CBLAS like API. See [1] (the Matmul benchmark) Julia Native is probably backed with Intel MKL or OpenBLAS. D version was optimized by Martin Nowak [2] and is still _much_ slower. 2. Allow users to

Re: Asked on Reddit: Which of Rust, D, Go, Nim, and Crystal is the strongest and why?

2015-06-10 Thread anonymous via Digitalmars-d
On Wednesday, 10 June 2015 at 15:13:41 UTC, Brian Rogoff wrote: On Wednesday, 10 June 2015 at 15:09:21 UTC, anonymous wrote: On Wednesday, 10 June 2015 at 15:08:08 UTC, anonymous wrote: any community dumb enough to buy merchandise with a programming language's name on it is full of idiots. bye

Re: Asked on Reddit: Which of Rust, D, Go, Nim, and Crystal is the strongest and why?

2015-06-10 Thread anonymous via Digitalmars-d
On Wednesday, 10 June 2015 at 14:29:51 UTC, Thiez wrote: On Wednesday, 10 June 2015 at 09:23:54 UTC, Chris wrote: One big difference between the D community and other languages' communities is is that D people keep criticizing the language and see every little flaw in every little corner, whic

Re: Asked on Reddit: Which of Rust, D, Go, Nim, and Crystal is the strongest and why?

2015-06-10 Thread anonymous via Digitalmars-d
On Wednesday, 10 June 2015 at 15:08:08 UTC, anonymous wrote: any community dumb enough to buy merchandise with a programming language's name on it is full of idiots. bye. p.s., Nim has the absolute worst community out of any of these languages. http://slashdot.org/comments.pl?sid=6771453&cid

Re: Building the docs with own changes

2015-06-08 Thread anonymous via Digitalmars-d
On Monday, 8 June 2015 at 11:27:58 UTC, John Colvin wrote: Is there any non-insane way of changing some documentation in a module and checking that any links/xrefs you may have added actually work? The dlang.org makefile appears to happily erase uncommitted changes in ../druntime and ../phobo

Re: Scaling rdmd up: build package at a time

2015-06-06 Thread anonymous via Digitalmars-d
On Saturday, 6 June 2015 at 21:24:05 UTC, Atila Neves wrote: I don't think I understand. Where would these object files come from unless you're doing per-module compilation, C-style? Huh, I somehow assumed dmd would spit out multiple object files when given multiple source files. Since that's

Re: Scaling rdmd up: build package at a time

2015-06-06 Thread anonymous via Digitalmars-d
On Saturday, 6 June 2015 at 19:44:15 UTC, Andrei Alexandrescu wrote: On 6/6/15 11:47 AM, Jacob Carlborg wrote: [...] I mean that rdmd should compile all files that has changed including its dependencies, no more, no less. It should compile all these files in one go. Yah, that's the traditio

Re: Getting Started

2015-06-05 Thread anonymous via Digitalmars-d
On Saturday, 6 June 2015 at 01:24:42 UTC, Israel wrote: Except my getting started page idea was supposed to cater to both new programmers and people who are just new to D... If you ever get around to realize it, that would be great. In the meantime, linking to Ali's tutorial and example pages

Re: Getting Started

2015-06-05 Thread anonymous via Digitalmars-d
On Friday, 5 June 2015 at 20:18:59 UTC, tcak wrote: I am looking at the main page of dlang.org, and really there is no page to warm up a new comer to D language. Sure, there are book links, details of language as "D Reference" etc, but those are not suitable for a new starting guy. http://d

Re: Code behaves incorrectly if it is compiled in std.functional

2015-06-05 Thread anonymous via Digitalmars-d
On Friday, 5 June 2015 at 03:15:46 UTC, anonymous wrote: On Friday, 5 June 2015 at 02:38:39 UTC, ketmar wrote: here's dustmited source: Further reduced: void unaryFun()(auto int a) pure nothrow @safe @nogc {} alias Identity(F) = F; void main() { unaryFun!()(41); static void fun(int n) pur

Re: Code behaves incorrectly if it is compiled in std.functional

2015-06-04 Thread anonymous via Digitalmars-d
On Friday, 5 June 2015 at 03:45:18 UTC, ketmar wrote: `auto int a`?! it shouldn't be accepted at all! Yeah, but it's the same with "auto ref".

Re: Code behaves incorrectly if it is compiled in std.functional

2015-06-04 Thread anonymous via Digitalmars-d
On Friday, 5 June 2015 at 02:38:39 UTC, ketmar wrote: here's dustmited source: Further reduced: void unaryFun()(auto int a) pure nothrow @safe @nogc {} alias Identity(F) = F; void main() { unaryFun!()(41); static void fun(int n) pure nothrow @safe @nogc {} alias F = typeof(fun); pragma

Re: rvalue references

2015-06-02 Thread anonymous via Digitalmars-d
On Tuesday, 2 June 2015 at 16:02:56 UTC, Namespace wrote: Thanks to DIP 25 I think it's time to review this again. I would implement it (if no one else wants to do it), but there are still some unanswered questions: 1. Is 'auto ref' still the chosen syntax (I guess so)? 2. Should auto ref for

Re: ddox no longer part of dlang.org?

2015-05-29 Thread anonymous via Digitalmars-d
On Saturday, 30 May 2015 at 01:11:33 UTC, Steven Schveighoffer wrote: In Andrei's presentation last night, he mentioned that the new ddox documentation coincided with a surge in visits to dlang.org. However, I just noticed, the link to them is gone. How long has that been the case, and can we

Re: Any plans to support STL value types?

2015-05-15 Thread anonymous via Digitalmars-d
On Friday, 15 May 2015 at 19:44:29 UTC, Jonathan M Davis wrote: On Friday, 15 May 2015 at 18:42:31 UTC, Kagamin wrote: Many STL types inherit from base classes, yet they are used as value types: std::string, std::vector etc. Are there plans to support C++ types with inheritance as proper value

Re: What wrong?

2015-05-15 Thread anonymous via Digitalmars-d
On Monday, 4 May 2015 at 08:48:47 UTC, Fyodor Ustinov wrote: Simple code: http://pastebin.com/raw.php?i=7jVeMFXQ This code works compiled by DMD v2.066.1 and LDC2 (0.15.1) based on DMD v2.066.1 and LLVM 3.5.0. $ ./z TUQLUE 42 11 Compiled by DMD v2.067.1 the program crashes: $ ./aa TUQLUE Segm

Re: D looses in speed to Common Lisp

2015-05-12 Thread anonymous via Digitalmars-d
On Tuesday, 12 May 2015 at 14:58:40 UTC, Vladimir Panteleev wrote: There is no way around this if you want your message to reach NNTP and mailing list users, which are about half of the posters here. The relevant protocols require a valid-looking email address in the "From" header. As the help

Re: D looses in speed to Common Lisp

2015-05-12 Thread anonymous via Digitalmars-d
On Monday, 11 May 2015 at 23:32:48 UTC, Dzhon Smit wrote: Could you re-run sbcl? The first time it runs it creates fasls, and afterwards it reuses them. Probably you shouldn't include the compile time for dmd either. Sure thing. I think that wasn't the first run already. But to make sure, I

Re: D looses in speed to Common Lisp

2015-05-11 Thread anonymous via Digitalmars-d
On Monday, 11 May 2015 at 21:15:33 UTC, Dzhon Smit wrote: Tests on my machine: [code]$ time ./fib 0 real0m6.458s user0m2.250s sys 0m0.933s $ time sbcl --dynamic-space-size 4GB --script fib.lisp 0 real0m1.884s user0m1.290s sys 0m0.260s[/code] Can't confirm that. Times f

Re: A few thoughts on std.allocator

2015-05-10 Thread anonymous via Digitalmars-d
On Sunday, 10 May 2015 at 09:50:00 UTC, Andrei Alexandrescu wrote: (file:///Users/aalexandre/code/d/dlang.org/web/phobos-prerelease/std_experimental_allocator_free_tree.html) bad link

Re: Phobos master broken ?

2015-05-05 Thread anonymous via Digitalmars-d
On Monday, 4 May 2015 at 14:32:16 UTC, Martin Krejcirik wrote: I can't seem to build phobos master on linux, unless I revert pull #3014 unittests DMD v2.067-devel-b9dee9e DEBUG std/math.d(2702): Error: number '0x1p-1024' is not representable std/math.d(2705): Error: number '0x1p-1024' is not re

Re: What wrong?

2015-05-04 Thread anonymous via Digitalmars-d
On Monday, 4 May 2015 at 08:48:47 UTC, Fyodor Ustinov wrote: Simple code: http://pastebin.com/raw.php?i=7jVeMFXQ This code works compiled by DMD v2.066.1 and LDC2 (0.15.1) based on DMD v2.066.1 and LLVM 3.5.0. $ ./z TUQLUE 42 11 Compiled by DMD v2.067.1 the program crashes: $ ./aa TUQLUE Segm

Re: D needs emplacement new

2015-05-01 Thread anonymous via Digitalmars-d
On Monday, 27 April 2015 at 13:12:51 UTC, anonymous wrote: void main() { import std.stdio; import core.memory: GC; auto pointerInDisguise = new size_t; *pointerInDisguise = cast(size_t) cast(void*) new Object; /* Not sure why stomping is necessary, but without this, th

Re: Interrogative: What's a good blog title?

2015-04-28 Thread anonymous via Digitalmars-d
On Monday, 27 April 2015 at 22:54:07 UTC, Andrei Alexandrescu wrote: Please let me know of any thoughts you might have! Benevolent Destroyer

Re: D needs emplacement new

2015-04-27 Thread anonymous via Digitalmars-d
On Monday, 27 April 2015 at 11:47:46 UTC, Namespace wrote: I create 1000 Foo's 1000 times. After the first iteration there are 1000 unused Foo objects and the GC wants to reallocate another 1000 Foo's. Now, what happen? The GC sees that the previous 1000 objects are unused, remove them and allo

Re: GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
On Friday, 24 April 2015 at 17:57:12 UTC, deadalnix wrote: On Friday, 24 April 2015 at 17:45:57 UTC, anonymous wrote: [...] I can't see how GC.malloc followed by GC.free is more pure than stdlib malloc followed by stdlib free. GC.free should probably not be pure, Ok, fair enough. Right now

Re: GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
On Friday, 24 April 2015 at 18:03:50 UTC, David Nadlinger wrote: In case there is further confusion about purity in D, let me do a shameless plug for an article I wrote a couple of years back: http://klickverbot.at/blog/2012/05/purity-in-d/ — David I'm pretty sure that I've read that. But I

Re: GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
On Friday, 24 April 2015 at 17:07:20 UTC, deadalnix wrote: On Friday, 24 April 2015 at 15:43:17 UTC, anonymous wrote: [...] Could core.stdc.stdlib.malloc and friends also be marked pure then? No. Allocating on the GC is "stateless" as the GC will handle the state by itself, from the program

Re: GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
On Friday, 24 April 2015 at 15:29:59 UTC, Marc Schütz wrote: auto a = sin(x) * sin(x);// sin() is called only once Could you give a complete example of when this is done? Two calls here (ldc2 -c -O): real grepme(real x) pure { import std.math; auto a = sin(x) * sin(x); return

Re: GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
On Friday, 24 April 2015 at 15:21:43 UTC, Steven Schveighoffer wrote: This is OK as long as f is *strong* pure. D pure is not the same as the traditional definition. And GC.malloc is not strong pure, as it returns mutable data. Ah, this is the piece I was missing. I was aware of weak/strong

GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
GC.malloc is marked pure. But it isn't, is it? This should hold for a pure function: assert(f(x) == f(x)); This fails with GC.malloc, of course. Or consider this: auto v = f(x); auto w = f(x); When f is pure, a compiler should be free to reuse the value of v for w. That's no good wi

Could someone review phobos PR #3123, please?

2015-04-17 Thread anonymous via Digitalmars-d
https://github.com/D-Programming-Language/phobos/pull/3123 It's been sitting there for two weeks.

Re: UFCS overrides alias this

2015-04-12 Thread anonymous via Digitalmars-d
On Sunday, 12 April 2015 at 20:48:57 UTC, Freddy wrote: test.d static import std.range; alias empty=std.range.empty; struct A{ string b; alias b this; } struct MyRange{ } char front(MyRange); void popFront(ref MyRange); bool empty(MyRange); void test(A a){ a

Re: UFCS overrides alias this

2015-04-12 Thread anonymous via Digitalmars-d
On Sunday, 12 April 2015 at 20:19:02 UTC, Freddy wrote: test.d struct A{ string b; alias b this; } struct MyRange{ } char front(MyRange); void popFront(ref MyRange); bool empty(MyRange); void test(A a){ a.empty; } $ dmd -o- test test.d(14): Error: func

Re: Wiki page: Coming From C++

2015-04-12 Thread anonymous via Digitalmars-d
On Sunday, 12 April 2015 at 03:51:50 UTC, Jakob Ovrum wrote: I can't seem to get the compiler to error on dangling else. I tried the examples in the original PR[1], but they seem to compile without error with DMD 2.067. Is anyone able to make the compiler error on dangling else? [1] https://g

Re: Benchmark of D against other languages

2015-04-02 Thread anonymous via Digitalmars-d
On Thursday, 2 April 2015 at 09:09:04 UTC, Martin Nowak wrote: I'm not asking for a linear algebra library in phobos, although we need one in dub and should consider having one in Phobos at some point too. But it would be nice if std.numeric came with a multiply(T)(T[][] a, T[][] b, T[][] resul

Re: Benchmark of D against other languages

2015-04-02 Thread anonymous via Digitalmars-d
On Wednesday, 1 April 2015 at 22:49:55 UTC, Martin Nowak wrote: ³: Places 2, 3, and 4 thanks to std.numeric.dotProduct. An optimized dense matrix multiplication would get us #1. According to https://github.com/JuliaLang/julia#Required-Build-Tools-External-Libraries building Julia requires Open

Re: Human unreadable documentation - the ugly seam between simple D and complex D

2015-03-28 Thread anonymous via Digitalmars-d
On Friday, 27 March 2015 at 18:38:32 UTC, rumbu wrote: schwartzSort it's a nice name only if you are German. Hardly. The name's just as meaningless on its own. It may be easier for us Germans to remember the spelling, but even we have to memorize that "tz", as "schwarz" (black) is more common

Re: readln() doesn't stop to read the input.

2015-03-28 Thread anonymous via Digitalmars-d
On Saturday, 28 March 2015 at 03:07:31 UTC, jonaspm wrote: module main; import std.stdio; import std.string; int main(string[] args) { int resp; char[] p, q; writefln("MENU DE OPCIONES"); writefln("1) Modus Ponens"); writefln("2) Modus Tollens"); writefln("3) Silo

[dlang.org] what to do with remaining orphaned pages

2015-03-22 Thread anonymous via Digitalmars-d
We recently recovered a bunch of pages that were removed from the menu accidentally [1]. Two pages are still orphaned and I'm not sure what to do about them: http://dlang.org/overview.html This was not part of some $(SUBNAV_*), so removal may have been deliberate. But there's no mention of i

Re: Where is my memory?

2015-03-22 Thread anonymous via Digitalmars-d
On Sunday, 22 March 2015 at 09:42:41 UTC, Ozan Süel wrote: Hi! I'm working on a Big Data project, where a huge amount of RAM is needed. Using D I've run into a - let's called it - memory leak. I tested this with following code: foreach(i; 0..1000) { int[] ints;

Re: The documentation for std.format needs work

2015-03-15 Thread anonymous via Digitalmars-d
On Sunday, 15 March 2015 at 18:02:30 UTC, Gary Willoughby wrote: The documentation seems to be screwed here: http://dlang.org/phobos/std_format.html Already fixed, just waiting for the release: http://dlang.org/phobos-prerelease/std_format.html https://github.com/D-Programming-Language/phobos

Re: dfmt options

2015-03-15 Thread anonymous via Digitalmars-d
On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote: * Hard limit for line length * Soft limit for line length offset for line wrap, e.g: - right guide = 80; - right tolerance = 10; if line length = 84 then no new line if line length = 91 then new line from the leftmost token befor

Re: I wondered what characters are allowed for delimiters in a delimited string

2015-03-06 Thread anonymous via Digitalmars-d
On Friday, 6 March 2015 at 01:44:30 UTC, Philip Miess wrote: The spec seemed a little loose, so I tried the first 256 to see. It is everything minus letters, null and control-z, opening brackets braces, parenthesis & whitespace Opening brackets, braces, and parenthesis are allowed; the 'Mat

Re: Parallel Merge Sort

2015-03-03 Thread anonymous via Digitalmars-d
On Wednesday, 4 March 2015 at 01:17:00 UTC, H. S. Teoh wrote: The 'in' modifier is the same as 'const' when applied to function parameters, but writing 'in' documents that the parameters are input parameters that won't be modified by the function. You forgot to mention "scope". "in" is short

Re: DIP74: Reference Counted Class Objects

2015-02-26 Thread anonymous via Digitalmars-d
On Friday, 27 February 2015 at 00:10:00 UTC, deadalnix wrote: On Thursday, 26 February 2015 at 21:50:56 UTC, Andrei Alexandrescu wrote: http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and discuss. Thanks, Andrei "The compiler detects automatically and treats specially all

Re: Let's Play Code Golf

2015-02-23 Thread anonymous via Digitalmars-d
On Monday, 23 February 2015 at 20:21:20 UTC, Charles wrote: My solution (150 characters, 15 points): void main(){import std.stdio;int t,n;readf(" %d",&t);while(t--){readf(" %d",&n);real a=0,i=0;for(;i Link to problem site: https://www.hackerrank.com/challenges/leibniz Anyone care to do

Re: D usage quotes/badges

2015-02-20 Thread anonymous via Digitalmars-d
On Friday, 20 February 2015 at 21:51:27 UTC, Shammah Chancellor wrote: While I know that there are quite a few development companies using go, Dude. we are not actively soliciting them for using their badges.

Bugzilla email queue jammed?

2015-02-18 Thread anonymous via Digitalmars-d
I just saw that an issue I'm subscribed to was commented on hours ago, but no email from Bugzilla yet. They usually arrive instantly. Maybe some gears got stuck on the server?

Re: Proposal : aggregated dlang git repository

2015-02-10 Thread anonymous via Digitalmars-d
On Tuesday, 10 February 2015 at 06:22:51 UTC, Andrei Alexandrescu wrote: This proposal is a good example of a cultural lore we should unlearn: high-churn, low-impact changes. https://github.com/D-Programming-Language/dlang.org/pull/896 is another example. Meaning changes with a large surface th

Re: [website redesign] PR for the one with the big red menu bar

2015-02-03 Thread anonymous via Digitalmars-d
On Monday, 2 February 2015 at 17:29:05 UTC, Nick Sabalausky wrote: The right-side panel is WAY too prominent. It takes nearly an entire third of the horizontal space, leaving the main content much to squished. Yeah, I'd forgotten to update the max-widths. https://github.com/D-Programming-Lang

Re: [website redesign] PR for the one with the big red menu bar

2015-02-01 Thread anonymous via Digitalmars-d
Alright, the grey variant with the old logo [1] got merged. Now, are we satisfied, or should I push further for the logo change? We all know that Walter is fond of the logo as it is, but I think he didn't comment on this version yet. Andrei said he'd be fine with it [2]. Preemptively obeying

Re: [website redesign] PR for the one with the big red menu bar

2015-01-30 Thread anonymous via Digitalmars-d
On Tuesday, 27 January 2015 at 20:02:12 UTC, anonymous wrote: PR: https://github.com/D-Programming-Language/dlang.org/pull/869 - For details see here. Live version: http://ag0aep6g-dlang.rhcloud.com - If you've visited this before, you may have to clear your cache to see the proper logo color.

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Wednesday, 28 January 2015 at 15:54:31 UTC, anonymous wrote: Here's a variant with a grey background and the old logo, suggested by veelo on GitHub: http://ag0aep6g-dlang.rhcloud.com/variants/grey-oldlogo/ Made a pull request for this version: https://github.com/D-Programming-Language/dlan

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Wednesday, 28 January 2015 at 20:27:27 UTC, anonymous wrote: On Wednesday, 28 January 2015 at 20:09:05 UTC, ponce wrote: Am I the only one to find the DMD 2.066.1 mention out of place and redundant? Not at all. I think someone else mentioned it, too. And I don't like it either. But it can

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Wednesday, 28 January 2015 at 20:09:05 UTC, ponce wrote: Am I the only one to find the DMD 2.066.1 mention out of place and redundant? Not at all. I think someone else mentioned it, too. And I don't like it either. But it can be changed independently, so I'm not doing it here.

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Wednesday, 28 January 2015 at 19:34:33 UTC, H. S. Teoh wrote: Looking at both variants side-by-side, I think your grey version is much better. The original design is far too red. However, the grey version is also noticeably darker; maybe both the menu and the stream boxes on the right should

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Wednesday, 28 January 2015 at 19:15:24 UTC, Bastiaan Veelo wrote: Exactly. And the ">>" on subitems and highlight on mouseover. Oh, had missed that. Was a different color, too. Updated the preview again.

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Wednesday, 28 January 2015 at 16:36:57 UTC, Bastiaan Veelo wrote: Should probably be a separate pull request but since you have them going: the red in the new menu should be a colour that occurs in the logo, IMO. Currently I think it is B83723 which I cannot find in the old logo. Picking wit

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Wednesday, 28 January 2015 at 16:13:44 UTC, H. S. Teoh wrote: I like it. The grey on the left panel is a bit too dark, though. Maybe a touch brighter? OTOH, if the point is to match it with the grey on the right stream boxes, then I guess it's OK. Yes, it's the same background color: #33

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Wednesday, 28 January 2015 at 16:10:44 UTC, Bastiaan Veelo wrote: On Wednesday, 28 January 2015 at 15:54:31 UTC, anonymous wrote: Here's a variant with a grey background and the old logo, suggested by veelo on GitHub: http://ag0aep6g-dlang.rhcloud.com/variants/grey-oldlogo/ Thanks for tr

Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread anonymous via Digitalmars-d
On Tuesday, 27 January 2015 at 20:02:12 UTC, anonymous wrote: PR: https://github.com/D-Programming-Language/dlang.org/pull/869 - For details see here. Live version: http://ag0aep6g-dlang.rhcloud.com - If you've visited this before, you may have to clear your cache to see the proper logo color.

[website redesign] PR for the one with the big red menu bar

2015-01-27 Thread anonymous via Digitalmars-d
PR: https://github.com/D-Programming-Language/dlang.org/pull/869 - For details see here. Live version: http://ag0aep6g-dlang.rhcloud.com - If you've visited this before, you may have to clear your cache to see the proper logo color.

<    1   2   3   >