Re: between and among: worth Phobosization? (reprise)

2015-03-26 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 26 March 2015 at 22:30:54 UTC, H. S. Teoh wrote: As for combinations of and =, what about taking multiple template arguments? E.g.: if (isOrdered!(, =)(0, x, 10)) { ... } In that case, wouldn't it be more readable to just do: if (0 x = 10) { ... } ?

Re: Updating ddoc to support modern HTML tags

2015-04-21 Thread Jakob Ovrum via Digitalmars-d
On Monday, 20 April 2015 at 19:42:43 UTC, Gary Willoughby wrote: I've just done a little bit of work on the ddoc documentation and it was brought to my attention that the HTML output of ddoc is actually quite old. Some of the current tags are deprecated. I've raised this as an issue here:

Re: [OT] C# 6.0 ?. null propagation operator

2015-04-20 Thread Jakob Ovrum via Digitalmars-d
On Monday, 20 April 2015 at 08:24:08 UTC, weaselcat wrote: http://www.reddit.com/r/programming/comments/335b1s/the_new_operator_in_c_6/ of interesting note was the nim sample on how to implement the same thing in nim in 2 lines of code template `?.`(a, b): expr = if a != nil: a.b else: nil

Re: Updating ddoc to support modern HTML tags

2015-04-21 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 21 April 2015 at 07:34:19 UTC, Walter Bright wrote: On 4/20/2015 11:39 PM, Jakob Ovrum wrote: It's still a long road before we even output correct HTML, ?? Have you ever tried validating the HTML output for dlang.org? It's a mess, see this PR for some details[1]. [1]

Re: Literan/constant ranges

2015-04-25 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 26 April 2015 at 04:59:48 UTC, Manu wrote: I find myself using these a lot. I hacked them together because I couldn't find anything equally simple in the std library: https://gist.github.com/TurkeyMan/1f551bc5a0d2cec8af2e The question is, is there already a proper/better way to do

Re: [hackathon] Make love not war

2015-04-25 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 26 April 2015 at 04:04:55 UTC, Jakob Ovrum wrote: I'll do some work on the `Needs review` tag. Made a pass over all unlabelled PRs: https://github.com/D-Programming-Language/phobos/labels/needs%20review There's been a bit of a dearth of reviewers in the last couple of weeks. All

Re: [hackathon] Make love not war

2015-04-25 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 26 April 2015 at 03:47:07 UTC, Andrei Alexandrescu wrote: I compel all of us fine folks in this forum to abstain from unproductive debates and discussions during this hackathon week. No exegesis, no contemplation of what things could or should be, no idle thinking. This is the time

Re: Updating ddoc to support modern HTML tags

2015-04-21 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 21 April 2015 at 23:48:04 UTC, Walter Bright wrote: 1. none of these are problems with Ddoc No, but there's still a problem with dlang.org, the biggest user of DDoc. 2. they just look like a few typos to me No, the main issue is nesting lists in paragraphs and other illegal

Re: testing only one package in std

