Re: Dub generates a library file that is larger in size than the one built on command line.

2017-12-16 Thread Venkat via Digitalmars-d-learn
TY Mike, that explains it. Thanks Ivan.

Lazily parse a JSON text file using stdx.data.json?

2017-12-16 Thread David Gileadi via Digitalmars-d
I'm a longtime fan of dlang, but haven't had a chance to do much in-depth dlang programming, and especially not range programming. Today I thought I'd use stdx.data.json to read from a text file. Since it's a somewhat large file, I thought I'd create a text range from the file and parse it

Re: Dub generates a library file that is larger in size than the one built on command line.

2017-12-16 Thread Ivan Trombley via Digitalmars-d-learn
On Sunday, 17 December 2017 at 02:42:44 UTC, Venkat wrote: dub build --vverbose That is the command I used. Would it be right to assume that -g is being added because --vverbose ? The reason I ask is the file size is about the same when I run the below command. dub build You need to add

Re: Dub generates a library file that is larger in size than the one built on command line.

2017-12-16 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 17 December 2017 at 02:42:44 UTC, Venkat wrote: dub build --vverbose That is the command I used. Would it be right to assume that -g is being added because --vverbose ? The reason I ask is the file size is about the same when I run the below command. dub build It's because

[Issue 18092] Can't combine take and takeExactly

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18092 Seb changed: What|Removed |Added Summary|takeExactly cannot deduce |Can't combine take and

[Issue 18092] takeExactly cannot deduce function from generic forward range

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18092 --- Comment #1 from Seb --- Sorry just for posterity, the code sample should be: ``` import std.algorithm.comparison : equal; import std.internal.test.dummyrange; alias Range = DummyRange!(ReturnBy.Reference, Length.No,

[Issue 18092] New: takeExactly cannot deduce function from generic forward range

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18092 Issue ID: 18092 Summary: takeExactly cannot deduce function from generic forward range Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

[Issue 18092] takeExactly cannot deduce function from generic forward range

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18092 Seb changed: What|Removed |Added Assignee|nob...@puremagic.com|greensunn...@gmail.com --

Re: Dub generates a library file that is larger in size than the one built on command line.

2017-12-16 Thread Venkat via Digitalmars-d-learn
dub build --vverbose That is the command I used. Would it be right to assume that -g is being added because --vverbose ? The reason I ask is the file size is about the same when I run the below command. dub build

Re: Dub generates a library file that is larger in size than the one built on command line.

2017-12-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, December 17, 2017 02:08:00 Venkat via Digitalmars-d-learn wrote: > The following is the command output by dub with --vverbose > switch. It generates a file which is 6094400 bytes in size > > dmd -lib > -of.dub/build/library-debug-linux.posix-x86_64-dmd_2077-7BB682AB55F152616E >

OT: s/crush/crash/g

2017-12-16 Thread Ali Çehreli via Digitalmars-d-learn
On 12/16/2017 12:51 PM, kerdemdemir wrote: > I am getting a crush while calling requestHTTP > function : That sounds like "having a crush", which happens to me too but I think you meant "crash". :o) Ali

Dub generates a library file that is larger in size than the one built on command line.

2017-12-16 Thread Venkat via Digitalmars-d-learn
The following is the command output by dub with --vverbose switch. It generates a file which is 6094400 bytes in size dmd -lib -of.dub/build/library-debug-linux.posix-x86_64-dmd_2077-7BB682AB55F152616E128DD715E887DF/libdjni.a -debug -g -w -version=Have_djni -Isource/ source/app.d

Re: `Socket.receive` providing arbitrary packet sizes and hanging without sending EOF

2017-12-16 Thread Ali Çehreli via Digitalmars-d-learn
On 12/16/2017 05:21 PM, Unazed Spectaculum wrote: > 1) Starting program > unazed@unazed  /home/d/storage-server  dmd -debug -run app.d Although I don't normally use the -run switch, as expected, it works with -run as well. (More below.) > Listening: 0.0.0.0:6969 > > 2) telnet to the server

Re: Suggesting DUB Registry Enhancements

