Re: Another take on decimal data types

2018-01-13 Thread rumbu via Digitalmars-d-announce
On Saturday, 13 January 2018 at 22:51:18 UTC, kdevel wrote: On Saturday, 13 January 2018 at 22:05:02 UTC, rumbu wrote: Now it prints: 1.00+0.84147098480789650669 +0.8414709848078965066525023216302990 +2.653e-18 My values differ slightly 1.00

Re: Rvalue references

2018-01-13 Thread Tony via Digitalmars-d-learn
On Sunday, 14 January 2018 at 00:55:27 UTC, Jonathan M Davis wrote: [...] It the simplest case, it means that the compiler does a bitwise copy rather than a deep copy, but in other cases, it means that the compiler is able to use the object in-place rather than creating a deep copy that

run.dlang.io can now display ASM + AST + IR

2018-01-13 Thread Seb via Digitalmars-d-announce
It was bad weather in Munich on Saturday, so run.dlang.io got a couple of new cool features: 1) Assembly output https://run.dlang.io/is/qtk8Wq However, if you are seriously interested in looking at the ASM output, I recommend https://d.godbolt.org for LDC and GDC. 2) AST of DMD frontend

Re: Compiler bug or incorrect usage for pointer of Struct?

2018-01-13 Thread Heromyth via Digitalmars-d
On Saturday, 13 January 2018 at 14:11:23 UTC, H. S. Teoh wrote: On Sat, Jan 13, 2018 at 12:22:17PM +, Heromyth via Digitalmars-d wrote: [...] auto writerFor(OutRange)(auto ref OutRange outRange) { auto res = Writer!(OutRange)(); res.setSink(outRange); return res; } struct

Re: Where can get the Number Convert module?Thanks.

2018-01-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, January 14, 2018 03:28:28 FrankLike via Digitalmars-d-learn wrote: > On Sunday, 14 January 2018 at 03:09:40 UTC, Jonathan M Davis > > wrote: > > On Sunday, January 14, 2018 02:41:39 FrankLike via > > > > Digitalmars-d-learn wrote: > >> [...] > > > > I'd suggest looking at > > > > [...]

Re: Where can get the Number Convert module?Thanks.

2018-01-13 Thread FrankLike via Digitalmars-d-learn
On Sunday, 14 January 2018 at 03:28:28 UTC, FrankLike wrote: On Sunday, 14 January 2018 at 03:09:40 UTC, Jonathan M Davis wrote: On Sunday, January 14, 2018 02:41:39 FrankLike via Digitalmars-d-learn wrote: [...] I'd suggest looking at [...] I get the result "1000" from ubyte[]

Re: how to instrument dmd compiler to dump all references to a given symbol?