2015-04-28 Thread Jakob Ovrum via Digitalmars-d
On Wednesday, 29 April 2015 at 02:43:54 UTC, Andrei Alexandrescu wrote: Thought it'd be a lot harder! https://github.com/D-Programming-Language/phobos/pull/3242. Pliz pliz review kthxbye. Andrei Too bad it's POSIX only :(

Re: array operations and ranges

2015-04-26 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 26 April 2015 at 18:48:15 UTC, Vlad Levenfeld wrote: I've got a lib to enable this syntax: Array!float a = b[].transform_1; a[i..j] = c[x..y].transform_2; Phobos containers already support the first line, and it would be a natural extension to make them support the second.

Re: Wiki page: Coming From C++

2015-04-27 Thread Jakob Ovrum via Digitalmars-d
I moved it out of draft status since I think it's respectable enough as it is[1], but improvements and additions should still be made. However, the Coming From pages seem to have been renamed D for X programmers. I don't think this article fits that moniker. From where should we link this

Re: The most awesome forward to member solution?

2015-05-03 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 3 May 2015 at 07:55:30 UTC, tcak wrote: On Sunday, 3 May 2015 at 00:25:13 UTC, Dicebot wrote: Sounds similar to http://dlang.org/phobos/std_typecons.html#.Proxy Great documentation by the way. I understood what it does with one read: Make proxy for a.

Re: std.allocator: nomenclature needed

2015-05-16 Thread Jakob Ovrum via Digitalmars-d
On Friday, 15 May 2015 at 07:03:12 UTC, ponce wrote: std.allocator.prefab I like this. If we consider the purpose of the module to provide vetted, generally useful allocator compositions, then I think this kind of name makes sense. A very different name might be possible but it probably

Re: A few thoughts on std.allocator

2015-05-13 Thread Jakob Ovrum via Digitalmars-d
On Wednesday, 13 May 2015 at 17:49:38 UTC, Steven Schveighoffer wrote: OK, then consider that this: void main() { string x; x ~= hello; x ~= world; } would require locking. That's unacceptable. Nobody would append with strings if this all required locking for no reason. The runtime

Re: A few thoughts on std.allocator

2015-05-13 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 12 May 2015 at 17:21:04 UTC, Steven Schveighoffer wrote: The one that always comes to my mind is array appending: immutable int[] x = new int[5]; const int[] y = x; Do you mean: immutable(int)[] x = new int[5]; const(int)[] y = x; ? Because you can't append to or reassign an

Re: SDC needs you

2015-04-16 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 16 April 2015 at 06:02:19 UTC, Andrei Alexandrescu wrote: 1. Challenging Walter on anything and everything seems to have become a rite of passage in our community. Some of the reviews of his code are the most petty and meaningless I've seen in my career, bar none. It doesn't help

Re: SDC needs you

2015-04-16 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 16 April 2015 at 04:05:19 UTC, Andrei Alexandrescu wrote: Forgive my being skeptical but my repeated appeals to contributions - most of them important, urgent, and of high impact - sometimes labeled with [WORK] in this forum, have been answered by the same very small kernel of

Re: Wiki page: Coming From C++

2015-04-11 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 11 April 2015 at 16:02:53 UTC, David Nadlinger wrote: On Saturday, 11 April 2015 at 10:24:53 UTC, Jakob Ovrum wrote: http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article *Un*signed integer overflow isn't undefined in C/C++ either. — David I removed the section on

Re: Wiki page: Coming From C++

2015-04-11 Thread Jakob Ovrum via Digitalmars-d
Thanks for the feedback, I think I've incorporated all the suggested changes. Also added a section on how D deals with object slicing. 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

Wiki page: Coming From C++

2015-04-11 Thread Jakob Ovrum via Digitalmars-d
I've done some preliminary work on a wiki page that attempts to convince C++ programmers who are on the fence about D, who need to know what D provides over C++11 and C++14. http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article I don't know if a Coming_From page is the right place for

Re: Today's programming challenge - How's your Range-Fu ?

2015-04-18 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 18 April 2015 at 12:48:53 UTC, Jacob Carlborg wrote: On 2015-04-18 14:25, Gary Willoughby wrote: byGrapheme to the rescue: http://dlang.org/phobos/std_uni.html#byGrapheme Or is this unsuitable here? How is byGrapheme supposed to be used? I tried this put it doesn't do what I

Re: Making regex replace CTFE by removing malloc

2015-04-03 Thread Jakob Ovrum via Digitalmars-d
On Friday, 3 April 2015 at 03:58:33 UTC, ketmar wrote: p.s. i don't think that this is the only problem, though. but i never read std.regexp source. it's bad, 'cause i want to make it work with any range, not only with strings. this will allow to run regexp on anything -- and open way to my

Re: how use * in D just like C++

2015-10-27 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 27 October 2015 at 05:36:58 UTC, liumao wrote: for example class A; { void doSomething() {} } A *a = cast(A *) new A; then I call a.doSomething(); my program "Segmentation fault" how could it happened? and how i use it correctly? 3q, please tell me,

Re: Make all new symbols go through std.experimental?

2015-10-27 Thread Jakob Ovrum via Digitalmars-d
On Wednesday, 28 October 2015 at 00:28:51 UTC, Andrei Alexandrescu wrote: I was looking at https://github.com/D-Programming-Language/phobos/pull/3765 and whilst it's a sensible addition, I'm thinking we'd want to pass it and all other library additions through std.experimental first. So we'd

Re: Persistent list

2015-11-13 Thread Jakob Ovrum via Digitalmars-d
On Friday, 13 November 2015 at 23:10:04 UTC, Andrei Alexandrescu wrote: * Lines 11-12: I came to terms with the notion that some types cannot be made immutable. We've been trying to do reference counting on immutable objects for a long time. It's time to acknowledge that true immutability

Re: opDispatch and compile time parameters

2015-11-13 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 14 November 2015 at 04:10:59 UTC, Steven Schveighoffer wrote: Is it me, or is this a bug? struct Foo { template opDispatch(string s) { // if you uncomment this, it compiles //void opDispatch() {} void opDispatch(T...)() {} } } void main() { Foo f;

Re: Persistent list

2015-11-14 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 14 November 2015 at 16:05:10 UTC, Andrei Alexandrescu wrote: Technically, that clearly works. There's a problem with scaling it up: COMPOSITION Disallowing immutable(RC!T) in favor of RC!(immutable T) effectively disables composition of larger immutable objects from smaller

Re: Here's looking at you, kid

2015-11-14 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 14 November 2015 at 13:46:32 UTC, Russel Winder wrote: On Sat, 2015-11-14 at 10:47 +1000, Manu via Digitalmars-d wrote: […] I'd love to read a revised edition of that page! :) So write it, and do the pull request. It doesn't matter if it is any good or not, what matters is

Proof of concept/proposal: reference counted closures/delegates

2015-11-10 Thread Jakob Ovrum via Digitalmars-d
I wrote a proof of concept that explores how we could support fully featured reference counted closures: https://gist.github.com/JakobOvrum/69e64d82bcfed4c114a5 The proof_of_concept code path is just to show that the `scope` trick works. The with_new_trait code path proposes a new trait

Re: Chrome OS folding into Android, Android coming to laptops

2015-11-03 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 3 November 2015 at 09:06:57 UTC, Joakim wrote: Android and iOS are gunning for laptops next, with their recently announced Pixel C and iPad Pro, I'm sure desktops will soon follow. When those two platforms went after Windows Mobile/Phone, they burned it to the ground:

Re: should fixedpoint be in phobos? project registry ?

2015-11-04 Thread Jakob Ovrum via Digitalmars-d
On Wednesday, 4 November 2015 at 12:30:24 UTC, Laeeth Isharc wrote: More generally, does it make sense to have a suggested project registry for those who would like to contribute to Phobos and have the skill to do so but aren't sure what to work on ? Projects could be added after discussion

Re: Tuple expansion already?

2015-11-17 Thread Jakob Ovrum via Digitalmars-d
On Wednesday, 18 November 2015 at 02:19:34 UTC, Ali Çehreli wrote: For once, let's take something from C++. ;) Structured bindings are accepted for C++: https://isocpp.org/blog/2015 Assuming that f() returns a tuple, auto {x,y,z} = f(); will be the same as auto t = f(); auto x =

Re: Our template emission strategy is broken

2015-11-12 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 12 November 2015 at 23:06:01 UTC, rsw0x wrote: On Thursday, 12 November 2015 at 22:50:08 UTC, Walter Bright wrote: On 11/11/2015 9:19 AM, David Nadlinger wrote: Of course, many of the problems could have probably been avoided if there was an iron-clad rule that the module

Re: Complexity nomenclature

2015-12-04 Thread Jakob Ovrum via Digitalmars-d
On Friday, 4 December 2015 at 06:05:55 UTC, Tofu Ninja wrote: When would a generic algorithm even need to know the complexity of the container? A generic algorithm that uses exponential time when given the "wrong" inputs is a hidden danger. This can easily happen when composing with linear

Re: Complexity nomenclature

2015-12-04 Thread Jakob Ovrum via Digitalmars-d
On Friday, 4 December 2015 at 09:51:05 UTC, tn wrote: "I just want to insert an element. I don't care how long it takes. Why do I need to specify that it should be linear?" In my opinion, there should be "constantInsert", "linearInsert", etc. for those who care about the complexity, and

Re: And here's another interesting algorithm/structure: Randomized Slide to Front

2015-12-08 Thread Jakob Ovrum via Digitalmars-d
On Monday, 30 November 2015 at 21:33:31 UTC, Andrei Alexandrescu wrote: Now that we got talking about searching in arrays, allow me to also share an idea I've had a short while ago. I wrote a range-based implementation to see how it would look like.

Re: Another cool mini-project: advance a range within n steps from its end

2015-12-05 Thread Jakob Ovrum via Digitalmars-d
On Friday, 4 December 2015 at 16:37:36 UTC, Andrei Alexandrescu wrote: Takers? https://github.com/D-Programming-Language/phobos/pull/3855

Re: Thoughts on a Future Garbage Collector

2015-12-03 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 3 December 2015 at 19:03:35 UTC, Nerve wrote: I wonder what Walter and Andrei think of potentially overhauling those elements in D. Right now all of the manual memory management is basically ripped from C and C++ with no changes, and no insights into how to improve such a system.

Re: __traits(getAttributes, ...) gets attributes for the first overload only

2015-12-07 Thread Jakob Ovrum via Digitalmars-d
On Monday, 7 December 2015 at 23:52:38 UTC, NX wrote: On Sunday, 6 December 2015 at 02:00:30 UTC, Andrei Alexandrescu wrote: Yah, error is the way to go. -- Andrei Can I ask a question?: Why we don't have a way to get an exact overload of function? Something like: void foo(int i); int

Re: Thoughts on a Future Garbage Collector

2015-12-03 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 3 December 2015 at 18:36:22 UTC, Jakob Jenkov wrote: - Hint to the memory system where to allocate an object, meaning hinting if it is - shortlived (like within a function), transaction scope (max 60 s life time), - permanent singleton etc. Often you already know at

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 15 December 2015 at 03:47:30 UTC, Andrei Alexandrescu wrote: We use this pattern in only a couple of places in Phobos, but I think we should generally improve the language to use less, not more, of it. BTW I think all overloads of a given function should be under the same DDOC

Re: Catching C++ Exceptions in D

2016-01-05 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 5 January 2016 at 18:22:56 UTC, Jakob Ovrum wrote: On Tuesday, 5 January 2016 at 17:23:38 UTC, Walter Bright wrote: D code can only catch C++ exceptions declared as: extern (C++) class Identifier { ... } Best practice in C++ is catching by const&, and D's classes fit right in

Re: Catching C++ Exceptions in D

2016-01-05 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 5 January 2016 at 17:23:38 UTC, Walter Bright wrote: We have a design now, driven by: 1. compatibility with best practice exceptions in C++ (i.e. never catch by value, etc.) 2. minimizing implementation difficulty 3. fitting in with D semantics 4. pushing as much as we can into

Re: Catching C++ Exceptions in D

2016-01-05 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 5 January 2016 at 17:23:38 UTC, Walter Bright wrote: At the exit of a catch clause, the destructor on the caught C++ exception will be run, as would be expected by C++ programmers. Does this work with rethrow? What if a D exception is thrown from a C++ catch block - will the C++

Re: Catching C++ Exceptions in D

2016-01-05 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 5 January 2016 at 21:30:21 UTC, Jakob Ovrum wrote: On Tuesday, 5 January 2016 at 17:23:38 UTC, Walter Bright wrote: At the exit of a catch clause, the destructor on the caught C++ exception will be run, as would be expected by C++ programmers. Does this work with rethrow? What if

Re: Circular dependencies in Phobos

2016-01-03 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 3 January 2016 at 18:41:39 UTC, tsbockman wrote: Anyway, my submodule setup is motivated as much by the desire not to be forced to make long lists of every symbol I import, Why are you forced to do that?

Re: Circular dependencies in Phobos

2016-01-03 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 3 January 2016 at 16:55:50 UTC, tsbockman wrote: That would be more helpful if selective imports weren't semi-banned at the top level: https://github.com/D-Programming-Language/dmd/pull/3407 Hopefully that will finally get merged before checkedint is ready... It's only a

Re: Circular dependencies in Phobos

2016-01-03 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 3 January 2016 at 15:46:55 UTC, tsbockman wrote: How important is it to avoid circular dependencies in Phobos? I'm wondering because I have divided my work-in-progress std.checkedint module into various submodules to make it easier for people to import only the part they actually

Re: Circular dependencies in Phobos

2016-01-03 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 3 January 2016 at 17:13:34 UTC, tsbockman wrote: On Sunday, 3 January 2016 at 17:09:45 UTC, Jakob Ovrum wrote: On Sunday, 3 January 2016 at 16:55:50 UTC, tsbockman wrote: That would be more helpful if selective imports weren't semi-banned at the top level:

Re: Circular dependencies in Phobos

2016-01-03 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 3 January 2016 at 17:31:41 UTC, Jakob Ovrum wrote: On Sunday, 3 January 2016 at 17:25:40 UTC, tsbockman wrote: On Sunday, 3 January 2016 at 17:18:05 UTC, Jakob Ovrum wrote: Yes, but it shouldn't be designed around a bug. Unless the bug is actually going to be fixed some time soon,

Re: Circular dependencies in Phobos

2016-01-03 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 3 January 2016 at 17:25:40 UTC, tsbockman wrote: On Sunday, 3 January 2016 at 17:18:05 UTC, Jakob Ovrum wrote: Yes, but it shouldn't be designed around a bug. Unless the bug is actually going to be fixed some time soon, why would I deliberately design something in a way that is

Re: Some feedback on the website.

2015-12-18 Thread Jakob Ovrum via Digitalmars-d
On Friday, 18 December 2015 at 07:37:40 UTC, Jacob Carlborg wrote: On 2015-12-18 00:50, Andrei Alexandrescu wrote: * Many functions don't have "Parameters:", "Returns:", or "Throws:" sections. Those that respectively take parameters, return non-void, or throw, should have one each. I think

Re: I hate new DUB config format

2015-11-25 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 26 November 2015 at 05:25:46 UTC, Andrei Alexandrescu wrote: This would be a lot more sensible if dub were not the official package and build manager. The way I look at it, it's a manifestation of a systemic problem: I can't work on dub and I can't monitor decisions regarding it.

Re: Collections question

2015-11-27 Thread Jakob Ovrum via Digitalmars-d
On Friday, 27 November 2015 at 20:25:12 UTC, Adam D. Ruppe wrote: That syntax is the same as constructors... if that's what you want it to look like, we ought to actually use a constructor for all but the zero-argument ones which I'd use a static named function for (perhaps .make or perhaps

Re: Collections question

2015-11-27 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 28 November 2015 at 06:59:35 UTC, bitwise wrote: Classes/real-ref-types dont act as you're describing They do, actually. class Collection(E) { ... } Collection!E a; // null reference auto b = new Collection!E(); // reference to empty collection The only outlier is the

Re: Collections question

2015-11-27 Thread Jakob Ovrum via Digitalmars-d
On Friday, 27 November 2015 at 20:14:21 UTC, Andrei Alexandrescu wrote: There's some experience in various libraries with both approaches. Which would you prefer? Well, I think we should recognize that they're the same thing but with different names. I don't have a strong preference for

Re: Collections question

2015-11-27 Thread Jakob Ovrum via Digitalmars-d
On Friday, 27 November 2015 at 20:14:21 UTC, Andrei Alexandrescu wrote: There's some experience in various libraries with both approaches. Which would you prefer? Another thing: wouldn't providing a custom allocator require a separate primitive? I am assuming that the allocator type won't be

Re: Collections question

2015-11-28 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 28 November 2015 at 13:41:10 UTC, Andrei Alexandrescu wrote: On 11/28/15 2:26 AM, Jakob Ovrum wrote: Another thing: wouldn't providing a custom allocator require a separate primitive? All collections will work with IAllocator. -- Andrei Yes, I assumed as much. So how would

Re: Raspberry PI zero

2015-11-26 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 26 November 2015 at 10:47:39 UTC, Andrea Fontana wrote: Can gdc or ldc compile for this platform: https://www.raspberrypi.org/blog/raspberry-pi-zero/ ? It's Linux/ARM, so yes, both GDC and LDC can target it.

Re: Here's looking at you, kid

2015-11-19 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 15 November 2015 at 06:25:31 UTC, Jakob Ovrum wrote: The reason people are posting instead of editing is because nobody friggin knows how the new stuff works except Daniel Murphy. At least that's what I thought until Walter posted the dconf talk which ostensibly explains it; I

Re: Add "setBinaryMode" and "setTextMode" to stdio?

2016-01-12 Thread Jakob Ovrum via Digitalmars-d
On Wednesday, 13 January 2016 at 00:13:13 UTC, Johan Engelen wrote: Should I work on a PR for setBinaryMode+setTextMode ? std.stdio is intended as a wrapper around stdio.h, which I don't think supports setting the mode post-fopen, but if we can support those operations for all practical

Re: Localization (i18n) Options

2016-01-16 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 17 January 2016 at 02:51:30 UTC, Gerald wrote: I have a GtkD application for Linux where I would like to support localization. The current options in D seem pretty limited with the most recent being i18n-d (https://github.com/JakobOvrum/i18n-d). My code is structured for GNU

Re: An IO Streams Library

2016-02-07 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 7 February 2016 at 00:48:54 UTC, Jason White wrote: I'm interested in feedback on this library. What is it missing? How can be better? I like what I've seen so far, but I'd just like to note that it's easier to give feedback on the API when there is web documentation. GitHub Pages

Re: An IO Streams Library

2016-02-08 Thread Jakob Ovrum via Digitalmars-d
On Monday, 8 February 2016 at 09:08:53 UTC, Dejan Lekic wrote: I think this is a huge task and requires a (huge) DIP, and collaborative effort of coming up with a good, really good, API for BOTH synchronous and asynchronous IO. As mentioned in the previous messages, there is already an asyncio

Re: reduce -> fold?

2016-02-10 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 30 January 2016 at 18:08:00 UTC, David Nadlinger wrote: Currying is turning (A, B, C) -> D into A -> (B -> (C -> D)), i.e. a function with multiple arguments into a sequence of functions that each take a single argument to apply each. I think I've implemented something like that

Re: Attributes on static constructors

2016-02-06 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 7 February 2016 at 06:15:29 UTC, Brian Schott wrote: std.socket has a line that looks like this: shared static this() @system http://dlang.org/spec/grammar.html#StaticConstructor states that function attributes are only valid on "static" and "shared static". Compiler bug or spec

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

2016-02-09 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 9 February 2016 at 14:38:23 UTC, Andrei Alexandrescu wrote: On 02/09/2016 07:46 AM, Jakob Ovrum wrote: void main() { import std.stdio : stdout; int a = 42; string b = "foo"; float c = 3.14; dump!(a, b, c)(); // a = 42, b = foo, c = 3.14

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

2016-02-09 Thread Jakob Ovrum via Digitalmars-d
On Monday, 8 February 2016 at 13:37:19 UTC, Andrei Alexandrescu wrote: On 2/7/16 7:11 PM, John Colvin wrote: alias dump = dumpTo!stdout; alias errDump = dumpTo!stderr; I'm hoping for something with a simpler syntax, a la dump!(stdout, "x") where stdout is optional. -- Andrei This works:

Re: GCAllocator goodAllocSize?

2016-02-01 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 31 January 2016 at 18:52:48 UTC, Steven Schveighoffer wrote: 2. How does one allocate with an allocator for typed info? In other words, the GC will call the dtor, but only if it knows what type you put in there. With std.experimental.allocator, there isn't a way to do that.

Re: GCAllocator goodAllocSize?

2016-02-01 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 2 February 2016 at 05:04:00 UTC, Jakob Ovrum wrote: On Sunday, 31 January 2016 at 18:52:48 UTC, Steven Schveighoffer wrote: 2. How does one allocate with an allocator for typed info? In other words, the GC will call the dtor, but only if it knows what type you put in there. With

Re: A lazy-chain for std.range?

2016-02-26 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 27 February 2016 at 04:31:03 UTC, Mint wrote: So, I noticed that one way I frequently use the chain function defined std.range is as sort of an else-clause. ie. return elements .map!( . . . ) .filter!( . . . ) .chain(fallback.only) .front; After

Re: Head Const

2016-02-17 Thread Jakob Ovrum via Digitalmars-d
On Monday, 15 February 2016 at 22:48:16 UTC, Walter Bright wrote: rears its head again :-) Head Const is what C++ has for const, i.e. it is not transitive, applies to one level only. D has transitive const. What head const will do for us: 1. make it easy to interface to C++ code that uses

Re: Head Const

2016-02-18 Thread Jakob Ovrum via Digitalmars-d
On Wednesday, 17 February 2016 at 22:01:45 UTC, Walter Bright wrote: On 2/17/2016 4:03 AM, Jakob Ovrum wrote: How about disallowing immutable data with extern(C++) types? With extern(C++) data always mutable, `const` could safely be reused to mean C++ const in bindings. Any `mutable`-style

dlang.org makefile pains

2016-03-15 Thread Jakob Ovrum via Digitalmars-d
I used to contribute to dlang.org now and then before the makefile revamp. Now every time I try, I end up fighting with the makefile. make -f posix.mak apidocs-serve LATEST=2.070.2 <-- place in the command line to skip network traffic *starts downloading crap from downloads.dlang.org that I

"default" keyword as function attribute

2016-03-19 Thread Jakob Ovrum via Digitalmars-d
We often repeat advice to put `@safe:`, or some other function attribute, at the top of your modules to apply the attribute en masse. In practice this quickly becomes infeasible. Sooner or later, a generic function is introduced to idiomatic D modules, and many of them, perhaps most of them,

Re: "default" keyword as function attribute

2016-03-19 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 19 March 2016 at 14:55:00 UTC, Jakob Ovrum wrote: Maybe there is a better way, or maybe we should move forward with it. Maybe an alternative would be to simply ignore explicit attributes on templated functions, or at least ignore attributes on them applied with `attr:` or `attr

Re: dlang.org makefile pains

2016-03-22 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 15 March 2016 at 11:15:12 UTC, Jakob Ovrum wrote: All I want to do is test DDox with local dlang.org changes and local Phobos changes. Bump. Please help. If Martin is the only one who understands the makefile then we have a serious problem.

Re: State of interfacing with c++

2016-03-20 Thread Jakob Ovrum via Digitalmars-d
On Friday, 18 March 2016 at 13:45:18 UTC, Jonas Drewsen wrote: Any pointers to reasonably up-to-date info about interfacing with c++ is much appreciated as well. The language documentation is up to date except for the section on exceptions: http://dlang.org/spec/cpp_interface.html I'd

Re: "default" keyword as function attribute

2016-03-19 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 19 March 2016 at 18:15:54 UTC, jmh530 wrote: On Saturday, 19 March 2016 at 15:09:00 UTC, Jakob Ovrum wrote: Maybe an alternative would be to simply ignore explicit attributes on templated functions That seems like a risky proposition. What if you mark some templates nogc to

Re: dlang.org makefile pains

2016-03-26 Thread Jakob Ovrum via Digitalmars-d
Thanks all for the responses. On Thursday, 24 March 2016 at 19:26:54 UTC, Andrei Alexandrescu wrote: On 03/22/2016 07:23 PM, Jakob Ovrum wrote: On Tuesday, 15 March 2016 at 11:15:12 UTC, Jakob Ovrum wrote: All I want to do is test DDox with local dlang.org changes and local Phobos changes.

Re: dlang.org makefile pains

2016-03-27 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 15 March 2016 at 11:15:12 UTC, Jakob Ovrum wrote: All I want to do is test DDox with local dlang.org changes and local Phobos changes. Now I'm hitting an old issue again - whether using the default make target or apidocs-serve, DDox doesn't seem to generate updated docs when I

Re: [Request] A way to extract all instance of X from a range

2016-04-01 Thread Jakob Ovrum via Digitalmars-d
On Monday, 21 March 2016 at 11:34:15 UTC, Nick Treleaven wrote: There is a pull for Option: https://github.com/D-Programming-Language/phobos/pull/3915 We could have: // fun takes r.front and produces an Option of that type auto mapFilter(alias fun, R)(R r); // turn a possibly null value into

Re: "default" keyword as function attribute

2016-03-21 Thread Jakob Ovrum via Digitalmars-d
On Monday, 21 March 2016 at 22:58:35 UTC, Jonathan M Davis wrote: I'm inclined to think that folks should think twice before apply attributes en masse like that. Why? It makes it _way_ too easy to miss that the attribute is being applied when it's somewhere else entirely in the file. This

Re: Stylish and dlang,org

2016-10-08 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 8 October 2016 at 08:03:50 UTC, Russel Winder wrote: jmiller did a dark dlang.or Stylish style in 2012. It is now moderately (!) out of date. Anyone know if jmiller is around to update it, or if that is not possible someone who knows Stylish styles to create a new one so that we

Re: Using gethostbyname_r instead of gethostbyname in std.socket

2016-10-08 Thread Jakob Ovrum via Digitalmars-d
On Friday, 7 October 2016 at 08:38:24 UTC, MWumpusZ wrote: We are currently using phobos from http://downloads.dlang.org/releases/2016/dmd.2.071.0.linux.zip Phobos' InternetAddress contained therein uses gethostbyname and not gethostbyname_r; std.socket imports core.sys.posix.netdb, which

Re: DConf 2014: SDC, a D Compiler as a Library

2014-07-24 Thread Jakob Ovrum via Digitalmars-d-announce
On Wednesday, 23 July 2014 at 16:07:44 UTC, Andrei Alexandrescu wrote: Last (but not least!) talk of DConf 2014. https://twitter.com/D_Programming/status/491977150694961152 https://www.facebook.com/dlang.org/posts/889844197695929

Re: Voting: std.logger

2014-08-19 Thread Jakob Ovrum via Digitalmars-d-announce
On Sunday, 17 August 2014 at 02:55:52 UTC, Dicebot wrote: Results: http://wiki.dlang.org/Review/std.logger#Voting_for_std.experimental The link to the team-phobos page doesn't work for me, so I'm not entirely sure what it is (list of users with commit rights?), but in any case, I don't think

Re: How to define and use a custom comparison function

2014-06-16 Thread Jakob Ovrum via Digitalmars-d-learn
On Tuesday, 17 June 2014 at 04:32:20 UTC, Jakob Ovrum wrote: On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote: MyCompare cmp(SortOrder.ASC, 10); This syntax is not valid D. It should be: auto cmp = MyCompare(SortOrder,ASC, 10); Sorry, that first comma is a typo and should

Re: How to define and use a custom comparison function

2014-06-16 Thread Jakob Ovrum via Digitalmars-d-learn
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote: MyCompare cmp(SortOrder.ASC, 10); This syntax is not valid D. It should be: auto cmp = MyCompare(SortOrder,ASC, 10);

Re: findSplit

2014-07-25 Thread Jakob Ovrum via Digitalmars-d-learn
On Friday, 25 July 2014 at 18:56:44 UTC, Gecko wrote: findSplit accepts a predicate but it doesnt compile for me if i use an other function than ((a,b) = a == b). Not at the moment. I've been working on a patch that makes the `findSplit*` family of algorithms as powerful as `find`, including

Re: pop popFront combined

2014-09-20 Thread Jakob Ovrum via Digitalmars-d-learn
On Saturday, 20 September 2014 at 18:59:03 UTC, Nordlöw wrote: Is there a reason why popFront doesn't automatically return what front does? If so I'm still missing a combined variant of pop and popFront in std.range. Why isn't such a common operation in Phobos already? Sometimes after

Re: pop popFront combined

2014-11-01 Thread Jakob Ovrum via Digitalmars-d-learn
On Saturday, 1 November 2014 at 11:43:28 UTC, Nordlöw wrote: On Saturday, 20 September 2014 at 19:23:46 UTC, Jakob Ovrum wrote: If you want move semantics, use `moveFront`. But x.moveFront doesn't modify x. It does modify `x` as it leaves `front` in a destroyed and default-initialized

Re: how can I get a reference of array?

2015-02-05 Thread Jakob Ovrum via Digitalmars-d-learn
On Thursday, 5 February 2015 at 06:58:09 UTC, Ali Çehreli wrote: On 02/04/2015 10:42 PM, zhmt wrote: Here is a simple code snippet: With this approach, the allocation of `arr` itself is often clumsy and error-prone. In this case it is important to note that `arr` is allocated on the stack

Re: Intended to be able to RefCount an interface?

2015-02-10 Thread Jakob Ovrum via Digitalmars-d-learn
On Tuesday, 10 February 2015 at 06:26:39 UTC, weaselcat wrote: Is there currently an enhancement request open for this on the bug tracker? I cannot find anything. I couldn't find it either, so I filed it: https://issues.dlang.org/show_bug.cgi?id=14168

Re: What is the Correct way to Malloc in @nogc section?

2015-02-12 Thread Jakob Ovrum via Digitalmars-d-learn
On Thursday, 12 February 2015 at 23:27:51 UTC, Kitt wrote: The Exception obviously uses the GC, and would need to be replaced with a printf or something; however, emplace doesn't have a @nogc replacement that I know of. What I'd like to know, from people much more knowledgeable about the ins

Re: NEW asm.dlang.org site

2015-02-01 Thread Jakob Ovrum via Digitalmars-d-announce
On Monday, 26 January 2015 at 23:46:24 UTC, Iain Buclaw wrote: All work is hosted on Github[3], and we are planning on moving it to part of the D-Programming-Language repositories. I really wish we would eat our own dog food and use D for these projects. Nazriel's dpaste is in friggin PHP and

Re: Intended to be able to RefCount an interface?

2015-02-09 Thread Jakob Ovrum via Digitalmars-d-learn
On Tuesday, 10 February 2015 at 04:44:55 UTC, weaselcat wrote: Thread title. interface Itest{ } class testclass : Itest{ } void main() { import std.typecons; auto test = RefCounted!Itest(new testclass()); } If you change the refcounted to type testclass it doesn't compile because

Re: Gary Willoughby: Why Go's design is a disservice to intelligent programmers

2015-03-25 Thread Jakob Ovrum via Digitalmars-d-announce
On Wednesday, 25 March 2015 at 21:00:37 UTC, Andrei Alexandrescu wrote: https://www.reddit.com/r/programming/comments/30ad8b/why_gos_design_is_a_disservice_to_intelligent/ Andrei As I know Gary is sometimes (often?) on these forums I'll post some critique here. Misrepresenting Go in a

Re: using vibe.d to parse json

2015-03-25 Thread Jakob Ovrum via Digitalmars-d-learn
On Thursday, 26 March 2015 at 00:41:50 UTC, Laeeth Isharc wrote: Yeah, it is not very intuitive. But it works. Thanks. Next question - how can I correctly deal with inconsiderately chosen JSON field names like 'private' (which conflict in a struct declaration with D language keywords). A

Re: Gary Willoughby: Why Go's design is a disservice to intelligent programmers

2015-03-25 Thread Jakob Ovrum via Digitalmars-d-announce
On Thursday, 26 March 2015 at 02:04:26 UTC, Laeeth Isharc wrote: You describe these as issues forming part of a critique and suggesting the substance of what he wrote is wrong, but are these substantive in the context of a quick blog post (where it is more important to say something generative

<    1   2   3   >