2017-12-16 Thread WebFreak001 via Digitalmars-d
The following features are implemented now: On Saturday, 16 December 2017 at 12:23:49 UTC, WebFreak001 wrote: * configurable icon for a project * show version & relative release date in sidebar * optional donation button for people who linked their github who can setup a custom link like

Dub generate import files

2017-12-16 Thread Venkat via Digitalmars-d-learn
dmd has the -H and -Hd switches. Does dub have any setting to make it generate D interface files ?

Re: `Socket.receive` providing arbitrary packet sizes and hanging without sending EOF

2017-12-16 Thread Unazed Spectaculum via Digitalmars-d-learn
On Thursday, 14 December 2017 at 20:27:36 UTC, Ali Çehreli wrote: On 12/14/2017 11:55 AM, Unazed Spectaculum wrote: This is the only function which has a call to `receiveAll` I marked my changes with [Ali]: import std.stdio; import std.socket; import std.conv; import std.json; ubyte[]

Re: Dynamic Array reserve

2017-12-16 Thread Ali Çehreli via Digitalmars-d-learn
On 12/16/2017 03:58 PM, Steven Schveighoffer wrote: I think you are fine to just use Array and not worry about the reallocations, they are handled automatically. -Steve I was going to suggest the same to Vino and I was writing the following program to demonstrate how low the number of

Re: Scope failure is not preventing application crush in case of uncaught exceptions

2017-12-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, December 17, 2017 00:10:27 Anonymouse via Digitalmars-d-learn wrote: > On Saturday, 16 December 2017 at 21:56:49 UTC, Jonathan M Davis > > wrote: > > The only way to catch an exception is with a catch block, and > > if you do > > If you return inside a scopeguard though, the exception

Re: Scope failure is not preventing application crush in case of uncaught exceptions

2017-12-16 Thread Anonymouse via Digitalmars-d-learn
On Saturday, 16 December 2017 at 21:56:49 UTC, Jonathan M Davis wrote: The only way to catch an exception is with a catch block, and if you do If you return inside a scopeguard though, the exception (or error!) is swallowed. https://run.dlang.io/is/GEtQ6D void main() { foo();

Re: Dynamic Array reserve

2017-12-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/16/17 5:48 PM, Vino wrote: On Saturday, 16 December 2017 at 16:46:49 UTC, Jacob Carlborg wrote: On 2017-12-16 15:11, Vino wrote: Hi All,   Request your help on reserve an dynamic array when the capacity is reached to a point(eg: 80%) so the array to extend the reserve by next 20%

Re: Dynamic Array reserve

2017-12-16 Thread Vino via Digitalmars-d-learn
On Saturday, 16 December 2017 at 16:46:49 UTC, Jacob Carlborg wrote: On 2017-12-16 15:11, Vino wrote: Hi All,  Request your help on reserve an dynamic array when the capacity is reached to a point(eg: 80%) so the array to extend the reserve by next 20% Example: Array!string Test; Test.

Re: Does D have class' attributes like C#'s?

2017-12-16 Thread Basile B. via Digitalmars-d-learn
On Saturday, 16 December 2017 at 21:11:43 UTC, Marc wrote: On Saturday, 16 December 2017 at 20:05:15 UTC, Anonymouse wrote: On Saturday, 16 December 2017 at 19:57:30 UTC, Marc wrote: C# has a quite nice way to store metadata about a property by a feature called atributes[1]. For example, I can

Re: Scope failure is not preventing application crush in case of uncaught exceptions

2017-12-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, December 16, 2017 21:22:47 kerdemdemir via Digitalmars-d-learn wrote: > On Saturday, 16 December 2017 at 20:56:26 UTC, ketmar wrote: > > kerdemdemir wrote: > >> As far as I know scope(failure) should be collecting all > >> failure cases. > > > > nope. `failure` scope won't stop

[Issue 18089] AArch64: Need Quadruple float support in CTFE hashOf / core.internal.convert.parse

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18089 Steven Schveighoffer changed: What|Removed |Added CC|schvei...@yahoo.com | --- Comment #1

Re: Does D have class' attributes like C#'s?

2017-12-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, December 16, 2017 21:11:43 Marc via Digitalmars-d-learn wrote: > On Saturday, 16 December 2017 at 20:05:15 UTC, Anonymouse wrote: > > On Saturday, 16 December 2017 at 19:57:30 UTC, Marc wrote: > >> C# has a quite nice way to store metadata about a property by > >> a feature called

