On Thursday, 12 October 2017 at 15:37:23 UTC, John Burton wrote:
This is an example of what I mean :-
undefined what it is meant to do anyway, so the compiler can
"optimize" out the if condition as it only affects the case
where the language doesn't define what it's supposed to do
anyway,
On Wednesday, 11 October 2017 at 08:11:37 UTC, Jonathan M Davis
wrote:
On Wednesday, October 11, 2017 06:25:19 Dhananjay via
Digitalmars-d-learn wrote:
Hello,
I am upgrading to DMD 2.076.1 from DMD 2.069.2 (similar
results on 2.075.1), and seeing a huge increase in unittest
compilation time
On Saturday, October 14, 2017 00:18:35 myst via Digitalmars-d-learn wrote:
> I'm sorry if this has been answered already, it seems like a very
> basic question.
>
> There is .toString() method convention for printing, but I can
> not find anything alike for reading. Is there something like
>
On Friday, 13 October 2017 at 18:53:37 UTC, Jesse Phillips wrote:
You can use Malformed.ignore[1], but your data will come out
like:
You are about to remove ""{0}"" from view ""{1}""
This would leave you needing to modify the "".
1. https://dlang.org/phobos/std_csv.html#.Malformed
I'll
On Saturday, 14 October 2017 at 02:16:12 UTC, Fra Mecca wrote:
On Saturday, 14 October 2017 at 00:18:35 UTC, myst wrote:
...
some snippet of a c++ code that does what you mean
#include
#include
struct S {
std::string s;
int p;
int n;
};
std::istream& operator>>(std::istream&
On Saturday, 14 October 2017 at 00:18:35 UTC, myst wrote:
I'm sorry if this has been answered already, it seems like a
very basic question.
There is .toString() method convention for printing, but I can
not find anything alike for reading. Is there something like
operator>>() in C++? What's
I'm sorry if this has been answered already, it seems like a very
basic question.
There is .toString() method convention for printing, but I can
not find anything alike for reading. Is there something like
operator>>() in C++? What's an ideomatic way of reading an object?
On Saturday, 7 October 2017 at 19:34:53 UTC, WhatMeForget wrote:
On Friday, 6 October 2017 at 23:02:56 UTC, Laeeth Isharc wrote:
On Thursday, 5 October 2017 at 21:48:20 UTC, WhatMeWorry wrote:
I've got a github project and using DUB with DMD and I keep
running into this problem. I've tried
On Friday, 13 October 2017 at 22:29:39 UTC, Steven Schveighoffer
wrote:
It might be tough to do it right, but moot point now, since
it's not necessary anyway :)
-Steve
Yup. Thanks again.
Andrew
On 10/13/17 6:24 PM, Andrew Edwards wrote:
On Friday, 13 October 2017 at 21:53:12 UTC, Steven Schveighoffer wrote:
This has to be a misunderstanding. The point of runEncoded is to
figure out the correct type (based on the BOM), and run your lambda
function with the correct type for the whole
On Friday, 13 October 2017 at 21:53:12 UTC, Steven Schveighoffer
wrote:
On 10/13/17 4:27 PM, Andrew Edwards wrote:
On Friday, 13 October 2017 at 19:17:54 UTC, Steven
Schveighoffer wrote:
On 10/13/17 2:47 PM, Andrew Edwards wrote:
A bit of advice, please. I'm trying to parse a gzipped JSON
On 10/13/17 6:18 PM, ikod wrote:
On Friday, 13 October 2017 at 19:17:54 UTC, Steven Schveighoffer wrote:
Eventually, something like this will be possible with jsoniopipe (I
need to update and release this too, it's probably broken with some of
the changes I just put into iopipe). Hopefully
On Friday, 13 October 2017 at 19:17:54 UTC, Steven Schveighoffer
wrote:
On 10/13/17 2:47 PM, Andrew Edwards wrote:
A bit of advice, please. I'm trying to parse a gzipped JSON
file retrieved from the internet. The following naive
implementation accomplishes the task:
auto url =
On 10/13/17 6:07 PM, Steven Schveighoffer wrote:
On 10/13/17 4:30 PM, Andrew Edwards wrote:
On Friday, 13 October 2017 at 20:17:50 UTC, Steven Schveighoffer wrote:
On 10/13/17 3:17 PM, Steven Schveighoffer wrote:
this should work (something like this really should be in iopipe):
On 10/13/17 4:30 PM, Andrew Edwards wrote:
On Friday, 13 October 2017 at 20:17:50 UTC, Steven Schveighoffer wrote:
On 10/13/17 3:17 PM, Steven Schveighoffer wrote:
this should work (something like this really should be in iopipe):
while(input.extend(0) != 0) {} // get data until EOF
This
On 10/13/17 4:27 PM, Andrew Edwards wrote:
On Friday, 13 October 2017 at 19:17:54 UTC, Steven Schveighoffer wrote:
On 10/13/17 2:47 PM, Andrew Edwards wrote:
A bit of advice, please. I'm trying to parse a gzipped JSON file
retrieved from the internet. The following naive implementation
On Friday, 13 October 2017 at 20:17:50 UTC, Steven Schveighoffer
wrote:
On 10/13/17 3:17 PM, Steven Schveighoffer wrote:
this should work (something like this really should be in
iopipe):
while(input.extend(0) != 0) {} // get data until EOF
This should work today, actually. Didn't think
On Friday, 13 October 2017 at 19:17:54 UTC, Steven Schveighoffer
wrote:
On 10/13/17 2:47 PM, Andrew Edwards wrote:
A bit of advice, please. I'm trying to parse a gzipped JSON
file retrieved from the internet. The following naive
implementation accomplishes the task:
auto url =
On 10/13/17 3:17 PM, Steven Schveighoffer wrote:
this should work (something like this really should be in iopipe):
while(input.extend(0) != 0) {} // get data until EOF
This should work today, actually. Didn't think about it before.
input.ensureElems(size_t.max);
-Steve
On Friday, October 13, 2017 11:26:54 kdevel via Digitalmars-d-learn wrote:
> On Friday, 13 October 2017 at 02:22:24 UTC, Jonathan M Davis
>
> wrote:
> > You've told it that i should never be 3 at that point and that
> > it's a bug if it is, and as such, it is free to assume that i
> > is never 3
On Friday, 13 October 2017 at 08:53:12 UTC, Dmitry wrote:
Hi there.
When I load csv, it crashes ("Quote located in unquoted token")
on lines with quotes, like this:
ResourceNode_RemoveFromView_Confirm,You are about to remove
""{0}"" from view ""{1}"". Continue?,You are about to remove
A bit of advice, please. I'm trying to parse a gzipped JSON file
retrieved from the internet. The following naive implementation
accomplishes the task:
auto url =
"http://api.syosetu.com/novelapi/api/?out=json=500=5;;
getContent(url)
.data
.unzip
On Sunday, 8 October 2017 at 07:51:12 UTC, Nicholas Wilson wrote:
You are using an old DCompute: that message was changed in
https://github.com/libmir/dcompute/commit/cf1420d5377c48f9132f1a9a0f8f06ebb46a6433#diff-b0637c2cde07f2ec8f77f9e3d379fff7
I'm not quite sure how the dub version specs
On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote:
I have windows 10, VS Code with code-d and C/C++ language
extensions. I try to debug but it doesn't work. In particular,
the debugging doesn't stop on breakpoints. It exits
immediately. I recompile with -m64 and -g. I use dub to
On Friday, 13 October 2017 at 16:36:06 UTC, Ali Çehreli wrote:
On 10/13/2017 08:47 AM, kerdemdemir wrote:
> I changed my dependency setting in dub file to "dcompute":
"~>0.0.0" but
> still getting the same error message. By the way I am sure my
LDC
> version is good because I can build DCompute
On Friday, 13 October 2017 at 11:21:48 UTC, Biotronic wrote:
On Friday, 13 October 2017 at 10:35:56 UTC, Jack Applegame
wrote:
Compiler creates struct on the stack and silently (without
postblitting and destruction old object) moves it to another
address. Is it normal? I don't think so.
It
On 10/13/2017 08:47 AM, kerdemdemir wrote:
> I changed my dependency setting in dub file to "dcompute": "~>0.0.0" but
> still getting the same error message. By the way I am sure my LDC
> version is good because I can build DCompute source code with same LDC
> version.
Could this be related to
On 13/10/2017 4:01 PM, Nieto wrote:
How do I use other than Windows.h with D?
For Windows.h I know it's core.sys.windows.windows but what's the module
for Shobjidl.h for example? is this supported natively? (i tried
core.sys.windows.shobjidl actually) but not so, what alternative are there?
On Sunday, 8 October 2017 at 07:51:12 UTC, Nicholas Wilson wrote:
On Saturday, 7 October 2017 at 10:34:15 UTC, kerdemdemir wrote:
do you set "-mdcompute-targets=cuda-xxx" in the dflags for
your dub.json for your project?
I have added now after your comment.
But it seems it didn't changed
How do I use other than Windows.h with D?
For Windows.h I know it's core.sys.windows.windows but what's the
module for Shobjidl.h for example? is this supported natively? (i
tried core.sys.windows.shobjidl actually) but not so, what
alternative are there?
On Friday, 13 October 2017 at 13:22:42 UTC, Adam D. Ruppe wrote:
* Use a @property ref function to return the array element and
trust the compiler to inline it.
You could also use pragma(inline, true).
On Friday, 13 October 2017 at 01:09:56 UTC, solidstate1991 wrote:
All the aliases are fail to compile, have not found anything
about it in any of the documentations I checked.
Like the others said, alias just renames symbols, not
expressions. Think of the generated code - if you are replacing
On 10/13/17 8:56 AM, Dgame wrote:
On Friday, 13 October 2017 at 12:08:00 UTC, Jack Applegame wrote:
On Friday, 13 October 2017 at 12:03:55 UTC, Dgame wrote:
Interesting. If you remove the CTor in Foo it works again.
If you remove DTor it works again too. :)
That's one of these times where
On Friday, 13 October 2017 at 12:08:00 UTC, Jack Applegame wrote:
On Friday, 13 October 2017 at 12:03:55 UTC, Dgame wrote:
Interesting. If you remove the CTor in Foo it works again.
If you remove DTor it works again too. :)
That's one of these times where it would be helpful to see the
I have windows 10, VS Code with code-d and C/C++ language
extensions. I try to debug but it doesn't work. In particular,
the debugging doesn't stop on breakpoints. It exits immediately.
I recompile with -m64 and -g. I use dub to build the project. I
use unit-threaded and I'm trying to debug a
On 10/12/17 7:33 PM, Psychological Cleanup wrote:
Is there any way to get the function body of a function, delegate, and
lambda? I'd also like to extend functions by "wrapping" them at compile
time generically. For example, I'd like to get all the properties of a
class and add some code to
On 10/13/17 3:47 AM, Daniel Kozak wrote:
but it works ok with immutable, so until you really need to change bar
you can use
immutable bar = 9;
foo!byte(bar + 1);
Right, the reason why your original didn't work is the compiler
"forgets" that bar is 9 by the time it gets to the foo call.
On Friday, 13 October 2017 at 12:03:55 UTC, Dgame wrote:
Interesting. If you remove the CTor in Foo it works again.
If you remove DTor it works again too. :)
On Friday, 13 October 2017 at 10:35:56 UTC, Jack Applegame wrote:
If you don't want to get the great PITA, never create temporary
objects in function parameters.
I recently spent a whole day digging through my reference
counted containers library. But nasty bug was not there, but in
the
On Friday, 13 October 2017 at 11:21:48 UTC, Biotronic wrote:
BountySource[2] lets you do basically exactly that.
My experience says that BountySource almost doesn't help.
On Friday, 13 October 2017 at 02:22:24 UTC, Jonathan M Davis
wrote:
You've told it that i should never be 3 at that point and that
it's a bug if it is, and as such, it is free to assume that i
is never 3 after the assertion even if the assertion is
compiled out with -release - that is the only
On Friday, 13 October 2017 at 10:35:56 UTC, Jack Applegame wrote:
Compiler creates struct on the stack and silently (without
postblitting and destruction old object) moves it to another
address. Is it normal? I don't think so.
It is. Structs have no identity, and the compiler/GC/whatever is
Jack Applegame wrote:
Compiler creates struct on the stack and silently (without postblitting
and destruction old object) moves it to another address. Is it normal?
yes.
WAT??? Compiler creates struct on the stack copies it without
postblitting and destructs both objects.
and this is the
If you don't want to get the great PITA, never create temporary
objects in function parameters.
I recently spent a whole day digging through my reference counted
containers library. But nasty bug was not there, but in the
compiler.
Look at this: https://glot.io/snippets/eui2l8ov0r
Result:
On Friday, 13 October 2017 at 10:11:39 UTC, rikki cattermole
wrote:
Something along the lines of:
.byLine.map!(a => a.fixQuotes).joiner("\n").csvReader!...
Yep, it works.
Either way, you're using ranges!
Its even the same amount of code, if not less.
I see. Thank you!
On Friday, 13 October 2017 at 07:47:55 UTC, Daniel Kozak wrote:
but it works ok with immutable, so until you really need to
change bar you can use
immutable bar = 9;
foo!byte(bar + 1);
As Adam wrote two days ago: 'D doesn't do implicit narrowing
conversion... so x + 1 becomes int, but then
On 13/10/2017 11:05 AM, Dmitry wrote:
On Friday, 13 October 2017 at 09:00:52 UTC, rikki cattermole wrote:
Write a purpose built csv parser using ranges. It should take only
about half an hour.
I know, I know not very helpful. But a custom built parser will work
better for you I think.
Yep, I
On Friday, 13 October 2017 at 09:00:52 UTC, rikki cattermole
wrote:
Write a purpose built csv parser using ranges. It should take
only about half an hour.
I know, I know not very helpful. But a custom built parser will
work better for you I think.
Yep, I can parse it myself, but I want to try
On Tuesday, 10 October 2017 at 19:00:59 UTC, Nordlöw wrote:
Why isn't there an array/range version of `emplace`, when there
is one for `moveEmplace`, namely
Ping!
On Friday, 25 November 2016 at 19:16:43 UTC, ketmar wrote:
On Friday, 25 November 2016 at 14:27:39 UTC, Igor Shirkalin
wrote:
On Wednesday, 23 November 2016 at 18:58:55 UTC, ketmar wrote:
We can define static array without counting the elements as
following:
enum array_ = [1u,2,3,4];
On Wednesday, 11 October 2017 at 12:35:51 UTC, drug wrote:
Using `alias this` it's easy to make wrapper for structure that
calls wrapped structure methods like its own. This is one way -
from wrapper to wrapped transformation. Is it possible to
create the opposite way from wrapped to wrapper?
Write a purpose built csv parser using ranges. It should take only about
half an hour.
I know, I know not very helpful. But a custom built parser will work
better for you I think.
This should help get you started:
On Friday, 13 October 2017 at 02:04:03 UTC, Meta wrote:
On Friday, 13 October 2017 at 01:12:38 UTC, solidstate1991
wrote:
On Friday, 13 October 2017 at 01:09:56 UTC, solidstate1991
wrote:
I'm making a struct for easy color handling Here's a code
sample:
ublic struct Color{
union{
Hi there.
When I load csv, it crashes ("Quote located in unquoted token")
on lines with quotes, like this:
ResourceNode_RemoveFromView_Confirm,You are about to remove
""{0}"" from view ""{1}"". Continue?,You are about to remove
""{0}"" from view ""{1}"". Continue?,,Resource Tree -
On Friday, October 13, 2017 02:12:21 Jonathan M Davis via Digitalmars-d-
learn wrote:
> On Friday, October 13, 2017 07:36:28 bauss via Digitalmars-d-learn wrote:
> > On Thursday, 12 October 2017 at 18:17:54 UTC, Adam D. Ruppe wrote:
> > > On Thursday, 12 October 2017 at 18:11:55 UTC, Nieto wrote:
On Friday, October 13, 2017 07:36:28 bauss via Digitalmars-d-learn wrote:
> On Thursday, 12 October 2017 at 18:17:54 UTC, Adam D. Ruppe wrote:
> > On Thursday, 12 October 2017 at 18:11:55 UTC, Nieto wrote:
> >> Does D have an equivalent to C#'s String.IsNullOrWhiteSpace()
> >> in the standard
Yes I beleive it is neat functionality. I just dont like those names :)
On Fri, Oct 13, 2017 at 8:36 AM, Jacob Carlborg via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
> On 2017-10-12 21:42, Daniel Kozak wrote:
>
>> Wow, C# is really wierd. They have method IsNullOrEmpty (OK
but it works ok with immutable, so until you really need to change bar you
can use
immutable bar = 9;
foo!byte(bar + 1);
On Fri, Oct 13, 2017 at 9:46 AM, Daniel Kozak wrote:
> Not sure :), I have forgoten byte+byte=int.
>
> On Thu, Oct 12, 2017 at 10:51 PM, kdevel via
Not sure :), I have forgoten byte+byte=int.
On Thu, Oct 12, 2017 at 10:51 PM, kdevel via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
> On Wednesday, 11 October 2017 at 07:09:26 UTC, Daniel Kozak wrote:
>
>> You can avoid cast:
>>
>> void foo(T)(T bar){...}
>>
>> byte bar = 9;
On Thursday, 12 October 2017 at 18:17:54 UTC, Adam D. Ruppe wrote:
On Thursday, 12 October 2017 at 18:11:55 UTC, Nieto wrote:
Does D have an equivalent to C#'s String.IsNullOrWhiteSpace()
in the standard library?
import std.string;
if(str.strip().length == 0) {
// is null, empty, or all
On 2017-10-12 21:42, Daniel Kozak wrote:
Wow, C# is really wierd. They have method IsNullOrEmpty (OK why not),
but they have IsNullOrWhiteSpace OK little akward but still OK until you
realized it is more like IsNullOrEmptyOrWhiteSpace :D
It's pretty neat functionality. Ruby has it (or rather
61 matches
Mail list logo