Re: Give DLS a try

2018-08-14 Thread w0rp via Digitalmars-d
For those who like Vim, I opened an issue for adding dls support to ALE. https://github.com/w0rp/ale/issues/1812 I might work on it myself some day, or someone else can set it up. ALE is a linter plugin for Vim I wrote, which is now the most popular one after Syntastic and offers some

Re: DIP 1017--Add Bottom Type--Community Review Round 1

2018-08-09 Thread w0rp via Digitalmars-d
On Thursday, 9 August 2018 at 10:37:36 UTC, Andrea Fontana wrote: On Thursday, 9 August 2018 at 04:10:47 UTC, Nicholas Wilson wrote: The DIP makes the claim that: * "[@noreturn] has the awkward result of a function specifying it has a return type T, but never returns that type". When it is

Re: DIP 1017--Add Bottom Type--Community Review Round 1

2018-08-09 Thread w0rp via Digitalmars-d
A better name for this type is `never`, which is the name of the TypeScript type with similar semantics. https://www.typescriptlang.org/docs/handbook/basic-types.html#never `nothing` is also a decent name, used in some other languages, but `never` makes it more obvious that a function never

Things I found great about TypeScript that D could benefit from

2018-04-27 Thread w0rp via Digitalmars-d
Hello everyone! I haven't written a post in a long time. I love D, and I've been a D hobbyist for years now. Though I haven't written any D in a long time, I keep an eye on the changelogs and such. More recently I've been using TypeScript (TS) at work for front end code. TypeScript is a very

Re: Maybe D is right about GC after all !

2017-12-19 Thread w0rp via Digitalmars-d
On Tuesday, 19 December 2017 at 09:54:05 UTC, Walter Bright wrote: "C, Python, Go, and the Generalized Greenspun Law" http://esr.ibiblio.org/?p=7804 I think D and the GC are highly appropriate for developing high performance application software. That's where D really shines. It's a shame

Re: Project Elvis

2017-10-29 Thread w0rp via Digitalmars-d
One man's valid value is another man's invalid value. You can't test for a general concept of "invalid," as you need context. You can test for "falsy" with no context.

Re: Required Reading: "How Non-Member Functions Improve Encapsulation"

2017-10-29 Thread w0rp via Digitalmars-d
I've noticed the benefits of writing non member functions in Python codebases. Say if you have a User model in a Django ORM, and you have a Thing model, and some operation on User and Thing. I've noticed that your code is almost always better if you write a non member function on User and

Re: is private broken?

2017-10-10 Thread w0rp via Digitalmars-d
https://wiki.dlang.org/Access_specifiers_and_visibility#private Private means that only members of the enclosing class can access the member, or members and functions in the same module as the enclosing class. You can access private attributes anywhere in the same module.

Re: all OS functions should be "nothrow @trusted @nogc"

2017-08-01 Thread w0rp via Digitalmars-d
Direct OS function calls should probably all be treated as unsafe, except for rare cases where the behaviour is very well defined in standards and in actual implementations to be safe. The way to get safe functions for OS functionality is to write wrapper functions in D which prohibit unsafe

Re: proposed @noreturn attribute

2017-07-24 Thread w0rp via Digitalmars-d
I didn't look through all of the replies to this thread to check that this hasn't been mentioned yet, but TypeScript uses the 'never' return type for functions that never return. https://www.typescriptlang.org/docs/handbook/basic-types.html#never The type isn't used for any optimisations,

Re: opEquals nothrow

2017-07-20 Thread w0rp via Digitalmars-d-learn
On Thursday, 20 July 2017 at 15:10:24 UTC, Aldo wrote: On Thursday, 20 July 2017 at 14:59:50 UTC, Steven Schveighoffer wrote: On 7/20/17 10:38 AM, Aldo wrote: Hello, im tring to add nothrow keyword in my code, but compilation fails : function 'object.opEquals' is not nothrow its a simple

null analysis with control flow

2016-09-21 Thread w0rp via Digitalmars-d
null references. We hate them, they make our programs exit in circumstances we didn't anticipate. Tony Hoare called them a "billion dollar mistake." I've spoken about this issue in this forum before, others have, we know this issue well. TypeScript 2 and Swift, and some Java IDEs, implement a

Re: Lint D code while you type in Vim