2018-01-13 Thread Seb via Digitalmars-d
On Sunday, 14 January 2018 at 02:36:02 UTC, Timothee Cour wrote: eg: how to instrument dmd compiler to dump all references to a given symbol? eg: for `A.a` it should output the locations marked with HERE any help/starting points would be appreciated! ``` Struct A{ int a; void fun(){ a++;

Re: Where can get the Number Convert module?Thanks.

2018-01-13 Thread FrankLike via Digitalmars-d-learn
On Sunday, 14 January 2018 at 03:09:40 UTC, Jonathan M Davis wrote: On Sunday, January 14, 2018 02:41:39 FrankLike via Digitalmars-d-learn wrote: [...] I'd suggest looking at [...] I get the result "1000" from byte[] byteData =[0,0,0,8]; Thank you very much.

[Issue 15130] dmd emits huge data for zero initialized struct

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15130 Martin Nowak changed: What|Removed |Added Severity|normal |major --- Comment #2 from

Re: how to instrument dmd compiler to dump all references to a given symbol?

2018-01-13 Thread Shachar Shemesh via Digitalmars-d
On 14/01/18 04:42, Adam D. Ruppe wrote: On Sunday, 14 January 2018 at 02:36:02 UTC, Timothee Cour wrote: how to instrument dmd compiler to dump all references to a given symbol? you can actually do it with your own code. behold: struct A{ //int a; // comment this line int _a; // make the

Re: Where can get the Number Convert module?Thanks.

2018-01-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, January 14, 2018 02:41:39 FrankLike via Digitalmars-d-learn wrote: > On Sunday, 14 January 2018 at 02:03:39 UTC, Jonathan M Davis > > wrote: > > Well, I'm not quite sure what you mean, but if you mean that > > Such as byte[] byteData =[0,0,0,8]; > to convert, at last,get the string bit

Re: Where can get the Number Convert module?Thanks.

2018-01-13 Thread FrankLike via Digitalmars-d-learn
On Sunday, 14 January 2018 at 02:41:39 UTC, FrankLike wrote: On Sunday, 14 January 2018 at 02:03:39 UTC, Jonathan M Davis wrote: Well, I'm not quite sure what you mean, but if you mean that Sorry,Such as byte[] byteData =[8,0,0,0]; to convert, at last,get the string bit :"100".or get the

Re: Where can get the Number Convert module?Thanks.

2018-01-13 Thread FrankLike via Digitalmars-d-learn
On Sunday, 14 January 2018 at 02:03:39 UTC, Jonathan M Davis wrote: Well, I'm not quite sure what you mean, but if you mean that Such as byte[] byteData =[0,0,0,8]; to convert, at last,get the string bit :"100".or get the BitArray. Thanks.

Re: how to instrument dmd compiler to dump all references to a given symbol?

2018-01-13 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 14 January 2018 at 02:36:02 UTC, Timothee Cour wrote: how to instrument dmd compiler to dump all references to a given symbol? you can actually do it with your own code. behold: struct A{ //int a; // comment this line int _a; // make the actual var renamed... // then add a ref

Re: function template specialization question D vs. C++

2018-01-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, January 13, 2018 19:32:06 Jonathan M Davis via Digitalmars-d- learn wrote: > On Sunday, January 14, 2018 02:24:52 Adam D. Ruppe via Digitalmars-d-learn > wrote: > > On Sunday, 14 January 2018 at 02:14:50 UTC, Jonathan M Davis > > > > wrote: > > > If you're using template constraints

how to instrument dmd compiler to dump all references to a given symbol?

2018-01-13 Thread Timothee Cour via Digitalmars-d
eg: how to instrument dmd compiler to dump all references to a given symbol? eg: for `A.a` it should output the locations marked with HERE any help/starting points would be appreciated! ``` Struct A{ int a; void fun(){ a++; // HERE alias b=a; b++; // HERE } } void fun(){ int a; // NOT

Re: function template specialization question D vs. C++

2018-01-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 14 January 2018 at 00:09:42 UTC, kdevel wrote: The compiler does not allow me to specialize the primary function template for double: Yes, it does., and it works for float and double. Just `real` matches both equally, so that's the error for that type. Let me quote the spec:

Re: function template specialization question D vs. C++

2018-01-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, January 14, 2018 02:24:52 Adam D. Ruppe via Digitalmars-d-learn wrote: > On Sunday, 14 January 2018 at 02:14:50 UTC, Jonathan M Davis > > wrote: > > If you're using template constraints rather than template > > specializations, then you can't have any unconstrained > > templates. > >

Re: function template specialization question D vs. C++

2018-01-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 14 January 2018 at 02:14:50 UTC, Jonathan M Davis wrote: If you're using template constraints rather than template specializations, then you can't have any unconstrained templates. Not true: see the tip of the week here http://arsdnet.net/this-week-in-d/2016-sep-04.html

Re: function template specialization question D vs. C++

2018-01-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, January 14, 2018 01:02:46 kdevel via Digitalmars-d-learn wrote: > On Sunday, 14 January 2018 at 00:30:37 UTC, Nicholas Wilson wrote: > > The usual way to do what you are trying to do is with template > > constraints. > > > > void foo(T)() if (is(T== float)) { ...} > > Thanks. That works

Re: Where can get the Number Convert module?Thanks.

2018-01-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, January 14, 2018 01:45:37 FrankLike via Digitalmars-d-learn wrote: > Hi,everyone, > I need some help on 'Number Convert module' in D,such as > byte[] type to BinaryDigit. > Where can get the module? > > Thanks. Well, I'm not quite sure what you mean, but if you mean that you

Where can get the Number Convert module?Thanks.

2018-01-13 Thread FrankLike via Digitalmars-d-learn
Hi,everyone, I need some help on 'Number Convert module' in D,such as byte[] type to BinaryDigit. Where can get the module? Thanks.

Range over a container r-value with disabled postblit

2018-01-13 Thread Nordlöw via Digitalmars-d-learn
Given my combined hashmap and hashset container `HashMapOrSet` defined at https://github.com/nordlow/phobos-next/blob/master/src/hashmap_or_hashset.d with deterministic memory management and disabled copy constructions and a member byElement() defined as @property auto byElement()()

Re: function template specialization question D vs. C++

2018-01-13 Thread kdevel via Digitalmars-d-learn
On Sunday, 14 January 2018 at 00:30:37 UTC, Nicholas Wilson wrote: The usual way to do what you are trying to do is with template constraints. void foo(T)() if (is(T== float)) { ...} Thanks. That works but looks a bit ugly. Am I right that I have to leave out the primary (unconstrained)

Re: Rvalue references

2018-01-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 12, 2018 01:59:49 Tony via Digitalmars-d-learn wrote: > On Monday, 8 January 2018 at 23:31:27 UTC, Jonathan M Davis wrote: > > auto foo(T)(auto ref T t) > > { > > > > return t; > > > > } > > > > foo(42); > > > > will result in foo being instantiated as > > > > int foo(int t)

Re: function template specialization question D vs. C++

2018-01-13 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 14 January 2018 at 00:09:42 UTC, kdevel wrote: fusp.d ``` import std.stdio; import std.typecons; void foo (T) () { writeln ("(1) foo T = ", T.stringof); } void foo (T : float) () { writeln ("(2) foo T = ", T.stringof); } // void foo (T : double) () // { //writeln ("(2)

function template specialization question D vs. C++

2018-01-13 Thread kdevel via Digitalmars-d-learn
fusp.d ``` import std.stdio; import std.typecons; void foo (T) () { writeln ("(1) foo T = ", T.stringof); } void foo (T : float) () { writeln ("(2) foo T = ", T.stringof); } // void foo (T : double) () // { //writeln ("(2) foo T = ", T.stringof); // } void main () { foo!float;

Re: Tuple DIP

2018-01-13 Thread rikki cattermole via Digitalmars-d
On 13/01/2018 11:45 PM, Timothee Cour wrote: some people have suggested using `{a, b}` instead of `(a,b)` ; this would not work because of ambiguity, eg: `auto fun(){ return {}; }` already has a meaning, so the empty tuple would not work. so `()` is indeed better. Easy fix, tuples must have a

Article: Fuzzing D code with LDC

2018-01-13 Thread Johan Engelen via Digitalmars-d-announce
It's been a work-in-progress for half a year, but finished now: http://johanengelen.github.io/ldc/2018/01/14/Fuzzing-with-LDC.html "A not-so-well-written article about the fuzzing capability recently added to LDC, using LLVM’s libFuzzer. Compiling code with -fsanitize=fuzzer adds control-flow

Re: Tuple DIP

2018-01-13 Thread Timothee Cour via Digitalmars-d
some people have suggested using `{a, b}` instead of `(a,b)` ; this would not work because of ambiguity, eg: `auto fun(){ return {}; }` already has a meaning, so the empty tuple would not work. so `()` is indeed better. On Fri, Jan 12, 2018 at 2:44 PM, Timon Gehr via Digitalmars-d

Re: Tuple DIP

2018-01-13 Thread Timon Gehr via Digitalmars-d
On 13.01.2018 23:57, Timothee Cour wrote: the DIP says this replace std.typecons.TypeTuple however no mention is made of named arguments, so I don't see how they could be a replacement (nor how would that allow for a migration path) without mentioning a word on this, eg: what would be the

Re: Tuple DIP

2018-01-13 Thread Timothee Cour via Digitalmars-d
the DIP says this replace std.typecons.TypeTuple however no mention is made of named arguments, so I don't see how they could be a replacement (nor how would that allow for a migration path) without mentioning a word on this, eg: what would be the equivalent of this ? ` writeln(tuple!("x", "y",

Re: Tuple DIP

2018-01-13 Thread Timothee Cour via Digitalmars-d
it would also solve a long-standing issue of passing runtime optional arguments along with variadic templates, eg: current: ``` # current: bad, causes template bloat (1 template per call site) void log(string file=__FILE__, int line=__LINE__, T...)(T a); # usage: log(1, "foo"); # with this DIP

Re: Tuple DIP

2018-01-13 Thread MrSmith via Digitalmars-d
On Saturday, 13 January 2018 at 21:05:27 UTC, Timon Gehr wrote: On 13.01.2018 21:49, Timon Gehr wrote: auto (name, email) = fetchUser();     vs auto {name, email} = fetchUser(); BTW: What do you think each of those do? I'd expect the following: --- auto (name, email) = fetchUser(); =>

Re: Another take on decimal data types

2018-01-13 Thread kdevel via Digitalmars-d-announce
On Saturday, 13 January 2018 at 22:05:02 UTC, rumbu wrote: Now it prints: 1.00+0.84147098480789650669 +0.8414709848078965066525023216302990 +2.653e-18 My values differ slightly 1.00 0.841470984807896506664591 0.8414709848078965066525023.653e-18 But I would

Re: Tuple DIP

2018-01-13 Thread rjframe via Digitalmars-d
On Sat, 13 Jan 2018 22:10:39 +, rjframe wrote: > On Sat, 13 Jan 2018 21:57:31 +0100, Timon Gehr wrote: > >> On 13.01.2018 21:39, rjframe wrote: >>> Python and Pony use (). C++17 uses []. >> >> Any idea why C++17 went with [] ? > > I don't know; the paper[1] says it was due to "feedback

Re: Tuple DIP

2018-01-13 Thread Mark via Digitalmars-d
On Saturday, 13 January 2018 at 20:57:31 UTC, Timon Gehr wrote: On 13.01.2018 21:39, rjframe wrote: Python and Pony use (). C++17 uses []. Any idea why C++17 went with [] ? Perhaps D should use <>? [not a serious question] It was hard for me not to use angled brackets for templates when I

Re: Tuple DIP

2018-01-13 Thread rjframe via Digitalmars-d
On Sat, 13 Jan 2018 21:57:31 +0100, Timon Gehr wrote: > On 13.01.2018 21:39, rjframe wrote: >> Python and Pony use (). C++17 uses []. > > Any idea why C++17 went with [] ? I don't know; the paper[1] says it was due to "feedback from the EWG session in Jacksonville". > > It would actually be

Re: Another take on decimal data types

2018-01-13 Thread rumbu via Digitalmars-d-announce
On Saturday, 13 January 2018 at 20:40:20 UTC, kdevel wrote: On Saturday, 13 January 2018 at 19:28:40 UTC, rumbu wrote: On Saturday, 13 January 2018 at 18:37:10 UTC, kdevel wrote: I get large numerical dicrepancies and an exception: That's because you are mixing floating point and decimal.

Re: Bump the minimal version required to compile DMD to 2.076.1

2018-01-13 Thread Brad Roberts via Digitalmars-d
Typically support isn't dropped the instant the most recent version of the OS drops support but rather when the last supported OS release is no longer supported.  So, once 10.13 is no longer supported, then we can have the conversation about dropping 32 bit binary creation support. On

Re: Tuple DIP

2018-01-13 Thread Timon Gehr via Digitalmars-d
On 13.01.2018 21:49, Timon Gehr wrote: auto (name, email) = fetchUser();     vs auto {name, email} = fetchUser(); BTW: What do you think each of those do? I'd expect the following: --- auto (name, email) = fetchUser(); => auto __tmp = fetchUser(); auto name = __tmp[0], email = __tmp[1];

Re: Tuple DIP

2018-01-13 Thread Timon Gehr via Digitalmars-d
On 13.01.2018 21:39, rjframe wrote: Python and Pony use (). C++17 uses []. Any idea why C++17 went with [] ? Perhaps D should use <>? [not a serious question] It was hard for me not to use angled brackets for templates when I started with D, but now it's second nature. I think you're right,

Re: Tuple DIP

2018-01-13 Thread Timon Gehr via Digitalmars-d
On 13.01.2018 20:43, aberba wrote: When I raised this feature for D, suggestions on the use of () instead of {} got me concerned. All languages that I know to have this feature (known as destructuring) use curly braces. It seems that this is actually not the case. Anyway, I'd suggest having

Re: Another take on decimal data types

2018-01-13 Thread kdevel via Digitalmars-d-announce
On Saturday, 13 January 2018 at 19:28:40 UTC, rumbu wrote: On Saturday, 13 January 2018 at 18:37:10 UTC, kdevel wrote: I get large numerical dicrepancies and an exception: That's because you are mixing floating point and decimal. Just to take one example: double 1.1 cannot be represented

Re: Tuple DIP

2018-01-13 Thread rjframe via Digitalmars-d
On Sat, 13 Jan 2018 19:43:48 +, aberba wrote: > > When I raised this feature for D, suggestions on the use of () instead > of {} got me concerned. All languages that I know to have this feature > (known as destructuring) use curly braces. Thats what kotlin and > JavaScript (that I know have

mysql-native v1.2.1 (Was: mysql-native v1.2.0: Housekeeping: Deprecations, Cleanup and Doc Improvements)

2018-01-13 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 12/15/2017 04:45 AM, Jacob Carlborg wrote: On 2017-12-15 08:31, Nick Sabalausky (Abscissa) wrote: - The deperecated symbols have been removed (ie, the the outdated pre-v1.0.0 interfaces). If you have removed symbols that's a breaking API changes which should bump the right most digit in

Re: compile-time checked format strings

2018-01-13 Thread kdevel via Digitalmars-d-learn
On Saturday, 13 January 2018 at 19:40:09 UTC, Adam D. Ruppe wrote: For ints, it catches all that, but for float, it just bails out of the check as soon as it actually *succeeds* - because that kills CTFE. Confirmed. Thanks! args.d ``` import std.stdio; void main () { // writefln!"%2.2d

Re: compile-time checked format strings

2018-01-13 Thread Basile B. via Digitalmars-d-learn
On Saturday, 13 January 2018 at 19:40:09 UTC, Adam D. Ruppe wrote: On Saturday, 13 January 2018 at 19:15:49 UTC, kdevel wrote: dmd checks the types but does not count the arguments. so note that dmd doesn't actually do any checks here - it is all done in library code. The implementation is

Re: Tuple DIP

2018-01-13 Thread aberba via Digitalmars-d
On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md This DIP aims to make code like the following valid D: --- auto (a, b) = (1,

Re: compile-time checked format strings

2018-01-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 13 January 2018 at 19:15:49 UTC, kdevel wrote: dmd checks the types but does not count the arguments. so note that dmd doesn't actually do any checks here - it is all done in library code. The implementation is amusingly simple:

[Issue 15043] a temporary is needed when trying to set a delegate using __traits(getOverloads)

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15043 Basile B. changed: What|Removed |Added Summary|[e2ir] dmd still crashes|a temporary is needed when

[Issue 15043] [e2ir] dmd still crashes when trying to set a delegate from __traits(getOverloads)

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15043 Basile B. changed: What|Removed |Added Keywords|ice |diagnostic

Re: Another take on decimal data types

2018-01-13 Thread rumbu via Digitalmars-d-announce
On Saturday, 13 January 2018 at 18:37:10 UTC, kdevel wrote: I get large numerical dicrepancies and an exception: That's because you are mixing floating point and decimal. Just to take one example: double 1.1 cannot be represented exactly as floating point and it's in fact

[Issue 10444] writeln of a SIMD register

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10444 Issue 10444 depends on issue 17823, which changed state. Issue 17823 Summary: Declaration of a __vector leads to a segfault on OSX 32bits https://issues.dlang.org/show_bug.cgi?id=17823 What|Removed |Added

[Issue 17823] Declaration of a __vector leads to a segfault on OSX 32bits

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17823 Basile B. changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18209] std.uni.byGrapheme is not usable in CTFE

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18209 Basile B. changed: What|Removed |Added Severity|blocker |enhancement --

[Issue 18149] Add a compiler trait to detect if a function is @disable

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18149 Basile B. changed: What|Removed |Added Blocks||11747 Referenced Issues:

[Issue 18149] Add a compiler trait to detect if a function is @disable

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18149 Basile B. changed: What|Removed |Added Keywords||pull --- Comment #1 from

[Issue 11747] Better error message with @disabled toString

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11747 Basile B. changed: What|Removed |Added CC||b2.t...@gmx.com

compile-time checked format strings

2018-01-13 Thread kdevel via Digitalmars-d-learn
occasion: http://forum.dlang.org/thread/mutegviphsjwqzqfo...@forum.dlang.org?page=3#post-mailman.2136.1515709204.9493.digitalmars-d-announce:40puremagic.com dmd checks the types but does not count the arguments. ctcfs.d ``` import std.stdio; import std.math; void unit (T) () { auto pi = 4

Re: Another take on decimal data types

2018-01-13 Thread kdevel via Digitalmars-d-announce
On Saturday, 13 January 2018 at 17:46:15 UTC, rumbu wrote: The following code works: real r; for (r = 1; r < 6; r += .1L) { decimal128 d = r; auto dsin = sin (d); auto rsin = sin (r); auto delta = dsin - rsin; //delta is decimal128 writefln

Re: Tuple DIP

2018-01-13 Thread Timon Gehr via Digitalmars-d
On 13.01.2018 19:11, Timothee Cour wrote: https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md#proposal-6-placeholder-name-_ Symbols with the name _ should not be inserted into the symbol table. why not use `?` instead of `_` ? no breaking change and should be unambiguous with

Re: Tuple DIP

2018-01-13 Thread Timon Gehr via Digitalmars-d
On 13.01.2018 19:07, Timothee Cour wrote: https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md#proposal-4-unpacking-assignments ``` (a, b) = t; // shouldn't it be: auto (a, b) = t; ``` ? No, but there was a mistake in the code that explains the confusion. It should be: (int,

Re: Tuple DIP

2018-01-13 Thread Timothee Cour via Digitalmars-d
https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md#proposal-6-placeholder-name-_ > Symbols with the name _ should not be inserted into the symbol table. why not use `?` instead of `_` ? no breaking change and should be unambiguous with (expr ? expr : expr) syntax On Fri, Jan

Re: Tuple DIP

2018-01-13 Thread Timothee Cour via Digitalmars-d
https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md#proposal-4-unpacking-assignments ``` (a, b) = t; // shouldn't it be: auto (a, b) = t; ``` ? On Sat, Jan 13, 2018 at 9:52 AM, Mengu via Digitalmars-d wrote: > On Friday, 12 January 2018 at 22:44:48

Re: Using Postgres connection functions

2018-01-13 Thread Joe via Digitalmars-d-learn
On Saturday, 13 January 2018 at 10:10:41 UTC, Jacob Carlborg wrote: There's a native D library, ddb [1], for connecting to Postgres. Then you don't have to worry about null-terminated strings. There are several D libraries that I would consider "native": derelict-pq, dpq, dpq2 and ddb. The

Re: Tuple DIP

2018-01-13 Thread Mengu via Digitalmars-d
On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: [...] how do we vote for / support this DIP?

Re: Tuple DIP

2018-01-13 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md [1] https://forum.dlang.org/post/or625h$2hns$1...@digitalmars.com Awesome!!!

Proposed Phobos equivalent of wcswidth()

2018-01-13 Thread H. S. Teoh via Digitalmars-d
This past week, while reviewing Phobos PR #6008, I started experimenting with an optimized D equivalent of wcswidth(). For more details, see: https://issues.dlang.org/show_bug.cgi?id=7054 https://issues.dlang.org/show_bug.cgi?id=17810 as well as the discussion on:

Re: Another take on decimal data types

2018-01-13 Thread kdevel via Digitalmars-d-announce
On Saturday, 13 January 2018 at 14:43:53 UTC, rumbu wrote: I received a suggestion to reorganize the file structure because of some bug in dub (https://issues.dlang.org/show_bug.cgi?id=11847). The dub.json remained out of sync. I changed it, but I am not 100% sure that it's working. I am

Re: Another take on decimal data types

2018-01-13 Thread kdevel via Digitalmars-d-announce
On Saturday, 13 January 2018 at 14:43:53 UTC, rumbu wrote: On Saturday, 13 January 2018 at 13:56:20 UTC, kdevel wrote: Now my code does no longer compiles against the decimal package. This is my directory structure: I received a suggestion to reorganize the file structure because of some

[Issue 7054] format() aligns using code units instead of graphemes

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7054 --- Comment #17 from hst...@quickfur.ath.cx --- Related: issue #17810. --

Re: Another take on decimal data types

2018-01-13 Thread mark_mcs via Digitalmars-d-announce
On Saturday, 13 January 2018 at 14:43:53 UTC, rumbu wrote: Personally I hate dub because it's polluting my %APPDATA% folder and each time I connect my laptop to the company domain network, I must wait to sync zillions of files. Dub uses the roaming profile directory for its cache storage.

[Issue 18224] BigInt modulo uint must return long.

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18224 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/1115ccb219db8aa7f2288f75beead08068522d4d Fix issue 18224 - BigInt modulo uint must return long.

Re: Another take on decimal data types

2018-01-13 Thread rumbu via Digitalmars-d-announce
On Saturday, 13 January 2018 at 13:56:20 UTC, kdevel wrote: Now my code does no longer compiles against the decimal package. This is my directory structure: I received a suggestion to reorganize the file structure because of some bug in dub

[Issue 16017] package functions show up in std.experimental.allocator.common docs

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16017 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/639c07e9428df844bb21adb8007503aa1e33b9b2 Fix Issue 16017 - package functions show up in

[Issue 16017] package functions show up in std.experimental.allocator.common docs

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16017 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Compiler bug or incorrect usage for pointer of Struct?

2018-01-13 Thread H. S. Teoh via Digitalmars-d
On Sat, Jan 13, 2018 at 12:22:17PM +, Heromyth via Digitalmars-d wrote: [...] > auto writerFor(OutRange)(auto ref OutRange outRange) > { > auto res = Writer!(OutRange)(); > res.setSink(outRange); > return res; > } > > struct Writer(OutRange) > { > private OutRange* output; >

Re: Tuple DIP

2018-01-13 Thread Timon Gehr via Digitalmars-d
On 13.01.2018 03:08, jmh530 wrote: On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: [snip] I'm glad you're working on this. Proposal 1 is a little terse in explaining what you mean by unpacking

Re: Tuple DIP

2018-01-13 Thread Timon Gehr via Digitalmars-d
On 13.01.2018 12:43, Jacob Carlborg wrote: On 2018-01-12 23:44, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: Perhaps I don't have enough knowledge about the existing different types of tuples but Proposal 1 [1] says: "We add the

Re: Another take on decimal data types

2018-01-13 Thread kdevel via Digitalmars-d-announce
On Saturday, 13 January 2018 at 13:49:59 UTC, kdevel wrote: diff --git a/dub.json b/dub.json index c48899f..d8882c1 100644 --- a/dub.json +++ b/dub.json @@ -10,16 +10,16 @@ "configurations": [ { "name": "library", -"excludedSourceFiles": [

[Issue 17810] Add wcwidth/wcswidth equivalents to std.uni

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17810 --- Comment #4 from hst...@quickfur.ath.cx --- We don't need to rely on the local OS implementation of this function; std.uni has enough tools to provide a native implementation. Also, this is independent of Posix, even though wcwidth/wcswidth are

Re: Compiler bug or incorrect usage for pointer of Struct?

2018-01-13 Thread Temtaime via Digitalmars-d
On Saturday, 13 January 2018 at 12:22:17 UTC, Heromyth wrote: When executing the test code, it will exit abnormally. It seems *this.output* is pointing a free memory when executing *writer.write(dom)*. I'm not sure whether there is a bug in the compiler. If it is, I can file a bug. If not,

[Issue 17810] Add wcwidth/wcswidth equivalents to std.uni

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17810 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --

Re: Another take on decimal data types

2018-01-13 Thread kdevel via Digitalmars-d-announce
On Saturday, 13 January 2018 at 13:44:20 UTC, kdevel wrote: $ dub Performing "debug" build using dmd for x86_64. decimal ~master: building configuration "library"... src/test/test.d(4,5): Error: only one main allowed. Previously found main at src/benchmark/benchmark.d(143,5) dmd failed with

[Issue 7054] format() aligns using code units instead of graphemes

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7054 hst...@quickfur.ath.cx changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED

Re: Another take on decimal data types

2018-01-13 Thread kdevel via Digitalmars-d-announce
On Saturday, 13 January 2018 at 01:30:12 UTC, rumbu wrote: On Friday, 12 January 2018 at 13:09:42 UTC, kdevel wrote: $ dmd nosine.d decimal.git/libdecimal.a decimal/package.d(10505): Error: undefined identifier decimalCapAngle Sorry, broke some code when I made the split. Now it's working.

Re: Tuple DIP

2018-01-13 Thread Nordlöw via Digitalmars-d
On Saturday, 13 January 2018 at 00:37:48 UTC, Chris M. wrote: On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: [...] Yes please Very much agree.

Compiler bug or incorrect usage for pointer of Struct?

2018-01-13 Thread Heromyth via Digitalmars-d
When executing the test code, it will exit abnormally. It seems *this.output* is pointing a free memory when executing *writer.write(dom)*. I'm not sure whether there is a bug in the compiler. If it is, I can file a bug. If not, somebody can tell me how to fix this. Thanks! Here is my test

Re: [howto] Serve ddox documentation on github.io deployed by Travis CI

2018-01-13 Thread Bastiaan Veelo via Digitalmars-d-announce
On Saturday, 13 January 2018 at 10:02:18 UTC, Jacob Carlborg wrote: On 2018-01-13 05:59, Martin Nowak wrote: On Wednesday, 10 January 2018 at 08:50:37 UTC, Bastiaan Veelo wrote: Maybe worthwile to add this scaffolding to dub or some other tool? Anyone volunteering? This could be a good idea.

Re: Tuple DIP

2018-01-13 Thread Jacob Carlborg via Digitalmars-d
On 2018-01-12 23:44, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: Perhaps I don't have enough knowledge about the existing different types of tuples but Proposal 1 [1] says: "We add the following syntactic sugar to unpack AliasSeq's"

Re: Proposal for a standard Decimal type in alpha

2018-01-13 Thread rumbu via Digitalmars-d-announce
On Friday, 12 January 2018 at 15:44:01 UTC, Jack Stouffer wrote: On Thursday, 21 December 2017 at 13:59:28 UTC, Jack Stouffer wrote: ... While I believe my library has certain API advantages, I'm really not interested in duplicating a bunch of work when rumbu's version is pretty much

Re: Asio Bindings?

2018-01-13 Thread DanielG via Digitalmars-d-learn
I'm a little late (1.5 years) to the ASIO discussion party, but I recently wrote something for myself that may be useful to others: https://github.com/dewf/DASIOClient I haven't published to DUB yet because 1) it's a pretty naive implementation and 2) I'm still very new to D, and 3) there's a

Re: Tuple DIP

2018-01-13 Thread Mark via Digitalmars-d
On Saturday, 13 January 2018 at 00:51:51 UTC, Timon Gehr wrote: On 13.01.2018 01:20, Mark wrote: int (x,y) = f(1, 2); // x=3, y=-1 int (w,z) = (1, 2).f() // same as above, UFCS int (u,v) = (1, 2).(sum, diff) // same as above, "lambda tuple" In the last example, (sum, diff) is basically lowered

Re: Is Nullable supposed to provide Optional semantics?

2018-01-13 Thread Chris Paulson-Ellis via Digitalmars-d-learn
On Saturday, 30 December 2017 at 19:11:05 UTC, Steven Schveighoffer wrote: Please file a bug report. Sorry for the delay - stuff happened. I reopened an existing bug that I found: https://issues.dlang.org/show_bug.cgi?id=17440

[Issue 17440] Nullable.nullify() resets referenced object

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17440 Chris Paulson-Ellis changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: Bump the minimal version required to compile DMD to 2.076.1

2018-01-13 Thread Jacob Carlborg via Digitalmars-d
On 2018-01-12 19:45, Joakim wrote: For now, I think you have no choice but to simply work around whatever that bug is.  We should drop support for 32-bit OS X sometime soon, and if that fixes the issue, you have no problem. Exactly. Apple will drop support for running 32bit applications in

Re: Using Postgres connection functions

2018-01-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-01-13 05:17, Joe wrote: I'm trying to learn how to use D to connect (and send queries) to Postgres, i.e., libpq in C. So my question is: is there an easier or better way of passing two arrays of C null-terminated strings to an extern(C) function? There's a native D library, ddb [1],

Re: [howto] Serve ddox documentation on github.io deployed by Travis CI

2018-01-13 Thread Jacob Carlborg via Digitalmars-d-announce
On 2018-01-13 05:59, Martin Nowak wrote: On Wednesday, 10 January 2018 at 08:50:37 UTC, Bastiaan Veelo wrote: Maybe worthwile to add this scaffolding to dub or some other tool? Anyone volunteering? This could be a good idea. Probably even better is to let code.dlang.org take care of it,

[Issue 18234] New: [REG 2.075] Case of link failure when a program is compiled against a static lib

2018-01-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18234 Issue ID: 18234 Summary: [REG 2.075] Case of link failure when a program is compiled against a static lib Product: D Version: D2 Hardware: x86_64 OS: Linux

  1   2   >