[Issue 18091] New: "Error instantiating" cumulativeFold when passing a function inside another function

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18091 Issue ID: 18091 Summary: "Error instantiating" cumulativeFold when passing a function inside another function Product: D Version: D2 Hardware: x86_64 OS: Linux

Dlang support added to fx

2017-12-16 Thread Andre Pany via Digitalmars-d-announce
Hi, initial D support for fx (Functions as a service based on Docker) was merged today. https://github.com/metrue/fx Kind regards André

Re: Scope failure is not preventing application crush in case of uncaught exceptions

2017-12-16 Thread ketmar via Digitalmars-d-learn
kerdemdemir wrote: On Saturday, 16 December 2017 at 20:56:26 UTC, ketmar wrote: kerdemdemir wrote: As far as I know scope(failure) should be collecting all failure cases. nope. `failure` scope won't stop exception propagation, it is just called before exception leaves your function, to

Re: Scope failure is not preventing application crush in case of uncaught exceptions

2017-12-16 Thread kerdemdemir via Digitalmars-d-learn
On Saturday, 16 December 2017 at 20:56:26 UTC, ketmar wrote: kerdemdemir wrote: As far as I know scope(failure) should be collecting all failure cases. nope. `failure` scope won't stop exception propagation, it is just called before exception leaves your function, to give you a last chance

Re: Does D have class' attributes like C#'s?

2017-12-16 Thread Marc via Digitalmars-d-learn
On Saturday, 16 December 2017 at 20:05:15 UTC, Anonymouse wrote: On Saturday, 16 December 2017 at 19:57:30 UTC, Marc wrote: C# has a quite nice way to store metadata about a property by a feature called atributes[1]. For example, I can write something like this: class A { [TextSize(256)]

Re: Scope failure is not preventing application crush in case of uncaught exceptions

2017-12-16 Thread ketmar via Digitalmars-d-learn
kerdemdemir wrote: As far as I know scope(failure) should be collecting all failure cases. nope. `failure` scope won't stop exception propagation, it is just called before exception leaves your function, to give you a last chance to do some immediate cleanup.

Scope failure is not preventing application crush in case of uncaught exceptions