2016-09-18 Thread w0rp via Digitalmars-d
On Saturday, 17 September 2016 at 04:57:03 UTC, Basile B. wrote: You should use Dscanner to do this, not DMD. DScanner does not (or few) semantic, so just the module AST is necessary. It's way faster. I know this because I was doing something similar to build the symbol list in Coedit 1

Lint D code while you type in Vim

2016-09-16 Thread w0rp via Digitalmars-d
I have been working on a plugin for Vim 8 and NeoVim which runs linters while you type in Vim, which is an improvement over the plugins for Vim so far which can only lint after you save a file back to disk. So far my plugin seems to work pretty well, and I have been using it for my job, mainly

Re: Usability of D for Visually Impaired Users

2016-09-04 Thread w0rp via Digitalmars-d
On Sunday, 4 September 2016 at 20:01:21 UTC, Walter Bright wrote: https://news.ycombinator.com/item?id=12424656 It is our ethical duty to make D and dlang.org usable for visually impaired programmers. If any of you are visually impaired, or have programmer friends/colleagues who are, a

Re: if-expressions

2016-08-30 Thread w0rp via Digitalmars-d
On Friday, 26 August 2016 at 18:25:00 UTC, Cauterite wrote: Here's a little patch you guys might enjoy: https://github.com/dlang/dmd/compare/master...Cauterite:ifExpr0 It enables this syntax: int foo = if(asdf: 5 else 6); equivalent to int foo = asdf ? 5 : 6; Here's some other examples which

Re: The case for small diffs in Pull Requests

2016-07-21 Thread w0rp via Digitalmars-d
On Monday, 18 July 2016 at 22:30:56 UTC, Walter Bright wrote: https://medium.com/@kurtisnusbaum/large-diffs-are-hurting-your-ability-to-ship-e0b2b41e8acf#.h3eo1yvqv I've been advocating for a while now that PRs should be small, incremental, encapsulated and focused. This has not been without

Re: Our docs should be more beautiful

2016-07-21 Thread w0rp via Digitalmars-d
I like this kind of discussion. It's good to make the website look as attractive and functional as we can make it. I think we just need to remember to file each issue individually, then group all of the issues to track all of them. Then each individual issue can be tackled, and some work can

Re: QtE5 - is a wrapping of Qt-5 for D

2016-06-22 Thread w0rp via Digitalmars-d-announce
On Monday, 20 June 2016 at 16:52:04 UTC, MGW wrote: This my library has about 400 functions from Qt and is quite efficient for small applications. https://github.com/MGWL/QtE5 Small video about QtE5 and id5 written on its basis - an example of use. QtE5 on Mac OSX

Re: [OT] Things I like about Andrei

2016-06-03 Thread w0rp via Digitalmars-d
I've learned in software development that you hardly ever hear praise from others. Usually you only hear from others when you make mistakes. Such is life. Andrei is a pretty cool guy, and I'm totally pro Andrei. I'm thankful for the years of dedication and the development of a pretty

Re: Why I won't fix phobos bugs anymore

2016-06-03 Thread w0rp via Digitalmars-d
I think a healthy option might be to find one or more professionals Andrei can respect and trust to delegate the work of approving pull requests and such to. As always with open source contributions, it's largely up to someone stepping up to the game. Then maybe bug fixes can be approved at a

Re: [OT] A Rust tool for Cross-compilation

2016-05-16 Thread w0rp via Digitalmars-d
On Sunday, 15 May 2016 at 15:31:56 UTC, Joakim wrote: On Sunday, 15 May 2016 at 07:46:05 UTC, Adil wrote: Found this on Reddit. http://blog.rust-lang.org/2016/05/13/rustup.html Do you think it's possible to have this in D? It's worth reading the article even if we don't plan to build one of

Re: Github names & avatars

2016-05-14 Thread w0rp via Digitalmars-d
I stick with my pseudonym. I don't go to great lengths to protect my identity. You could probably figure out my name and address if you really wanted to. The concern isn't so much the government, but other individuals doing harm to you. We live in a world which is very politically correct,

Re: A Recurring Question

