Re: DIY checking exceptions

2017-06-27 Thread John Colvin via Digitalmars-d
On Tuesday, 27 June 2017 at 00:10:32 UTC, jag wrote: On Monday, 26 June 2017 at 21:53:57 UTC, John Colvin wrote: I wonder what could be done with something like this: void foo(int a) { if (a > 0) throw new BlahException("blah"); throw new BloopException("bl

DIY checking exceptions

2017-06-26 Thread John Colvin via Digitalmars-d
On Sunday, 25 June 2017 at 17:38:14 UTC, mckoder wrote: I am disappointed that D doesn't have checked exceptions. I wonder what could be done with something like this: void foo(int a) { if (a > 0) throw new BlahException("blah"); throw new BloopException("bloop"); } unittest

Re: Finding the index of the maximum value in an associative array

2017-06-01 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 18:05:07 UTC, H. S. Teoh wrote: On Tue, May 30, 2017 at 05:57:04PM +, Lyle via Digitalmars-d-learn wrote: Hi, I have an associative array of type int[ulong] and I'm trying to get the index of the maximum value, like this: int[ulong] aa = [1UL: 2000,

Re: Bad array indexing is considered deadly

2017-06-01 Thread John Colvin via Digitalmars-d
On Thursday, 1 June 2017 at 14:21:35 UTC, Stanislav Blinov wrote: On Thursday, 1 June 2017 at 14:10:21 UTC, John Colvin wrote: I would be interested to see ideas of how to implement some sort of logical sandboxing in D. Perhaps if one calls a strongly pure @safe function, there is no way

Re: Bad array indexing is considered deadly

2017-06-01 Thread John Colvin via Digitalmars-d
On Thursday, 1 June 2017 at 10:26:24 UTC, Steven Schveighoffer wrote: On 5/31/17 9:05 PM, Walter Bright wrote: On 5/31/2017 6:04 AM, Steven Schveighoffer wrote: Technically this is a programming error, and a bug. But memory hasn't actually been corrupted. Since you don't know where the bad

Re: Bad array indexing is considered deadly

2017-05-31 Thread John Colvin via Digitalmars-d
On Wednesday, 31 May 2017 at 13:04:52 UTC, Steven Schveighoffer wrote: I have discovered an annoyance in using vibe.d instead of another web framework. Simple errors in indexing crash the entire application. For example: int[3] arr; arr[3] = 5; Compare this to, let's say, a malformed

Re: std.functional.memoize : thread local or __gshared memoization?

2017-05-27 Thread John Colvin via Digitalmars-d
On Saturday, 27 May 2017 at 10:29:05 UTC, Ola Fosheim Grøstad wrote: On Saturday, 27 May 2017 at 10:02:35 UTC, Jonathan M Davis wrote: As such, the fact that D programmers frequently decide to use __gshared in order to avoid dealing with the restrictions with shared is actually extremely bad.

Re: Faster Command Line Tools in D

2017-05-26 Thread John Colvin via Digitalmars-d-announce
On Friday, 26 May 2017 at 14:41:39 UTC, John Colvin wrote: I spent some time fiddling with my own manual approaches to making this as fast, wasn't satisfied and so decided to try using Steven's iopipe (https://github.com/schveiguy/iopipe) instead. Results were excellent. https

Re: Faster Command Line Tools in D

2017-05-26 Thread John Colvin via Digitalmars-d-announce
/faster_command_line_tools_in_d/ I spent some time fiddling with my own manual approaches to making this as fast, wasn't satisfied and so decided to try using Steven's iopipe (https://github.com/schveiguy/iopipe) instead. Results were excellent. https://gist.github.com/John-Colvin

Re: [4Walter] D is 40 times slower. We need a new language feature!

2017-05-20 Thread John Colvin via Digitalmars-d
On Saturday, 20 May 2017 at 11:34:55 UTC, 9il wrote: On Saturday, 20 May 2017 at 11:30:54 UTC, John Colvin wrote: On Saturday, 20 May 2017 at 03:24:41 UTC, 9il wrote: Hello, When users write math code, they expect [2, 3, 4] that the code like [...] What you are saying

Re: [4Walter] D is 40 times slower. We need a new language feature!

2017-05-20 Thread John Colvin via Digitalmars-d
On Saturday, 20 May 2017 at 03:24:41 UTC, 9il wrote: Hello, When users write math code, they expect [2, 3, 4] that the code like [...] What you are saying is that there is a specific shortcoming that you are observing in optimisers, yes? Perhaps we should investigate how to fix the

Re: Access specifiers and visibility

2017-05-13 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 10 May 2017 at 01:42:47 UTC, Andrew Edwards wrote: Attempting to update a git repo to current D, I encounter the following deprecation messages: src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_down is not visible from module

Re: DLang quarterly EU?

2017-05-07 Thread John Colvin via Digitalmars-d
On Saturday, 6 May 2017 at 23:53:45 UTC, Ethan Watson wrote: I was speaking to Atila earlier about the things we like about DConf. Sitting around talking to a bunch of computer scientists is fantastic, and not something people generally get to do in their chosen careers as a programmer. EU

Re: LDC 1.3.0-beta1 has been released!

2017-05-05 Thread John Colvin via Digitalmars-d-announce
On Friday, 5 May 2017 at 10:16:41 UTC, Kai Nacke wrote: Hi everyone, LDC 1.3.0-beta1, the LLVM-based D compiler, is available for download! This release is based on the 2.073.2 frontend and standard library and supports LLVM 3.5-4.0. We provide binaries for Linux, OX X, FreeBSD, Win32 &

Re: See you soon at dconf

2017-05-03 Thread John Colvin via Digitalmars-d
On Tuesday, 2 May 2017 at 20:19:02 UTC, Stefan Koch wrote: Hi, I am very happy to see you soon at dconf. And I apologize in advance for my nearly slideless talk. Hope this time there is dmd on the machine! Cheers Stefan I'm guessing everyone will be converging on the conference hotel as

Re: [OT] Algorithm question

2017-05-01 Thread John Colvin via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: I'm been thinking about the following problem, and thought I'd pick the brains of the bright people around these parts... Given a set A of n elements (let's say it's a random-access range of size n, where n is relatively large), and a

Re: {OT} Youtube Video: newCTFE: Starting to write the x86 JIT

2017-04-22 Thread John Colvin via Digitalmars-d
On Thursday, 20 April 2017 at 12:56:11 UTC, Stefan Koch wrote: Hi Guys, I just begun work on the x86 jit backend. Because right now I am at a stage where further design decisions need to be made and those decisions need to be informed by how a _fast_ jit-compatible x86-codegen is

Re: Call for arms: Arch Linux D package maintenance

2017-04-11 Thread John Colvin via Digitalmars-d-announce
On Thursday, 16 February 2017 at 19:58:47 UTC, Rory McGuire wrote: Hi, I am planning on asking to become TU for the dlang packages in community. I've been building and working with the current packages and making my own packages to make sure I know what I'm getting in to. LDC and GDC are

Re: vibe.d 0.8.0 and 0.7.31 beta releases

2017-03-28 Thread John Colvin via Digitalmars-d-announce
On Thursday, 9 February 2017 at 19:40:45 UTC, Sönke Ludwig wrote: Am 09.02.2017 um 18:00 schrieb Kagamin: On Wednesday, 8 February 2017 at 15:18:34 UTC, Sönke Ludwig wrote: The problem is that there are two affected call stacks - the @system API function that registers the @system callback,

Re: List Comprehension equivalent

2017-03-17 Thread John Colvin via Digitalmars-d-learn
On Friday, 17 March 2017 at 19:08:36 UTC, Russel Winder wrote: On Fri, 2017-03-17 at 17:51 +, Jerry via Digitalmars-d-learn wrote: On Friday, 17 March 2017 at 17:13:48 UTC, Russel Winder wrote: > I have a bit of code: > > string[] returnValue; >foreach(string key, string[] value;

Re: Something wrong with reflection inside struct destructor

2017-03-14 Thread John Colvin via Digitalmars-d
On Tuesday, 14 March 2017 at 13:38:52 UTC, Jack Applegame wrote: On Tuesday, 14 March 2017 at 12:44:16 UTC, Jack Applegame wrote: Workaround: Avoid reflection in the destructor. Do reflection in normal function and then call it from destructor. This doesn't work -

Re: Update on Unums

2017-03-13 Thread John Colvin via Digitalmars-d-announce
On Monday, 13 March 2017 at 15:08:56 UTC, H. S. Teoh wrote: On Mon, Mar 13, 2017 at 08:32:04AM +, Nick B via Digitalmars-d-announce wrote: If I get the approval to post Johns latest presentation, I will do so. [...] Link? urmm...

Re: Zcoin implementation bug enabled attacker to create 548, 000 Zcoins

2017-03-09 Thread John Colvin via Digitalmars-d
On Thursday, 9 March 2017 at 15:55:07 UTC, deadalnix wrote: On Thursday, 9 March 2017 at 15:42:22 UTC, qznc wrote: I'm curious. Where does it make sense for opEquals to be non-pure? Likewise opCmp, etc. When the object need some kind of normalization to be comparable and you don't want to

Re: Phobos and LTO

2017-03-05 Thread John Colvin via Digitalmars-d
On Sunday, 5 March 2017 at 21:00:32 UTC, Dmitry Olshansky wrote: On 3/5/17 6:17 PM, Las wrote: Is Phobos compiled with LTO enabled? LTO is *link* time optimization so I'd say it makes no sense for libraries, as they are not linked. --- Dmitry Olshansky Shared libraries are linked.

Re: In Expressions

2017-03-04 Thread John Colvin via Digitalmars-d-learn
On Saturday, 4 March 2017 at 17:11:46 UTC, Andrey wrote: Hello, is there any way to using in expression like in python, e.g. if 4 in [1, 3, 4]: do something My code in D if (regionAlign in [RegionAlign.top, RegionAlign.bottom]) { ... } throws an error: incompatible types for

Re: opDispatch forwarding and ifti

2017-02-27 Thread John Colvin via Digitalmars-d
On Monday, 27 February 2017 at 12:22:02 UTC, Stefan Koch wrote: On Monday, 27 February 2017 at 12:14:10 UTC, John Colvin wrote: Has anyone ever found a way to actually implement forwarding properly with opDispatch, such that it works for both general templates and also functions called using

opDispatch forwarding and ifti

2017-02-27 Thread John Colvin via Digitalmars-d
Has anyone ever found a way to actually implement forwarding properly with opDispatch, such that it works for both general templates and also functions called using ifti (implicit function template instantiation)? I've spent a day on it trying to improve std.typecons.Proxy to support this

Re: template parameter inference and introspection

2017-02-24 Thread John Colvin via Digitalmars-d-learn
On Friday, 24 February 2017 at 14:06:22 UTC, Meta wrote: On Friday, 24 February 2017 at 11:17:46 UTC, John Colvin wrote: Unfortunately that only works by accident of my example. A counterexample: T foo(Q = float, T = short)(T t) { return t; } alias Typeof(alias v) = typeof(v); template

Calling all D template gurus: exposing the overload/template matching system via std.traits

2017-02-24 Thread John Colvin via Digitalmars-d
In keeping with "design by introspection" I've been wanting to write library code that statically inspects the abilities of the entities it's passed and reacts accordingly. Unfortunately, this approach tends to hide implementation mistakes: there's no general way to distinguish between "this

Re: template parameter inference and introspection

2017-02-24 Thread John Colvin via Digitalmars-d-learn
On Thursday, 23 February 2017 at 18:33:33 UTC, Meta wrote: On Thursday, 23 February 2017 at 18:21:51 UTC, Meta wrote: On Thursday, 23 February 2017 at 16:01:44 UTC, John Colvin wrote: Is there any way to get a reference/alias to the instantiation of a template function that would be called

template parameter inference and introspection

2017-02-23 Thread John Colvin via Digitalmars-d-learn
Is there any way to get a reference/alias to the instantiation of a template function that would be called, given certain parameters? I.e. to get the result of whatever template parameter inference (and overload resolution) has occurred? E.g. for some arbitrarily complex foo: static

Re: New (page-per-artifact) standard library doc examples are now editable and runnable

2017-02-17 Thread John Colvin via Digitalmars-d-announce
On Friday, 17 February 2017 at 05:06:20 UTC, Seb wrote: On Saturday, 7 January 2017 at 16:12:49 UTC, Andrei Alexandrescu wrote: Following https://github.com/dlang/dlang.org/pull/1532, the new-style docs now also allow editing and running examples. Start at http://dlang.org/library-prerelease/

Re: creating a temporary fifo (tmpfile but for fifo)

2017-02-16 Thread John Colvin via Digitalmars-d
On Thursday, 16 February 2017 at 17:27:51 UTC, Paul Backus wrote: On Tuesday, 14 February 2017 at 03:15:53 UTC, Andrei Alexandrescu wrote: On 2/13/17 12:12 PM, Paul Backus wrote: [...] Note that these functions are part of POSIX but not C99, and are not included in D's core.stdc module. [1]

Re: syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

2017-02-15 Thread John Colvin via Digitalmars-d
On Thursday, 16 February 2017 at 00:37:00 UTC, ZombineDev wrote: On Thursday, 16 February 2017 at 00:08:12 UTC, Walter Bright wrote: On 2/15/2017 12:31 PM, Jonathan M Davis via Digitalmars-d wrote: It's one of those features that I was surprised when you couldn't do it. It was an oversight.

Re: syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

2017-02-15 Thread John Colvin via Digitalmars-d
On Wednesday, 15 February 2017 at 19:39:52 UTC, Andrei Alexandrescu wrote: On 02/15/2017 06:20 AM, Daniel N wrote: On Wednesday, 15 February 2017 at 09:22:14 UTC, Daniel N wrote: template every(T...) { template satisfies(U...) { enum satisfies = true; } } (lunch-break =>

Re: D future ...

2017-02-15 Thread John Colvin via Digitalmars-d
On Tuesday, 14 February 2017 at 10:22:26 UTC, Ola Fosheim Grøstad wrote: But, the way I see it TypeScript + "native libraries" has the potential for covering a lot of ground. The eco system is exploding. Having done a fair amount of professional development in typescript over the last 6

Re: macOS: debugging hell - strange behavior in lldb and gdb

2017-02-14 Thread John Colvin via Digitalmars-d-debugger
On Tuesday, 14 February 2017 at 23:35:15 UTC, Relja Ljubobratovic wrote: On Tuesday, 14 February 2017 at 20:32:53 UTC, John Colvin wrote: The docs say it is, but they could be wrong. Could you run dub with -v (and without any manually added -gc) and share the output? Sure, here's what I'd

Re: macOS: debugging hell - strange behavior in lldb and gdb

2017-02-14 Thread John Colvin via Digitalmars-d-debugger
On Tuesday, 14 February 2017 at 18:08:18 UTC, Relja Ljubobratovic wrote: On Tuesday, 14 February 2017 at 15:37:34 UTC, John Colvin wrote: On Sunday, 12 February 2017 at 10:27:38 UTC, Relja Ljubobratovic wrote: Hey guys, I've had zero luck with debuggers on macOS. Here's the story

Re: macOS: debugging hell - strange behavior in lldb and gdb

2017-02-14 Thread John Colvin via Digitalmars-d-debugger
On Sunday, 12 February 2017 at 10:27:38 UTC, Relja Ljubobratovic wrote: Hey guys, I've had zero luck with debuggers on macOS. Here's the story: [...] You might find adding symbolic debug info will be useful, which is done with -g or -gc. You might also want to experiment with the

Re: Workaround for DIP 1005

2017-02-14 Thread John Colvin via Digitalmars-d
On Thursday, 9 February 2017 at 05:40:01 UTC, Jonathan M Davis wrote: with(import std.datetime) auto foo(SysTime st1, SysTime st2, Duration d); There is of course the middle way: with(from!q{std.datetime}) I would love to be able to use `with` and have the language accept it in a wider range

Re: Alias type with different initialiser.

2017-02-14 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 14 February 2017 at 11:34:22 UTC, Bastiaan Veelo wrote: On Monday, 13 February 2017 at 22:59:11 UTC, John Colvin wrote: Why not use a constructor instead of static opCall? I don't know, this comes from http://dlang.org/spec/struct.html#dynamic_struct_init. Your constructor looks

Re: Alias type with different initialiser.

2017-02-14 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 14 February 2017 at 10:49:19 UTC, Bastiaan Veelo wrote: On Tuesday, 14 February 2017 at 01:31:10 UTC, John Colvin wrote: On Monday, 13 February 2017 at 22:59:11 UTC, John Colvin wrote: [ snip ] sorry, made a typo, that should have been alias int1 = Initial!(int, 1

Re: Alias type with different initialiser.

2017-02-13 Thread John Colvin via Digitalmars-d-learn
On Monday, 13 February 2017 at 22:59:11 UTC, John Colvin wrote: [ snip ] sorry, made a typo, that should have been alias int1 = Initial!(int, 1); static assert(int1.initial == 1); // typeof(int1.initial) == int static assert(int1.init == 1); // typeof(int1.init) == int1

Re: Alias type with different initialiser.

2017-02-13 Thread John Colvin via Digitalmars-d-learn
On Monday, 13 February 2017 at 22:16:36 UTC, Bastiaan Veelo wrote: On Monday, 13 February 2017 at 16:40:02 UTC, Daniel Kozak wrote: https://dlang.org/phobos/std_typecons.html#.Typedef Thanks for the pointers. Both Typedef and Proxy create types that don't mix with the base type, which I want

Re: Questionnaire

2017-02-09 Thread John Colvin via Digitalmars-d-announce
On Thursday, 9 February 2017 at 18:34:44 UTC, bachmeier wrote: On Thursday, 9 February 2017 at 17:28:47 UTC, jmh530 wrote: Other stuff I would find useful: 1) R integration (I know someone's done work on this, but it's hard to find and I don't remember if it works on Windows. Really just

Re: Passing variables, preserving UDAs: A Gripe

2017-02-08 Thread John Colvin via Digitalmars-d
On Wednesday, 8 February 2017 at 07:57:15 UTC, Timon Gehr wrote: On 07.02.2017 22:59, Nick Sabalausky wrote: Suppose I have some code that operates on a variable's value and its UDAs. And I want to refactor that code into a reusable function. Sounds simple enough, right? So, consider a basic

Re: glibc resolve.h for D

2017-02-08 Thread John Colvin via Digitalmars-d
On Wednesday, 8 February 2017 at 12:49:39 UTC, Márcio Martins wrote: Anyone has a binding readily available that I can use? code.dlang.org is down, so I can't check there - I am in a hurry! :) I dont' have one, but if you're in a hurry then copy and port the C function/constant defs and port

Re: code.dlang.org internal server error

2017-02-08 Thread John Colvin via Digitalmars-d
On Wednesday, 8 February 2017 at 05:49:55 UTC, Ali Çehreli wrote: code.dlang.org gives the following error: 500 - Internal Server Error Internal Server Error Ali Seeing as code.dlang.org is pretty critical these days, it would be great if there was a better way to handle this than "wait

Re: Associative array literal: length wrong when duplicate keys found

2017-01-31 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 31 January 2017 at 14:15:58 UTC, Ivan Kazmenko wrote: Hi. I wanted to check whether a few variables of the same type are all distinct, in a quick and dirty way. I tried to do it similar to Python's "len(set(value_list)) == len(value_list)" idiom by using an associative array

Re: memcpy() comparison: C, Rust, and D

2017-01-31 Thread John Colvin via Digitalmars-d
On Tuesday, 31 January 2017 at 10:17:09 UTC, Olivier FAURE wrote: On Tuesday, 31 January 2017 at 01:30:48 UTC, Walter Bright wrote: 3. Nothing s2 transitively points to is altered via s2. Wait, really? Does that mean that this code is implicitly illegal? import core.stdc.string; void

Re: Aerospike wrapper/driver for vibe.d ?

2017-01-30 Thread John Colvin via Digitalmars-d
On Saturday, 28 January 2017 at 16:52:29 UTC, Rico Decho wrote: Thanks for proposing it ! I've just added John's sample code to the wiki (hoping that he doesn't mind). that's fine :)

Re: Aerospike wrapper/driver for vibe.d ?

2017-01-28 Thread John Colvin via Digitalmars-d
On Saturday, 28 January 2017 at 09:59:10 UTC, Rico Decho wrote: I agree, one step at a time... Anyway, as I've never used D's type introspection and compile-time code generation, my options are quite limited at the moment :( Binding to C is really, really easy for most cases. E.g. for a

Re: COMDAT error

2017-01-26 Thread John Colvin via Digitalmars-d
On Thursday, 26 January 2017 at 11:20:34 UTC, Profile Anaysis wrote: test1.obj : fatal error LNK1179: invalid or corrupt file: duplicate COMDAT '_D4main4mainFAAyaZ16__T3recVii1TAAiZ3recMFNfAAiZv (@safe void main.main(immutable(char)[][]).rec!(1, int[][]).rec(int[][]))' [...] Thanks for

Re: CTFE Status

2017-01-24 Thread John Colvin via Digitalmars-d
On Tuesday, 24 January 2017 at 06:35:56 UTC, Stefan Koch wrote: And the second one is the "to" template from std.conv; Because of the aforementioned UTF issues. NOTE: that the blacklist is by nature transitive meaning a function that calls a blacklisted function will also not be interpreted

Re: Need a std::numeric_limits::lowest() equivalent

2017-01-21 Thread John Colvin via Digitalmars-d
On Saturday, 21 January 2017 at 00:03:11 UTC, Xavier Bigand wrote: std::numeric_limits::lowest() is describe as "A finite value x such that there is no other finite value y * where y < x." According to what I presume that definition means ("no other finite value" means "no other

Re: [DIP1005] Unused imports in with(import) declarations: leave alone of flag as errors?

2016-12-25 Thread John Colvin via Digitalmars-d
On Saturday, 24 December 2016 at 20:32:58 UTC, Andrei Alexandrescu wrote: Consider: with (import std.stdio) int fun(int x/*, File f*/) { // f.writeln("In: ", x); return x * x; } Such situations occur during refactorings and code evolution. The import is no longer used. Should the

Re: DIP10005: Dependency-Carrying Declarations is now available for community feedback

2016-12-24 Thread John Colvin via Digitalmars-d
On Saturday, 24 December 2016 at 02:23:53 UTC, Chris Wright wrote: Appendix A: templates that would receive 'with(import foo)' in Phobos. I used a relatively simple regex to look for this. If someone put more than one line between a template and its constraints, or comments with certain

Re: ModuleInfo, factories, and unittesting

2016-12-22 Thread John Colvin via Digitalmars-d
On Thursday, 22 December 2016 at 18:19:31 UTC, Andrei Alexandrescu wrote: On 12/22/2016 12:46 PM, Piotrek wrote: The inability to give test a name (plus selective unittesting) and continue on failure is puzzling to me. Both of these are affordable with the current language (attributes) with

Re: Improvement in pure functions specification

2016-12-21 Thread John Colvin via Digitalmars-d
On Wednesday, 21 December 2016 at 15:40:42 UTC, Andrei Alexandrescu wrote: On 12/20/2016 05:49 PM, Andrei Alexandrescu wrote: https://github.com/dlang/dlang.org/pull/1528 -- Andrei Dropped the void functions. On to the next scandal: A function that accepts only parameters without mutable

Re: A betterC modular standard library?

2016-12-20 Thread John Colvin via Digitalmars-d
On Tuesday, 20 December 2016 at 09:56:34 UTC, Ilya Yaroshenko wrote: Of course you can bundle your own Phobos. If you put a std.* module in your path your build will be working against that instead. If you don't mess around with sc.ini it will override the default for that compilation. CPUID

Re: dub to create multiple executables from one source directory?

2016-12-19 Thread John Colvin via Digitalmars-d
On Monday, 19 December 2016 at 12:36:13 UTC, Sönke Ludwig wrote: Am 19.12.2016 um 11:24 schrieb biocyberman: Hi I am learning D and dub, and playing with this repository: https://github.com/biod/BioD The whole repo itself and be compiled with `dub build` command. How write dub.json under

Re: [WIP] A Big O notation and algebra for D

2016-12-18 Thread John Colvin via Digitalmars-d
On Sunday, 18 December 2016 at 18:26:27 UTC, Andrei Alexandrescu wrote: Article: http://erdani.com/d/bigo.html (do not publish; should do it with Mike) Code (preliminary): https://github.com/dlang/phobos/pull/4965 Andrei static assert( complexity!(insertFrontMany!MyC) <= O("n2") *

Re: [OT] D in makefiles

2016-12-17 Thread John Colvin via Digitalmars-d
On Saturday, 17 December 2016 at 02:00:34 UTC, Superstar64 wrote: Makefiles allow custom shells. So with a small wrapper script we can use D in makefile. Here's my proof of concept: https://gist.github.com/Superstar64/8b896312ebe1a6e6240b1cba8aed2488. If you define SHELL = rdmd you might not

Re: Will this features be accepted for DUB?

2016-12-16 Thread John Colvin via Digitalmars-d
On Friday, 16 December 2016 at 19:14:39 UTC, jmh530 wrote: On Friday, 16 December 2016 at 17:21:13 UTC, John Colvin wrote: Do you actually mean extern(C) or extern(D)? You said both at different points in this thread. Perhaps this will give you an idea to start from: name "mir

Re: Will this features be accepted for DUB?

2016-12-16 Thread John Colvin via Digitalmars-d
On Friday, 16 December 2016 at 17:21:13 UTC, John Colvin wrote: On Friday, 16 December 2016 at 15:09:02 UTC, Ilya Yaroshenko wrote: [...] Do you actually mean extern(C) or extern(D)? You said both at different points in this thread. Perhaps this will give you an idea to start from: name

Re: Will this features be accepted for DUB?

2016-12-16 Thread John Colvin via Digitalmars-d
On Friday, 16 December 2016 at 15:09:02 UTC, Ilya Yaroshenko wrote: On Friday, 16 December 2016 at 13:55:55 UTC, Guillaume Piolat wrote: Trying to answer with the existing dub. On Friday, 16 December 2016 at 13:21:53 UTC, Ilya Yaroshenko wrote: We need 1. a post fetch (build) options. GLAS

Re: unDE 0.1.0: original file manager, image and text viewer

2016-12-16 Thread John Colvin via Digitalmars-d-announce
On Thursday, 15 December 2016 at 20:16:10 UTC, unDEFER wrote: Hello, my dear friends! So many days you answers on many my questions. And today I glad to present my work: unDE 0.1.0. It is very original file manager, image and text viewer. More information:

Re: DIP10005: Dependency-Carrying Declarations is now available for community feedback

2016-12-16 Thread John Colvin via Digitalmars-d
On Thursday, 15 December 2016 at 22:56:42 UTC, Dmitry Olshansky wrote: On 12/13/16 11:33 PM, Andrei Alexandrescu wrote: Destroy. https://github.com/dlang/DIPs/pull/51/files Andrei On first it seems like an awesome idea. That solves ... but wait what? Thinking more about the problem at

Re: Milestone - DMD front end is now 100% D!

2016-12-15 Thread John Colvin via Digitalmars-d-announce
On Thursday, 15 December 2016 at 19:58:50 UTC, Iain Buclaw wrote: This will be the direction that I anticipate to head in until a time comes where the frontend exposes everything GDC depends upon in order to bootstrap to the latest stable branch. Is there a good list of what is necessary

Re: What's the oldest Mac targeted by D programmers?

2016-12-06 Thread John Colvin via Digitalmars-d
On Tuesday, 6 December 2016 at 09:12:16 UTC, Walter Bright wrote: I've been experimenting with code generation in DMD for the AVX instruction set, in particular the replacement of SSE 16 byte vectors with AVX 16 byte vectors (no, not the 32 byte ones!). In my experiments on my machines, two

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-27 Thread John Colvin via Digitalmars-d-learn
On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; unittest { assert(aa["foo"] == 5); assert(aa["bar"] == 10); assert(aa["baz"] == 2000); } But results

Re: Mir Random [WIP]

2016-11-24 Thread John Colvin via Digitalmars-d
On Thursday, 24 November 2016 at 16:09:23 UTC, Ilya Yaroshenko wrote: On Thursday, 24 November 2016 at 13:45:40 UTC, Jonathan M Davis wrote: Alternatively, you could just do rndGen().take(1).front, and as long as rndGen() gives you a reference type, it works just fine. Unfortunately,

Re: Mir Random [WIP]

2016-11-24 Thread John Colvin via Digitalmars-d
On Thursday, 24 November 2016 at 10:41:44 UTC, Kagamin wrote: On Thursday, 24 November 2016 at 10:16:11 UTC, John Colvin wrote: I was talking about andrei's example. He has a cast(int) in it before the division. And you think that compilation of cast(int)a.length/2 to 3 instructions

Re: Mir Random [WIP]

2016-11-24 Thread John Colvin via Digitalmars-d
On Thursday, 24 November 2016 at 10:14:27 UTC, Kagamin wrote: On Thursday, 24 November 2016 at 09:46:16 UTC, John Colvin wrote: That's because of the cast(int), dividing by two is optimised just fine. What about Andrei's example? I was talking about andrei's example. He has a cast(int

Re: Updated D then undefined symbols in vibed

2016-11-24 Thread John Colvin via Digitalmars-d-learn
On Thursday, 24 November 2016 at 09:52:32 UTC, Jot wrote: Using vibe D. designed to update dmd to latest and then I now get the following errors: .dub\obj\debug\dev\source\app.obj(app) Error 42: Symbol Undefined _D3std6format12arrayPtrDiffFNaNbNiNexAvxAvZi

Re: Mir Random [WIP]

2016-11-24 Thread John Colvin via Digitalmars-d
On Thursday, 24 November 2016 at 08:55:18 UTC, Kagamin wrote: On Wednesday, 23 November 2016 at 21:18:27 UTC, Andrei Alexandrescu wrote: [Details needed] I just took a look https://godbolt.org/g/EMy6X4, it's happening. That's three instructions instead of one shr eax,1 That's because of

Re: Mir Random [WIP]

2016-11-22 Thread John Colvin via Digitalmars-d
On Tuesday, 22 November 2016 at 23:55:01 UTC, Andrei Alexandrescu wrote: On 11/22/16 1:31 AM, Ilya Yaroshenko wrote: - `opCall` API instead of range interface is used (similar to C++) This seems like a gratuitous departure from common D practice. Random number generators are most naturally

Re: CTFE C compiler

2016-11-21 Thread John Colvin via Digitalmars-d
On Monday, 21 November 2016 at 10:41:27 UTC, Johan Engelen wrote: In LLVMweekly [1], I read the following: "You may be be interested, amazed, and/or horrified to learn of constexpr-8cc [2]. It provides a compile-time C compiler implemented as C++14 constant expressions." The constexpr

Re: Detect that a child is waiting for input

2016-11-20 Thread John Colvin via Digitalmars-d
On Sunday, 20 November 2016 at 12:21:19 UTC, unDEFER wrote: Hello! I'm using pipeProcess() to create a process: pipes = pipeProcess(["bash", "-c", BASH_COMMAND], Redirect.stdin | Redirect.stdout | Redirect.stderr); Is it possible detect that the child is waiting for input on stdin? I can't

Re: What is going on with the ubuntu/debian debacle ?

2016-11-20 Thread John Colvin via Digitalmars-d
On Sunday, 20 November 2016 at 10:22:10 UTC, deadalnix wrote: On Sunday, 20 November 2016 at 09:00:08 UTC, John Colvin wrote: On Sunday, 20 November 2016 at 05:01:06 UTC, Nicholas Wilson wrote: On Saturday, 19 November 2016 at 23:03:05 UTC, deadalnix wrote: A lot of users are reporting errors

Re: What is going on with the ubuntu/debian debacle ?

2016-11-20 Thread John Colvin via Digitalmars-d
On Sunday, 20 November 2016 at 05:01:06 UTC, Nicholas Wilson wrote: On Saturday, 19 November 2016 at 23:03:05 UTC, deadalnix wrote: A lot of users are reporting errors on debian and ubuntu. .o generated by dmd do not link and libphobos.a is unusable. This is very bad and we should consider a

Re: Array operations with multidimensional arrays

2016-11-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 November 2016 at 19:36:50 UTC, Marduk wrote: On Saturday, 19 November 2016 at 17:37:58 UTC, John Colvin wrote: On Saturday, 19 November 2016 at 10:20:16 UTC, Marduk wrote: Additionally, I would like to assign 2D sub-arrays of a 3D array, i.e. something like the following: int

Re: Array operations with multidimensional arrays

2016-11-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 November 2016 at 10:20:16 UTC, Marduk wrote: Additionally, I would like to assign 2D sub-arrays of a 3D array, i.e. something like the following: int[3][2][2] a; a[0] = [[2,2], [2,2]]; You have the dimensions the wrong way around. a is a 2 element array of 2 element arrays

Re: D front end implementation

2016-11-17 Thread John Colvin via Digitalmars-d
On Thursday, 17 November 2016 at 21:39:15 UTC, Timon Gehr wrote: On 17.11.2016 03:52, Stefan Koch wrote: On Wednesday, 16 November 2016 at 09:11:50 UTC, Timon Gehr wrote: I want to get there eventually. :) Unfortunately I haven't had a lot of time to spend on this lately. Also, DMD 2.060 has

Re: Boston D Language Meetup in Back Bay

2016-11-17 Thread John Colvin via Digitalmars-d-announce
On Thursday, 17 November 2016 at 16:28:08 UTC, Steven Schveighoffer wrote: On 11/17/16 10:38 AM, John Colvin wrote: On Thursday, 17 November 2016 at 13:59:25 UTC, Steven Schveighoffer wrote: [...] Can't you use a template lambda alias argument to pushTo instead, so then you can instantiate

Re: Boston D Language Meetup in Back Bay

2016-11-17 Thread John Colvin via Digitalmars-d-announce
On Thursday, 17 November 2016 at 13:59:25 UTC, Steven Schveighoffer wrote: nullStream!char .bufferedInput .pushTo( arrayCastPipe!ubyte .outputFile("output.txt") ); But then the parameters to the "pushTo" hypothetical function don't know what the source type is before

Re: Formal review of DIP1002

2016-11-17 Thread John Colvin via Digitalmars-d-announce
On Thursday, 17 November 2016 at 11:37:09 UTC, Dicebot wrote: Disposition: REJECT. A proposal for a similar or identical feature would need to be include qualitatively new motivation/evidence of usefulness. Please follow the link for the full review text / rationale:

Re: D Lang installation on Windows, dependency on Visual Studio?

2016-11-14 Thread John Colvin via Digitalmars-d
On Monday, 14 November 2016 at 09:33:48 UTC, AB wrote: On Monday, 14 November 2016 at 09:06:18 UTC, Kagamin wrote: DMD can generate 64-bit object files just fine, you only need to link them, and DMD can invoke ms linker for you, that's all. It is unreasonable to pull in the many GBs of Visual

Re: UFCS for arguments other than first?

2016-11-11 Thread John Colvin via Digitalmars-d
On Friday, 11 November 2016 at 18:33:09 UTC, Heisenberg wrote: On Friday, 11 November 2016 at 17:07:50 UTC, John Colvin wrote: I'm sure there are loads of corner cases this doesn't cover, but: template inPos(uint n, alias f) { auto inPos(Args...)(auto ref Args args) { return f

Re: UFCS for arguments other than first?

2016-11-11 Thread John Colvin via Digitalmars-d
On Friday, 11 November 2016 at 16:39:26 UTC, Heisenberg wrote: What would it take to implement the Uniform Function Call Syntax for a function's argument which is not the first? Right now it is possible to do the following: int someNumber(int a, int b) { return a + b; } void main() {

Re: calling convention optimisation & const/immutable ref

2016-11-07 Thread John Colvin via Digitalmars-d
On Monday, 7 November 2016 at 22:46:57 UTC, Stefan Koch wrote: On Monday, 7 November 2016 at 21:45:42 UTC, John Colvin wrote: On Monday, 7 November 2016 at 20:23:37 UTC, Jacob Carlborg wrote: Since D is a systems programming language, wouldn't the user want to have control over this? It's

Re: calling convention optimisation & const/immutable ref

2016-11-07 Thread John Colvin via Digitalmars-d
On Monday, 7 November 2016 at 20:23:37 UTC, Jacob Carlborg wrote: Since D is a systems programming language, wouldn't the user want to have control over this? It's just another optimisation in a long list of optimisations that can be performed without changing semantics. What about this one

calling convention optimisation & const/immutable ref

2016-11-07 Thread John Colvin via Digitalmars-d
Some people use ref for performance to prevent the copying that must occur when passing by value. I propose a small optimisation to make this unnecessary in a bunch of cases. At the ABI level (no change in language semantics), if a given parameter would otherwise be copied and passed on the

Re: Release D 2.072.0

2016-11-05 Thread John Colvin via Digitalmars-d-announce
On Saturday, 5 November 2016 at 04:04:12 UTC, Soulsbane wrote: On Monday, 31 October 2016 at 01:27:08 UTC, Martin Nowak wrote: [...] I've run into a problem with code using ctRegex that fails to compile only in release build. [...] please report at https://issues.dlang.org/

Re: How to use dub with a manual ldc installation?

2016-11-04 Thread John Colvin via Digitalmars-d
On Friday, 4 November 2016 at 17:40:05 UTC, Andrei Alexandrescu wrote: Error: failed to create path to file: .dub/obj/.dub/packages/checkedint-0.5.3/.dub/build/library-release-linux.posix-x86_64-ldc_0-34AC553328DC970F29AC41DDB38D09AB/libcheckedint.a No such file or directory FAIL

Re: hashOf()

2016-11-02 Thread John Colvin via Digitalmars-d
On Wednesday, 2 November 2016 at 16:14:23 UTC, Márcio Martins wrote: There are 2 hashOf() definitions, one in object.d and one in core.internal.hash.d If you include core.internal.hash, you cannot call hashOf() anymore, because it conflicts with the implicit import in object.d, this is

Re: Release vibe.d 0.7.30

2016-11-01 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 1 November 2016 at 12:47:13 UTC, Jacob Carlborg wrote: On 2016-11-01 12:20, Saurabh Das wrote: How can I find out more information about the 'runApplication' change? What does "slowly fading out" mean? I think it should say something like: "slowly fading out the default main".

Re: splitter trouble

2016-11-01 Thread John Colvin via Digitalmars-d-learn
On Sunday, 30 October 2016 at 23:57:11 UTC, Ali Çehreli wrote: While working on a solution for Alfred Newman's thread, I came up with the following interim solution, which compiled but failed: auto parse(R, S)(R range, S separators) { import std.algorithm : splitter, filter, canFind;

Re: Classes and templates

2016-10-31 Thread John Colvin via Digitalmars-d
On Monday, 31 October 2016 at 19:24:46 UTC, Hefferman wrote: Hello, I've been trying to implement a class for sorting which accepts arrays which "different" data types. Hard to describe, here's my example (filename sorting.d): [...] Glad to see you're getting helpful responses here, but

Re: Box2D Lite D Port (Yet Another)

2016-10-31 Thread John Colvin via Digitalmars-d-announce
On Monday, 31 October 2016 at 13:53:26 UTC, ketmar wrote: On Monday, 31 October 2016 at 13:40:38 UTC, John Colvin wrote: If you could put up with putting each file (or maybe group of files that might form one dub package) in to a separate folder, add a dub.sdl for each folder, put a single

<    1   2   3   4   5   6   7   8   9   10   >