When is copy assignment @safe to use when the left-hand-side is an undefined l-value?

2018-03-16 Thread Nordlöw via Digitalmars-d-learn
Given an uninitialized (undefined content from, for instance, malloc) value `x` of type `T`, when is it @safe to initalize `x` with a simple assignment such as x = y in contrast to emplace(, y); ? My current guess is when hasElaborateCopyConstructor!T is `false`. Is this

Re: CTFE and -betterC

2018-03-16 Thread Xavier Bigand via Digitalmars-d-learn
Le 16/03/2018 à 22:58, Xavier Bigand a écrit : Le 15/03/2018 à 01:09, Flamaros a écrit : On Wednesday, 14 March 2018 at 01:17:54 UTC, rikki cattermole wrote: You will still need DllMain, that is a platform requirement. I am not sure about that because when DllAnalyser don't see it in the

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread visitor via Digitalmars-d-learn
On Friday, 16 March 2018 at 20:19:59 UTC, aberba wrote: On Friday, 16 March 2018 at 17:11:17 UTC, visitor wrote: On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can

Re: CTFE and -betterC

2018-03-16 Thread Xavier Bigand via Digitalmars-d-learn
Le 15/03/2018 à 01:09, Flamaros a écrit : On Wednesday, 14 March 2018 at 01:17:54 UTC, rikki cattermole wrote: You will still need DllMain, that is a platform requirement. I am not sure about that because when DllAnalyser don't see it in the opengl32.dll from the system32 directory. And the

Re: Forwarding arguments through a std.algorithm.map

2018-03-16 Thread Nordlöw via Digitalmars-d-learn
On Friday, 16 March 2018 at 20:39:33 UTC, Andrei Alexandrescu wrote: My knee-jerk reaction is that's a rather peculiar primitive to add to the standard library. -- Andrei I'm needing it for variadic equal...I'll put it as a private member in `equal`s template declaration for now.

Re: Testing D database calls code for regression

2018-03-16 Thread nani via Digitalmars-d-learn
On Friday, 16 March 2018 at 20:17:49 UTC, aberba wrote: How will you test D code which makes calls to database to detect bugs and regression. Unlike where you can inject data like assert (2+1 == 3), database interfacing code will be crazy... Or there's some mocking available for such cases.

Re: Testing D database calls code for regression

2018-03-16 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via Digitalmars-d-learn wrote: > How will you test D code which makes calls to database to detect bugs > and regression. Unlike where you can inject data like assert (2+1 == > 3), database interfacing code will be crazy... Or there's some mocking >

Re: Forwarding arguments through a std.algorithm.map