2017-12-16 Thread kerdemdemir via Digitalmars-d-learn
While calling this function : bool PublicMarketCall( ref Json result ) { string fullUrl = "https://bittrex.com/api/v1.1/public/getmarketsummaries;; Json data; try { requestHTTP(fullUrl, (scope req) { req.method = HTTPMethod.GET;

[Issue 18090] missleading Error-Message when assigning pointers in @safe struct

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18090 Ketmar Dark changed: What|Removed |Added CC|

[Issue 18090] New: missleading Error-Message when assigning pointers in @safe struct

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18090 Issue ID: 18090 Summary: missleading Error-Message when assigning pointers in @safe struct Product: D Version: D2 Hardware: x86_64 OS: Linux Status:

[Issue 18088] wrong lifetime evaluation of pointers or this-pointers in a struct with @safe

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18088 Johannes Nordhoff changed: What|Removed |Added Status|NEW |RESOLVED

Re: Does D have class' attributes like C#'s?

2017-12-16 Thread Anonymouse via Digitalmars-d-learn
On Saturday, 16 December 2017 at 19:57:30 UTC, Marc wrote: C# has a quite nice way to store metadata about a property by a feature called atributes[1]. For example, I can write something like this: class A { [TextSize(256)] string Name { get; set; } } So using runtime/reflection I

Does D have class' attributes like C#'s?

2017-12-16 Thread Marc via Digitalmars-d-learn
C# has a quite nice way to store metadata about a property by a feature called atributes[1]. For example, I can write something like this: class A { [TextSize(256)] string Name { get; set; } } So using runtime/reflection I can retrieve the TextSize value associated to A.name

Re: Adding Markdown to Ddoc

2017-12-16 Thread Ecstatic Coder via Digitalmars-d
On Wednesday, 6 December 2017 at 09:33:47 UTC, Sönke Ludwig wrote: Am 06.12.2017 um 05:11 schrieb Walter Bright: https://help.github.com/articles/basic-writing-and-formatting-syntax/ Anyone interested in picking up the flag? (I know this has come up before, and I've been opposed to it, but

[Issue 18088] wrong lifetime evaluation of pointers or this-pointers in a struct with @safe

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18088 --- Comment #5 from Ketmar Dark --- still, error message should be better, 'cause it explains nothing now. ;-) would you, please, fix bug title? or, maybe, close this bug and open a new one, i don't know what will be better.

Re: Silicon Valley D Meetup - December 14, 2017 - "Experimenting with Link Time Optimization" by Jon Degenhardt

2017-12-16 Thread Jon Degenhardt via Digitalmars-d-announce
On Saturday, 16 December 2017 at 11:52:37 UTC, Johan Engelen wrote: On Friday, 15 December 2017 at 03:08:35 UTC, Ali Çehreli wrote: This should be live now: http://youtu.be/e05QvoKy_8k Great! I've added some comments there, pasted here: Fantastic feedback! Fills in some really important

[Issue 18088] wrong lifetime evaluation of pointers or this-pointers in a struct with @safe

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18088 --- Comment #4 from Johannes Nordhoff --- okay, I was misleaded. My actual ambition was to point to functions of structs (since I believe they are static). So, it is another issue --

[Issue 18088] wrong lifetime evaluation of pointers or this-pointers in a struct with @safe

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18088 --- Comment #3 from Ketmar Dark --- still the same thing: delegate holds the hidden pointer to `this` (aka pointer to struct), and struct can be moved. --

[Issue 18089] AArch64: Need Quadruple float support in CTFE hashOf / core.internal.convert.parse

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18089 Johannes Pfau changed: What|Removed |Added CC|

[Issue 18089] AArch64: Need Quadruple float support in CTFE hashOf / core.internal.convert.parse

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18089 Johannes Pfau changed: What|Removed |Added CC||c...@dawg.eu,

Re: Suggesting DUB Registry Enhancements

2017-12-16 Thread Dmitry Olshansky via Digitalmars-d
On Saturday, 16 December 2017 at 12:23:49 UTC, WebFreak001 wrote: after reading some of the GSoC thread I wanted to do some minor additions on the dub registry and now came up with a whole list of additions and a design update for the package page [1] [snip] [1] https://wfr.moe/fQwTAa.png -

Re: Suggesting DUB Registry Enhancements

2017-12-16 Thread Neia Neutuladh via Digitalmars-d
On Saturday, 16 December 2017 at 12:23:49 UTC, WebFreak001 wrote: [1] https://wfr.moe/fQwTAa.png - how my proposed design for the package page looks like for one package (dplug in this example) Sorry, I think I got some slobber on your mockup. It's awesome.

[Issue 18089] New: AArch64: Need Quadruple float support in CTFE hashOf / core.internal.convert.parse

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18089 Issue ID: 18089 Summary: AArch64: Need Quadruple float support in CTFE hashOf / core.internal.convert.parse Product: D Version: D2 Hardware: Other OS: Linux

[Issue 18088] wrong lifetime evaluation of pointers or this-pointers in a struct with @safe

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18088 --- Comment #2 from Johannes Nordhoff --- I gave a bad example. file: app2.d ~ void main() { A a = A( true); } @safe struct A { bool delegate() lala; this( bool i) { lala =

[Issue 18088] wrong lifetime evaluation of pointers or this-pointers in a struct with @safe

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18088 Ketmar Dark changed: What|Removed |Added CC|

[Issue 18087] "no property 'value' for type 'void'" when properties split among mixins

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18087 --- Comment #1 from Jonathan Wilbur --- Sorry, I just remembered to provide version info: uname -a Darwin 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64 dmd

[Issue 18087] "no property 'value' for type 'void'" when properties split among mixins

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18087 Ketmar Dark changed: What|Removed |Added CC|

[Issue 6777] alias this disables casting for classes

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6777 alexandru.ermic...@gmail.com changed: What|Removed |Added CC||alexandru.ermic...@gmail.co

Re: get only user-defined members

2017-12-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, December 16, 2017 15:28:46 Marc via Digitalmars-d-learn wrote: > On Saturday, 16 December 2017 at 07:23:38 UTC, Jonathan M Davis > > wrote: > > On Saturday, December 16, 2017 04:01:10 Marc via > > > > Digitalmars-d-learn wrote: > >> how do I from class: > >> > class Person { > >> > >

[Issue 18088] New: wrong lifetime evaluation of pointers or this-pointers in a struct with @safe

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18088 Issue ID: 18088 Summary: wrong lifetime evaluation of pointers or this-pointers in a struct with @safe Product: D Version: D2 Hardware: x86_64 OS: Linux

[Issue 18087] New: "no property 'value' for type 'void'" when properties split among mixins

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18087 Issue ID: 18087 Summary: "no property 'value' for type 'void'" when properties split among mixins Product: D Version: D2 Hardware: x86 OS: Mac OS X

Re: Dynamic Array reserve

2017-12-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-12-16 15:11, Vino wrote: Hi All,  Request your help on reserve an dynamic array when the capacity is reached to a point(eg: 80%) so the array to extend the reserve by next 20% Example: Array!string Test; Test. reserve(100) - Initall Test =(.) - The number of entries are

[Issue 16662] Can't call std.variant.visit from a pure function

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16662 --- Comment #2 from Илья Ярошенко --- Variant's "get" method is not pure too. It was a big surprise. No I need to figure out how to deal with it, the whole big project is pure. --

[Issue 16662] Can't call std.variant.visit from a pure function

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16662 Илья Ярошенко changed: What|Removed |Added CC|

Re: how do I read a class member's value using traits?

2017-12-16 Thread Marc via Digitalmars-d-learn
On Saturday, 16 December 2017 at 03:48:01 UTC, Jonathan M Davis wrote: On Saturday, December 16, 2017 03:34:43 Marc via Digitalmars-d-learn wrote: I need to give a class C, read all user-defined members of it, both name and value dynamically. for example: > [...] then >[...] I get this

Re: get only user-defined members

2017-12-16 Thread Marc via Digitalmars-d-learn
On Saturday, 16 December 2017 at 07:23:38 UTC, Jonathan M Davis wrote: On Saturday, December 16, 2017 04:01:10 Marc via Digitalmars-d-learn wrote: how do I from class: > class Person { > > string name; > int age; > > } do: > auto c = [__traits(allMembers, Person)]; then return only ["name",

[Issue 9631] Error message not using fully qualified name when appropriate.

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9631 --- Comment #15 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/cf01f6829411208a57613d6cbd5feae7c3cc3771 Issue 9631 - Error message not using fully qualified name

[Issue 17375] colliding modules detected with binutils 2.28 linker and shared libraries

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17375 greenify changed: What|Removed |Added CC||greeen...@gmail.com ---

[Issue 18084] [REG2.072] tempCString buffer size is unittest-versioned

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18084 --- Comment #5 from Steven Schveighoffer --- This is somewhat how the original worked. I have a feeling the compiler was having difficulty proving the return wasn't a piece of the object itself, which is why the latter PR was

[Issue 17375] colliding modules detected with binutils 2.28 linker and shared libraries

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17375 --- Comment #14 from Marco Leise --- If that detection has been removed, does this mean we can revert to compiling without -fPIC again? It's slows down code on x86. I put it in dmd.conf for Gentoo by default, because shared

[Issue 17188] `core.stdc.stdlib.qsort()` is broken

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17188 ZombineDev changed: What|Removed |Added Status|RESOLVED|REOPENED

[Issue 17065] [REG2.072] Unique does not work with private members

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17065 ZombineDev changed: What|Removed |Added CC|

Re: Array Template

2017-12-16 Thread Vino via Digitalmars-d-learn
On Saturday, 16 December 2017 at 06:42:53 UTC, codephantom wrote: On Friday, 15 December 2017 at 17:21:55 UTC, Vino wrote: Hi All, Request your help, Is it possible to an template array something similar as below so that we can insert any type of value(string, int etc). If possible can you

Dynamic Array reserve

2017-12-16 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on reserve an dynamic array when the capacity is reached to a point(eg: 80%) so the array to extend the reserve by next 20% Example: Array!string Test; Test. reserve(100) - Initall Test =(.) - The number of entries are dynamic if (array.capacity > 80%) {

Re: weird exception on windows

2017-12-16 Thread Vino via Digitalmars-d-learn
On Saturday, 16 December 2017 at 13:59:11 UTC, Vino wrote: On Saturday, 16 December 2017 at 12:39:53 UTC, Kagamin wrote: On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote: On 12/15/17 10:08 AM, Kagamin wrote: Maybe this https://issues.dlang.org/show_bug.cgi?id=18084

Re: weird exception on windows

2017-12-16 Thread Vino via Digitalmars-d-learn
On Saturday, 16 December 2017 at 12:39:53 UTC, Kagamin wrote: On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote: On 12/15/17 10:08 AM, Kagamin wrote: Maybe this https://issues.dlang.org/show_bug.cgi?id=18084 Thanks for looking into this. I created a PR to fix. Szabo,

Defining an Array

2017-12-16 Thread Vino via Digitalmars-d-learn
Hi All, Request your help for the below as how do i add an item to a array in the array is defined as Type 2. Type 1: Working import std.conatiner.array; void main () { auto PStore = Array!(string)("Test1", "Test1") } Type 2: not working import std.conatiner.array; void main () {

[Issue 17188] `core.stdc.stdlib.qsort()` is broken

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17188 --- Comment #5 from Rainer Schuetze --- My suggestion with two overloads would not need a deprecation, but allow both scope and non-scope versions. --

[Issue 18084] [REG2.072] tempCString buffer size is unittest-versioned

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18084 --- Comment #4 from anonymous4 --- A variant of code: --- //field size doesn't depend on unittest version (to avoid corruption) //use `_buff` property to access the buffer To[256 / To.sizeof] _buffer; // the 'small string

[Issue 18084] [REG2.072] tempCString buffer size is unittest-versioned

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18084 anonymous4 changed: What|Removed |Added Summary|tempCString buffer size is |[REG2.072]

Re: weird exception on windows

2017-12-16 Thread Kagamin via Digitalmars-d-learn
On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote: On 12/15/17 10:08 AM, Kagamin wrote: Maybe this https://issues.dlang.org/show_bug.cgi?id=18084 Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your

Re: Pass D const pointer to opaque C library: Guarantees? Optimization-safe?

2017-12-16 Thread SimonN via Digitalmars-d-learn
On Saturday, 16 December 2017 at 11:19:36 UTC, Mike Parker wrote: that's a binding, not a wrapper. Right! Not sure what you mean by "safe" you only want to prevent changes on the D side and don't care if they happen on the C side, then that's fine. This, yes. I'd like const-annotated D

Suggesting DUB Registry Enhancements

2017-12-16 Thread WebFreak001 via Digitalmars-d
after reading some of the GSoC thread I wanted to do some minor additions on the dub registry and now came up with a whole list of additions and a design update for the package page [1] * there should be a userpage with all registered packages, that's why the author is now clickable *

Re: Alias!T

2017-12-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/16/17 6:45 AM, bauss wrote: In what scenario would you use Alias!T from std.meta? I understand what it does and how it can be used, but I can't seem to think of a reasonable situation where it's desirable.

Re: weird exception on windows

2017-12-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/16/17 5:12 AM, bauss wrote: On Saturday, 16 December 2017 at 08:07:30 UTC, Szabo Bogdan wrote: On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote: On 12/15/17 10:08 AM, Kagamin wrote: Maybe this https://issues.dlang.org/show_bug.cgi?id=18084 Thanks for looking

Re: Silicon Valley D Meetup - December 14, 2017 - "Experimenting with Link Time Optimization" by Jon Degenhardt

2017-12-16 Thread Johan Engelen via Digitalmars-d-announce
On 11/21/2017 11:58 AM, Ali Çehreli wrote: Meetup page: https://www.meetup.com/D-Lang-Silicon-Valley/events/245288287/ LDC[1], the LLVM-based D compiler, has been adding Link Time Optimization capabilities over the last several releases. [...] This talk will look at the results of applying

Alias!T

2017-12-16 Thread bauss via Digitalmars-d-learn
In what scenario would you use Alias!T from std.meta? I understand what it does and how it can be used, but I can't seem to think of a reasonable situation where it's desirable.

Re: Pass D const pointer to opaque C library: Guarantees? Optimization-safe?

2017-12-16 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 16 December 2017 at 11:19:36 UTC, Mike Parker wrote: I would expect SiegeLord to reject such a PR. And now that I clicked through the link, I see I was wrong :-) In principle, I disagree with him because of what I mentioned above about immutable variables. In practice, it's

Re: Pass D const pointer to opaque C library: Guarantees? Optimization-safe?

2017-12-16 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 16 December 2017 at 08:56:59 UTC, SimonN wrote: Hi, I'm calling a C library through a D wrapper. The situation is like this: C library has: struct A { ... }; A* create_a() { ... } void foo(A*) { ... } D wrapper declares: extern (C) { struct A {}

[Issue 17065] [REG2.072] Unique does not work with private members

2017-12-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17065 --- Comment #7 from dran...@gmail.com --- std.experimental.typecons.Final is also affected, since its implementation uses Proxy the same way. I should probably change the title for a more general one. --

Re: run.dlang.io - a modern way to run D code

2017-12-16 Thread Iain Buclaw via Digitalmars-d-announce
On 16 December 2017 at 11:01, Walter Bright via Digitalmars-d-announce wrote: > On 12/15/2017 4:10 AM, Radu wrote: >> >> You can use this one for nice assembly outputs https://d.godbolt.org/ > > > That is indeed nice and very useful. It should do dmd, too!

Re: weird exception on windows

2017-12-16 Thread bauss via Digitalmars-d-learn
On Saturday, 16 December 2017 at 08:07:30 UTC, Szabo Bogdan wrote: On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote: On 12/15/17 10:08 AM, Kagamin wrote: Maybe this https://issues.dlang.org/show_bug.cgi?id=18084 Thanks for looking into this. I created a PR to fix.

Re: run.dlang.io - a modern way to run D code

2017-12-16 Thread Walter Bright via Digitalmars-d-announce
On 12/15/2017 4:10 AM, Radu wrote: You can use this one for nice assembly outputs https://d.godbolt.org/ That is indeed nice and very useful. It should do dmd, too!

Re: mysql-native v1.2.0: Housekeeping: Deprecations, Cleanup and Doc Improvements

2017-12-16 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-12-16 06:37, Nick Sabalausky (Abscissa) wrote: Oh, I'd thought it was the middle one for that. Right-most for non-breaking changes, Middle for all breaking changes, and Left-most for major changes. Guess I remembered it wrong :/ My mistake, the left most for breaking changes,

Re: Global variable type does not match previous declaration

2017-12-16 Thread Satoshi via Digitalmars-d-learn
On Saturday, 16 December 2017 at 09:04:05 UTC, Satoshi wrote: I commented out the TypeInfo declarations and got the same error but on different symbol. object.d(1569): Error: Function type does not match previously declared function with the same mangled name: _d_dynamic_cast

Re: Global variable type does not match previous declaration

2017-12-16 Thread Satoshi via Digitalmars-d-learn
I commented out the TypeInfo declarations and got the same error but on different symbol. object.d(1569): Error: Function type does not match previously declared function with the same mangled name: _d_dynamic_cast https://github.com/Rikarin/Trinix/blob/master/Kernel/object.d#L1569

Pass D const pointer to opaque C library: Guarantees? Optimization-safe?

2017-12-16 Thread SimonN via Digitalmars-d-learn
Hi, I'm calling a C library through a D wrapper. The situation is like this: C library has: struct A { ... }; A* create_a() { ... } void foo(A*) { ... } D wrapper declares: extern (C) { struct A {} A* create_a(); void foo(A*); } My D

Re: weird exception on windows

2017-12-16 Thread Szabo Bogdan via Digitalmars-d-learn
On Friday, 15 December 2017 at 13:56:41 UTC, Kagamin wrote: You said tests fail? class SourceResult { private const { string file; size_t line; } this(string fileName = __FILE__, size_t line = __LINE__, size_t range = 6) nothrow

Re: weird exception on windows

2017-12-16 Thread Szabo Bogdan via Digitalmars-d-learn
On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote: On 12/15/17 10:08 AM, Kagamin wrote: Maybe this https://issues.dlang.org/show_bug.cgi?id=18084 Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your