2016-04-18 Thread w0rp via Digitalmars-d
On Monday, 18 April 2016 at 20:24:40 UTC, Jesse Phillips wrote: On Sunday, 17 April 2016 at 15:23:50 UTC, w0rp wrote: void main() { // Print all directories from this one up to and including /. getcwd() .unaryRecurrence!dirName .until("/", OpenRight.no) .each!writeln; }

Re: A Recurring Question

2016-04-18 Thread w0rp via Digitalmars-d
On Monday, 18 April 2016 at 12:02:24 UTC, thedeemon wrote: On Sunday, 17 April 2016 at 15:23:50 UTC, w0rp wrote: auto unaryRecurrence(alias func, T)(T initialValue) { return recurrence!((values, index) => func(values[0]))(initialValue); } This is kind of neat. My question is, should

A Recurring Question

2016-04-17 Thread w0rp via Digitalmars-d
I recently found myself wanting an algorithm to apply f(x) repeatedly, generating an infinite sequence, for a variety of reasons. One of those reasons is to generate ancestor directories. Typically when I desire such a thing, I find myself trying to find the existing algorithm which does this

Re: So what does (inout int = 0) do?

2016-04-15 Thread w0rp via Digitalmars-d
On Friday, 15 April 2016 at 07:33:42 UTC, w0rp wrote: I think it has something to do with making the function, in this case a lambda, inout, so that it can accept inout types. Then the typeof bit is a weird way to writing something like __traits(compiles, ...) , because functions which have no

Re: So what does (inout int = 0) do?

2016-04-15 Thread w0rp via Digitalmars-d
I think it has something to do with making the function, in this case a lambda, inout, so that it can accept inout types. Then the typeof bit is a weird way to writing something like __traits(compiles, ...) , because functions which have no type result in void, and that fails the typeof check.

Re: Is it me, or the search doesn't work?

2016-04-14 Thread w0rp via Digitalmars-d
On Thursday, 14 April 2016 at 20:55:24 UTC, Vladimir Panteleev wrote: On Thursday, 14 April 2016 at 20:31:11 UTC, Andrei Alexandrescu wrote: What is happening there? Looking at the code, it appears to be "by design". Pressing the Enter key is simply not handled, instead it seems that you are

Re: Let's move to github.com/dlang !

2016-04-14 Thread w0rp via Digitalmars-d
On Thursday, 14 April 2016 at 21:59:33 UTC, Vladimir Panteleev wrote: Daniel Lang, the previous owner of the GitHub dlang username, has graciously donated us the namespace: http://forum.dlang.org/post/fmarvvsgthihozcil...@forum.dlang.org For the sake of shorter URLs, less typing, and

Re: I want this so badly, please implement

2016-04-14 Thread w0rp via Digitalmars-d
On Wednesday, 13 April 2016 at 13:17:57 UTC, cym13 wrote: There's a world between exceptionnaly getting a user password in order to detect and solve a bug through an error message and knowingly logging every single user password, be it only on the legal side. In France for example you don't

Re: Could we reserve void[T] for builtin set of T ?

2016-04-04 Thread w0rp via Digitalmars-d
Has no one mentioned void[0][T] yet? alias Set(T) = void[0][T]; void add(T)(ref void[0][T] set, T key) { set[key] = (void[0]).init; } bool contains(T)(inout(void[0][T]) set, T key) { return (key in set) !is null; } void main() { Set!int set; set.add(1);

Re: Clojure vs. D in creating immutable lists that are almost the same.

2016-02-27 Thread w0rp via Digitalmars-d
On Saturday, 27 February 2016 at 22:31:28 UTC, Brother Bill wrote: Clojure supports immutable lists that allow adding and removing elements, and yet still have excellent performance. For D language, what are the recommended techniques to use functional programming, without massive copying of

Re: Speed kills

2016-02-21 Thread w0rp via Digitalmars-d
I think it's important that DMD gets more of the easier optimisations. Most new users won't bother trying GDC or LDC, and if DMD doesn't generate fast enough code, they might leave before they try the compilers with better optimisations.

Re: C++ UFCS update

2016-02-16 Thread w0rp via Digitalmars-d
Personally, I find this proposal for C++ to be laughable. It's like hitch hiking from New York to California, and only getting as far as Texas and calling it good. The great thing about our UFCS is the left-to-right chaining of algorithms. x.map!(...).filter!(...).reduce!(...) It beats the

Re: Head Const

2016-02-15 Thread w0rp via Digitalmars-d
I think the point about name mangling is very true. That's the most important thing, being able to call all of the C++ functions. I personally love that const and immutable are transitive in D. I get annoyed in other languages when I have const objects containing mutable objects, and no real

Re: Weird issue with std.range.iota.length

2016-02-14 Thread w0rp via Digitalmars-d
Maybe I'm missing something, but can't the length just be size_t? I doubt there is much you could do with code which generates finite sequences larger than the addressable memory space, aside from very abstract and inefficient mathematical calculations which skip over elements. iota would

Re: OT: 'conduct unbecoming of a hacker'

2016-02-11 Thread w0rp via Digitalmars-d
His article is way too long. It seems like an article about whining about how people whine too much.

Re: Just because it's a slow Thursday on this forum

2016-02-10 Thread w0rp via Digitalmars-d
I wonder if the addition of another function for printing will confuse some new users.

Re: D's equivalent to C++'s std::move?

2016-02-10 Thread w0rp via Digitalmars-d
Back on the original topic, Scott Meyers often says "std::move doesn't move." It's more like std::rvalue_cast. C++ uses r-value references in order to be able to rip the guts out of objects and put them into other objects. D doesn't have a distinct r-value reference type, and postblit is

Re: Just because it's a slow Thursday on this forum

2016-02-10 Thread w0rp via Digitalmars-d
On Wednesday, 10 February 2016 at 19:30:26 UTC, Andrei Alexandrescu wrote: On 02/10/2016 01:51 PM, w0rp wrote: I wonder if the addition of another function for printing will confuse some new users. In my experience: * two names for the same exact thing => annoyance (not only in D, e.g.

Re: Safe cast of arrays

2016-02-10 Thread w0rp via Digitalmars-d
Yeah, I think it should only allow the equivalent of a dynamic_cast for types in @safe code, and not allow the equivalent of a reinterpret_cast, for T, T*, or T[].

Re: Safe cast of arrays

2016-02-10 Thread w0rp via Digitalmars-d
On Tuesday, 9 February 2016 at 21:20:53 UTC, Iakh wrote: https://dlang.org/spec/function.html#function-safety Current definition of safety doesn't mention cast of arrays. E.g this code allowed by DMD int[] f(void[] a) @safe pure { return cast(int[])a; } But same void* to int* cast is

Re: Why do some attributes start with '@' while others done't?

2016-01-26 Thread w0rp via Digitalmars-d
I think we bicker and pontificate about these kinds of issues too much. Do we want @ for every attribute or not? If we haven't decided, we should decide. If we do want @ for everything, then create a pull request which does nothing but support @ for all current attributes, in addition to

Re: Regex in ctfe?

2016-01-26 Thread w0rp via Digitalmars-d
Unless I'm mistaken, I think the compiler for regex currently works at compile time, but not the matcher. Maybe someone who knows the module could add support for that.

Re: What are the real advantages that D offers in multithreading?

2016-01-26 Thread w0rp via Digitalmars-d
The most important thing D does, which is fundamentally different, is that variables are thread local by default, and you must opt-in to variables that are shared across threads. Immutable data can be shared implicitly, because there are no writers. This means that if you keep only a small

Re: forum.dlang.org is now available via HTTPS

2016-01-21 Thread w0rp via Digitalmars-d
This is pretty cool. We should maybe see if we can add it to the "HTTPS Everywhere" plugin. Does anyone else use that? I've always found it so hard to just add a new domain to its rule list.

Re: Struct initialization using member syntax without variable

2016-01-14 Thread w0rp via Digitalmars-d
Maybe there is some parsing difficulty, but if it's possible to add something like this, I think it would be nice.

Re: [dlang.org] new forum design - preview

2016-01-14 Thread w0rp via Digitalmars-d
I love this redesign. Anyone who complains about not taking up the full width of the screen is wrong. If lines stretch on eternally, they become harder to scan with your eyes. It's a well known effect which has been studied and documented. There is some difference of opinion on what the

Re: DIP86: Consistency for the "deprecated" attribute/storage class

2016-01-14 Thread w0rp via Digitalmars-d
On Thursday, 14 January 2016 at 02:54:01 UTC, Jack Stouffer wrote: On Thursday, 14 January 2016 at 02:31:38 UTC, Brian Schott wrote: http://wiki.dlang.org/DIP86 Your thoughts? I guess there's no reason not to, so LGTM. The use of the deprecated attribute on variables seems misguided in the

Re: Proposal: Database Engine for D

2016-01-12 Thread w0rp via Digitalmars-d
I've played with the idea of using operator overloading for some kind of ORM before, but I don't think it's strictly necessary to use operator overloading for an ORM at all. Maybe in some cases it might make sense. I don't think the answer for building such a thing is to think of one idea,

Re: "Good PR" mechanical check

2016-01-12 Thread w0rp via Digitalmars-d
I think using dfmt for this is a good idea. If there any problems with dfmt which would prevent it from being used on Phobos, the problems can be patched and then that would strengthen dfmt.

Re: C++ std::string, std::vector and name mangling

2015-12-08 Thread w0rp via Digitalmars-d
Thank you for your work on this. Hopefully someone else knows enough about name mangling and is willing to do some work on it.

Re: Advent of Code

2015-12-08 Thread w0rp via Digitalmars-d
Thanks for suggesting this. This is fun! Although, I've taken on quite a different challenge myself. I'm computing all of the answers only by using my console in Firefox. I'm actually getting through these pretty quickly. (It helps to know some ES5 and ES6.) I can imagine the D code already,

Easy and efficient database usage

2015-10-23 Thread w0rp via Digitalmars-d
I keep finding myself thinking about what an API in D for easy and efficient database usage would look like. I started thinking about how ORM is done in libraries in other languages, and started to become obsessed with the notion that perhaps there should be a library for D which is roughly as

Re: Behavior of opEquals

2015-09-02 Thread w0rp via Digitalmars-d
On Wednesday, 2 September 2015 at 18:57:11 UTC, Jacob Carlborg wrote: I encountered a problem in the implementation of std.xml.Document.opEquals (yes, I've reported an issue). The problem is demonstrated with this example: class Base { int a; override bool opEquals (Object o) {

Re: Moving forward with work on the D language and foundation

2015-08-29 Thread w0rp via Digitalmars-d-announce
I'm a bit late to reply to this announcement, but I would like to say that I am quite surprised by it. I really respect your decision to leave what must have been a very lucrative job to double down on D. I have loved D since I picked it up years ago, and TDPL was my first real introduction

Re: Object.factory() and exe file size bloat

2015-08-25 Thread w0rp via Digitalmars-d
I think this is another case where Walter has got it right, by and large. I think we should try and use 'export' to cut down on binary bloat, and it looks like an acceptable solution. I have said many times, lock your versions down, and don't update your D compiler until you're ready to pay

Re: foreach with a default range

2015-06-11 Thread w0rp via Digitalmars-d
On Thursday, 11 June 2015 at 08:24:25 UTC, Dmitry Olshansky wrote: On 11-Jun-2015 11:18, w0rp wrote: A thought just came to me. When I'm implementing foreach for a container, I'm left with the choice of using a range for a container or opApply. I've found often that I prefer the ranges, as

foreach with a default range

2015-06-11 Thread w0rp via Digitalmars-d
A thought just came to me. When I'm implementing foreach for a container, I'm left with the choice of using a range for a container or opApply. I've found often that I prefer the ranges, as it's easy for me to write a range that satisfies @nogc @safe pure nothrow, etc. This is because the

Re: Right after allocators: containers or database connectivity?

2015-06-10 Thread w0rp via Digitalmars-d
Containers seems like the best thing to work on after the allocators. Then you could start using the allocators for the containers, so you can choose different allocation strategies for them. I'd definitely like to see a standard container for sets, instead of the void[0][T] thing I usually

Re: stream == range ? [Sliding window]

2015-06-01 Thread w0rp via Digitalmars-d
I wonder if we even need something like popFrontN. Whenever I have wanted to read chunks at a time, like some data from a TCP socket, I have always specified a buffer size and tried to get as much data as I can fit into my buffer for each iteration. You can accomplish this with a range of

Re: Chainable template mixin and opCat()

2015-06-01 Thread w0rp via Digitalmars-d
I think my only complaint for this is that it wouldn't work for all ranges, so you'd be able to use the operator some times, but not others. This is because you have to define the operators inside of the structs or classes, and you can't write operators as free functions. (Which is a good

Re: Why aren't you using D at work?

2015-06-01 Thread w0rp via Digitalmars-d
I'll add in my story. My job is working as part of a team on a small-to-medium scale web application. Our application layer is implemented in Python and Django. This would be the place where D would fit in the most. So I think this comes down to an argument of why we would choose to use

Re: 0 is not a power of 2

2015-05-19 Thread w0rp via Digitalmars-d
I believe you can also do x -x == x. I'm not sure if that will be actually faster or slower. You could maybe cut the instructions down a little with an asm{} block. The compiler might not figure out that it can re-use a register for x on the left and x on the right there. You might use popcnt

Re: Any plans to support STL value types?

2015-05-19 Thread w0rp via Digitalmars-d
JMD is right. Using inheritance for value types is a bad idea, and it shouldn't be done. The problem is that when you assign a derived value type to a base value type, the members in the derived type are removed, and this can lead to very weird behaviour. You could enforce that derived value

Re: 0 is not a power of 2

2015-05-19 Thread w0rp via Digitalmars-d
On Tuesday, 19 May 2015 at 12:00:30 UTC, Almighty Bob wrote: On Tuesday, 19 May 2015 at 10:59:53 UTC, w0rp wrote: I believe you can also do x -x == x. I think that still returns true for x = 0. You are right. Disregard that.

Re: [dlang website] Up Arrow in library

2015-05-18 Thread w0rp via Digitalmars-d
Back to top links are dumb. Navigating to the top of the page is something the client browser should handle. In Firefox, I use a plugin with a mouse gesture myself, so holding right click and moving my mouse up takes me back to the top of the page. Either that, or I press my home or end keys.

Re: Let's improve D's exceptions

2015-05-14 Thread w0rp via Digitalmars-d
I wonder if enforce should throw an Error instead, if it exists at all. Because it's designed to throw an exception you shouldn't catch. If you are going to have it throw an Exception subclass, then it should take the exception type, like enforce!WhateverException(...), or something.

Re: dmd -profile=gc

2015-05-04 Thread w0rp via Digitalmars-d
On Sunday, 3 May 2015 at 21:11:58 UTC, Walter Bright wrote: Just merged in is a new compiler switch that instruments generated code to collect statistics on memory allocation usage and generates a report upon program termination. (Much like how -profile works.) This was based on a prototype

Re: std.xml2 (collecting features)

2015-05-03 Thread w0rp via Digitalmars-d
On Sunday, 3 May 2015 at 17:47:15 UTC, Joakim wrote: On Sunday, 3 May 2015 at 17:39:48 UTC, Robert burner Schadek wrote: std.xml has been considered not up to specs nearly 3 years now. Time to build a successor. I currently plan the following featues for it: - SAX and DOM parser - in-situ /

Re: GTA5 mods in D?

2015-05-02 Thread w0rp via Digitalmars-d
On Saturday, 2 May 2015 at 18:51:53 UTC, Israel wrote: I know you guys are programmers and not gamers but it thought maybe you want to experiment or help expand D? Currently there is a Script hook program that allows users to create mods/scripts for GTA5.

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-28 Thread w0rp via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote: After reading the following thread: http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org I wondered if it was possible to write a classic fizzbuzz[1] example using a UFCS chain? I've tried and failed. [1]:

Re: ReQL: pluses and minuses of pipeline-style queries

2015-04-25 Thread w0rp via Digitalmars-d
On Saturday, 25 April 2015 at 05:16:21 UTC, Andrei Alexandrescu wrote: Found this on reddit a few days ago: http://rob.conery.io/2015/04/17/rethinkdb-2-0-is-amazing/ A good discussion of the pros and cons of pipeline-style queries (the ReQL query language reminiscent of D's

Re: if(arr) now a warning

2015-04-23 Thread w0rp via Digitalmars-d
On Wednesday, 22 April 2015 at 10:36:04 UTC, Jonathan M Davis wrote: D arrays were designed in a way that they avoid segfaults; otherwise an empty array and a null array would not be considered equal, and doing stuff like trying to append to a null array would segfault. You have to work at it

Re: WTF: dmd 2.066 vs. dmd 2.067 really dangerous code breakage

2015-04-22 Thread w0rp via Digitalmars-d
You really should pay attention to the deprecation messages. immutable was unfortunately used as if it was a manifest constant before, but it ought to be a member of a struct, and that behaviour is changing. There's been a deprecation message there for a while, now the behaviour is changing,

Re: I have made a discovery

2015-04-19 Thread w0rp via Digitalmars-d
The interesting thing about this is that 'throw new ExceptionType(...)' could be reference counted. The downside of not getting rid of the 'new' overloading at some point is that it can make the operator do surprising and unexpected things, so the rationale for getting rid of it is similar to

Re: I have made a discovery

2015-04-18 Thread w0rp via Digitalmars-d
I *think* my PR might have also led me to discovering some kind of DMD bug to do with not being able to call a @nogc super class constructor from a constructor which isn't @nogc. It could be something else entirely, but it caused some undefined reference bugs to appear, which is odd.

Re: I have made a discovery

2015-04-18 Thread w0rp via Digitalmars-d
On Saturday, 18 April 2015 at 15:39:05 UTC, w0rp wrote: I *think* my PR might have also led me to discovering some kind of DMD bug to do with not being able to call a @nogc super class constructor from a constructor which isn't @nogc. It could be something else entirely, but it caused some

I have made a discovery

2015-04-18 Thread w0rp via Digitalmars-d
The following code almost compiles. import core.stdc.stdlib; class Foo : Exception { @nogc pure nothrow @safe this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) { super(msg, file, line, next); } @nogc new(size_t size)

Re: groupBy/chunkBy redux

2015-04-18 Thread w0rp via Digitalmars-d
I wonder what it's going to look like to see byChunk and chunkBy next to each other.

Re: nginx module bindings

2015-04-18 Thread w0rp via Digitalmars-d
On Saturday, 18 April 2015 at 02:03:40 UTC, Shammah Chancellor wrote: Hello DForum! I wanted to attempt to write an nginx module in Dlang. However, the first step of generating some bindings is proving to be a pain on linux. Htod is windows only, and the other projects either generate

Re: T.zero and T.one for numeric types

2015-04-17 Thread w0rp via Digitalmars-d
On Friday, 17 April 2015 at 13:27:19 UTC, Biotronic wrote: I've been writing a lot of generic code lately that has to deal with various kinds of numbers, and have near been driven nuts by the fact there is no uniform way to get a zero or one. Consider: void foo(T)(T a) {} foo!T(0);

Re: Wanted: Review manager for std.data.json

2015-04-16 Thread w0rp via Digitalmars-d
On Wednesday, 8 April 2015 at 18:56:00 UTC, Iain Buclaw wrote: Frankly, if we are not as fast (or elegant) as Python's json library, it should be thrown out back to the drawing board. Iain. I'll leave the speed aside, as more recent posts show improvements and I think Sönke will be able

Re: Wanted: Review manager for std.data.json

2015-04-16 Thread w0rp via Digitalmars-d
On Thursday, 16 April 2015 at 12:17:55 UTC, Sönke Ludwig wrote: Am 16.04.2015 um 13:03 schrieb Jacob Carlborg: On 2015-04-16 11:29, Sönke Ludwig wrote: I'd like to let that be part of a more general serialization framework in top of this package instead of integrating a simplistic custom

Re: D AutoCompletion: is ycmd integration valuable?

2015-04-16 Thread w0rp via Digitalmars-d
On Thursday, 16 April 2015 at 11:46:09 UTC, Idan Arye wrote: Some people - myself included - have already asked Brian to make DCD read the project's import paths from Dub or something. At first he claimed this is the editor's job - now he seems to be accepting the idea enough to accept a pull

Re: D AutoCompletion: is ycmd integration valuable?

2015-04-16 Thread w0rp via Digitalmars-d
On Thursday, 16 April 2015 at 14:30:04 UTC, Idan Arye wrote: On Thursday, 16 April 2015 at 12:01:48 UTC, w0rp wrote: On Thursday, 16 April 2015 at 11:46:09 UTC, Idan Arye wrote: Some people - myself included - have already asked Brian to make DCD read the project's import paths from Dub or

Re: Detect the bug in the following code

2015-04-15 Thread w0rp via Digitalmars-d
On Wednesday, 15 April 2015 at 15:17:32 UTC, Steven Schveighoffer wrote: On 4/15/15 10:44 AM, Idan Arye wrote: import std.stdio; struct Foo { bool registered = false; void register(int x) { writeln(Registering , x); register = true; } } void main() { Foo foo;

Re: Mitigating the attribute proliferation - attribute inference for functions

2015-04-13 Thread w0rp via Digitalmars-d
On Monday, 13 April 2015 at 12:13:26 UTC, Kagamin wrote: On Saturday, 11 April 2015 at 21:47:20 UTC, Martin Nowak wrote: 1) If that function has source code available, it gets semantically analyzed and additional attributes are inferred. 2) The compiler errors because of missing attributes.

djinni and D

2015-04-12 Thread w0rp via Digitalmars-d
I was just watching this talk, and it is really interesting. https://www.youtube.com/watch?v=ZcBtF-JWJhM They are working with a C++ codebase they are sharing between different mobile platforms by mapping it to the languages specific to each platform. They explain in the talk, and as someone

Re: Which D IDE do you use?(survey)

2015-04-12 Thread w0rp via Digitalmars-d
On Sunday, 12 April 2015 at 19:41:10 UTC, Atila Neves wrote: On Friday, 10 April 2015 at 17:59:45 UTC, Ali Çehreli wrote: On 04/10/2015 01:28 AM, Szymon Gatner wrote: A lot must have changed since I used Vim few years ago then. I hope this is not taken as an attack on Vim users but from my

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread w0rp via Digitalmars-d
I was thinking about this again, and how the first 'ref' would create a copy in order to keep the object around. At first I thought I didn't like that, but then I realised that it's actually not far from what I wanted for taking r-values by reference. I commonly write functions which take

Re: __attribute__((used)) and druntime

2015-04-11 Thread w0rp via Digitalmars-d
On Saturday, 11 April 2015 at 15:59:53 UTC, David Nadlinger wrote: On Saturday, 11 April 2015 at 15:35:47 UTC, w0rp wrote: […] (Also LDC?) in druntime and flag all of the symbols like this appropriately, so that creating executables with gc-sections will Just Work in some cases without a

__attribute__((used)) and druntime

2015-04-11 Thread w0rp via Digitalmars-d
I've been looking into compiling smaller executables, and the trick I learned from watching sessions from the last DConf is to use the KEEP symbol in a linker script with something like gc-sections. So at the compilation stage, symbols are put in different sections, a linker script marks some

Re: STL and Phobos

2015-04-11 Thread w0rp via Digitalmars-d
On Saturday, 11 April 2015 at 17:01:42 UTC, Dennis Ritchie wrote: Will the STL included in Phobos or is it impossible? STL won't be included in Phobos, at least as far as I know, but I believe it should be possible to interface to parts of it with extern(C++). To do it, you need to create

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread w0rp via Digitalmars-d
On Saturday, 11 April 2015 at 09:28:46 UTC, Marc Schütz wrote: On Friday, 10 April 2015 at 23:12:55 UTC, deadalnix wrote: On Friday, 10 April 2015 at 10:02:01 UTC, Martin Nowak wrote: On Wednesday, 8 April 2015 at 23:11:08 UTC, Walter Bright wrote: http://wiki.dlang.org/DIP77 So someone

Re: if(arr) now a warning

2015-04-11 Thread w0rp via Digitalmars-d
On Friday, 10 April 2015 at 18:32:39 UTC, Andrei Alexandrescu wrote: On 4/10/15 10:28 AM, Steven Schveighoffer wrote: On 4/10/15 11:57 AM, Andrei Alexandrescu wrote: On 4/10/15 6:26 AM, Meta wrote: On Friday, 10 April 2015 at 12:42:47 UTC, Steven Schveighoffer wrote: Plus, adding arr.empty

Re: Mitigating the attribute proliferation - attribute inference for functions

2015-04-11 Thread w0rp via Digitalmars-d
Shouldn't the inference with analysis be possible when you have the source available at least? You will still have to specify the attributes in a .di file if you are statically or dynamically linking to D libraries, but for source libraries or in parts of your project, you should be able to

Re: Which D IDE do you use?(survey)

2015-04-11 Thread w0rp via Digitalmars-d
On Saturday, 11 April 2015 at 10:27:15 UTC, weaselcat wrote: if you're using vim-dutyl you could just remap K to :DUjump or one of the split variants. (DUddoc also shows the documentation of the symbol under your cursor.) I'll have to try this myself. Vim has a feature for balloon messages,

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-09 Thread w0rp via Digitalmars-d
On Thursday, 9 April 2015 at 18:44:10 UTC, Walter Bright wrote: The only real purpose to a postblit is to support ref counting. Why would a by-value container use a postblit and not ref count? A struct could have a postblit defined if you are implementing something like std::vector, where you

  1   2   3   4   >