2018-03-16 Thread Andrei Alexandrescu via Digitalmars-d-learn
On 03/16/2018 03:52 PM, Nordlöw wrote: On Saturday, 10 March 2018 at 21:31:41 UTC, ag0aep6g wrote: auto forwardMap(alias fun, Ts ...)(Ts things) {     import std.meta: aliasSeqOf, staticMap;     import std.range: iota;     import std.typecons: Tuple;     alias NewType(size_t i) =

Testing D database calls code for regression

2018-03-16 Thread aberba via Digitalmars-d-learn
How will you test D code which makes calls to database to detect bugs and regression. Unlike where you can inject data like assert (2+1 == 3), database interfacing code will be crazy... Or there's some mocking available for such cases. Especially when more features are developed on top.

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread aberba via Digitalmars-d-learn
On Friday, 16 March 2018 at 17:11:17 UTC, visitor wrote: On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can make it works ? There's also gtkd sourceview :

Re: Forwarding arguments through a std.algorithm.map

2018-03-16 Thread Nordlöw via Digitalmars-d-learn
On Saturday, 10 March 2018 at 21:31:41 UTC, ag0aep6g wrote: auto forwardMap(alias fun, Ts ...)(Ts things) { import std.meta: aliasSeqOf, staticMap; import std.range: iota; import std.typecons: Tuple; alias NewType(size_t i) = typeof(fun(things[i])); alias NewTypes =

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread visitor via Digitalmars-d-learn
On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can make it works ? There's also gtkd sourceview :

Re: Forwarding arguments through a std.algorithm.map

2018-03-16 Thread Nordlöw via Digitalmars-d-learn
On Saturday, 10 March 2018 at 21:31:41 UTC, ag0aep6g wrote: Not tested beyond `f(1, 2.3, "foo")`: auto forwardMap(alias fun, Ts ...)(Ts things) { import std.meta: aliasSeqOf, staticMap; import std.range: iota; import std.typecons: Tuple; alias NewType(size_t i) =

Re: How to simplify nested ifs

2018-03-16 Thread Tony via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote: if (source?pool?repository?directory?users) // do something That type of chain is sometimes referred to as a "train wreck" (see Law of Demeter). If this is a common lookup it could be: if (source && source.GotSomeUsers() )

Re: List of language deprecations

2018-03-16 Thread Nordlöw via Digitalmars-d-learn
On Friday, 16 March 2018 at 16:01:18 UTC, Steven Schveighoffer wrote: https://dlang.org/deprecate.html Thanks!

Re: List of language deprecations

2018-03-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/16/18 11:58 AM, Nordlöw wrote: Is there a list of language deprecations? I want to show my codings fellows how strong and modern D's view on deprecations are. https://dlang.org/deprecate.html -Steve

List of language deprecations

2018-03-16 Thread Nordlöw via Digitalmars-d-learn
Is there a list of language deprecations? I want to show my codings fellows how strong and modern D's view on deprecations are.

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can make it works ? I believe on is available in dtw.

Re: Allocator Part of Type

2018-03-16 Thread jmh530 via Digitalmars-d-learn
On Friday, 16 March 2018 at 06:20:42 UTC, Eugene Wissner wrote: [snip] That's interesting thanks.

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 March 2018 at 11:04:31 UTC, Jayam wrote: On Friday, 16 March 2018 at 10:53:39 UTC, bauss wrote: On Friday, 16 March 2018 at 10:52:14 UTC, Alex wrote: On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread Jayam via Digitalmars-d-learn
On Friday, 16 March 2018 at 10:53:39 UTC, bauss wrote: On Friday, 16 March 2018 at 10:52:14 UTC, Alex wrote: On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can make

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread Alex via Digitalmars-d-learn
On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can make it works ? Do you mean something like this? http://vibed.org/api/diet.dom/

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 March 2018 at 10:52:14 UTC, Alex wrote: On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can make it works ? Do you mean something like this?

Re: How to simplify nested ifs

2018-03-16 Thread bauss via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote: Hi I have a construction like the following if (source) { if (source.pool) { if (source.pool.repository) { if (source.pool.repository.directory) { if (source.pool.repository.directory.users) { // do

Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread Jayam via Digitalmars-d-learn
I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can make it works ?

Re: How to simplify nested ifs

2018-03-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 March 2018 at 09:34:38 UTC, Satoshi wrote: null conditional operators are not implemented in D because, as a (I think Walter) said, D is not language designed to work with classes or advanced OOP stuff. Nobody uses it, so please, if you are using it, stop and use structs and meta

Re: How to simplify nested ifs

2018-03-16 Thread drug via Digitalmars-d-learn
On 16.03.2018 09:34, Satoshi wrote: On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote: Hi I have a construction like the following if (source) { if (source.pool) { if (source.pool.repository) { if (source.pool.repository.directory) { if

Re: How to simplify nested ifs

2018-03-16 Thread drug via Digitalmars-d-learn
On 16.03.2018 09:51, drug wrote: I think that null conditional operator is intended for OOP only. It's really useful if your data field may be nullable. May be start review about this? Oops. I mean *isn't intended for OOP only*

Re: How to simplify nested ifs

2018-03-16 Thread Satoshi via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote: Hi I have a construction like the following if (source) { if (source.pool) { if (source.pool.repository) { if (source.pool.repository.directory) { if (source.pool.repository.directory.users) { // do

Re: signbit question

2018-03-16 Thread Seb via Digitalmars-d-learn
On Friday, 16 March 2018 at 08:35:58 UTC, Radu wrote: On Friday, 16 March 2018 at 07:00:36 UTC, ashit axar wrote: On Thursday, 15 March 2018 at 17:30:48 UTC, Seb wrote: They generate the same assembly: https://godbolt.org/g/4ohTJx import std.stdio; void main() { writeln("hello"); }

Re: signbit question

2018-03-16 Thread Radu via Digitalmars-d-learn
On Friday, 16 March 2018 at 07:00:36 UTC, ashit axar wrote: On Thursday, 15 March 2018 at 17:30:48 UTC, Seb wrote: They generate the same assembly: https://godbolt.org/g/4ohTJx import std.stdio; void main() { writeln("hello"); } this generate error for dmd there. `writeln` is not

Re: Convert output range to input range

2018-03-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, March 16, 2018 07:57:04 John Chapman via Digitalmars-d-learn wrote: > I need to write to a range created with outputRangeObject, then > read from it. Is there a way to convert it to an input range? The output range API only supports the put function. That's it. The output range

Convert output range to input range

2018-03-16 Thread John Chapman via Digitalmars-d-learn
I need to write to a range created with outputRangeObject, then read from it. Is there a way to convert it to an input range?

Re: signbit question

2018-03-16 Thread ashit axar via Digitalmars-d-learn
On Thursday, 15 March 2018 at 17:30:48 UTC, Seb wrote: They generate the same assembly: https://godbolt.org/g/4ohTJx import std.stdio; void main() { writeln("hello"); } this generate error for dmd there.

Re: Allocator Part of Type

2018-03-16 Thread Eugene Wissner via Digitalmars-d-learn
On Thursday, 15 March 2018 at 19:36:10 UTC, jmh530 wrote: I recall some talk Andrei did where he said it was a bad idea to make the allocator part of the type. However, the container library in dlang-community(says it is backed with std.experimental.allocator) contains allocator as part of