On 04/07/2016 07:56 PM, default0 wrote:
> dmd --version prints out 2.070.2
>
> I believe 2.071 is the most recent version?
Yes, that's fresh out of the oven :) with potentially confusing but more
correct import behaviour:
http://forum.dlang.org/thread/ne1fd0$1r10$1...@digitalmars.com
Ali
On Thursday, 7 April 2016 at 15:55:16 UTC, Steven Schveighoffer
wrote:
On 4/6/16 11:10 AM, Andre wrote:
[...]
Just FYI, you don't need a semicolon there.
[...]
Wow, totally agree with you. Compiler shouldn't make you jump
through this hoop:
void foo(Cat cat)
{
Animal a = cat;
a.cr
On Friday, 8 April 2016 at 03:27:04 UTC, Dsby wrote:
when the soft start, call GC.disable().
use "new " create a class , struct or a array. and use
destory(T/void *) to call the ~this(), then GC.free to free the
memory, and use RAII in class or Struct.
And user the Timer, or in some where to ca
when the soft start, call GC.disable().
use "new " create a class , struct or a array. and use
destory(T/void *) to call the ~this(), then GC.free to free the
memory, and use RAII in class or Struct.
And user the Timer, or in some where to call : GC.enable(),
GC.collect(), GC.disable();
In th
On Friday, 8 April 2016 at 02:49:01 UTC, Jonathan M Davis wrote:
[...]
Thanks. I'll adopt this idiom. Hopefully it gets used often
enough to warrent a phobos function :-)
On Friday, 8 April 2016 at 01:36:18 UTC, rcorre wrote:
@nogc unittest {
int[2] a = [1, 2];
assert(a == [1, 2]); // OK
immutable(int)[2] b = [1, 2];
assert(b == [1, 2]); // fail: array literal may cause
allocation
}
Is there any logic behind allowing the comparison with `a` but
On Thursday, 7 April 2016 at 21:22:19 UTC, Ali Çehreli wrote:
On 04/07/2016 01:49 PM, default0 wrote:
On Thursday, 7 April 2016 at 20:47:35 UTC, Adam D. Ruppe wrote:
On Thursday, 7 April 2016 at 20:42:17 UTC, default0 wrote:
If I enter "5,5,5" on the commandline, hit enter, then enter
"5,5,5"
On Friday, April 08, 2016 02:01:07 Puming via Digitalmars-d-learn wrote:
> So what you mean is to read the front in constructor, and read
> further parts in the popFront()? that way multiple access to the
> front won't hurt anything. I think it might work, I'll change my
> code.
>
> So the guidelin
On Thursday, 7 April 2016 at 11:07:35 UTC, Marc Schütz wrote:
On Thursday, 7 April 2016 at 08:06:03 UTC, Puming wrote:
On Thursday, 7 April 2016 at 07:45:06 UTC, yawniek wrote:
what is the way one is supposed to parse e.g. a
double of unixtime (as delived by nginx logs) into a SysTime?
current
On Friday, 8 April 2016 at 01:14:11 UTC, Jonathan M Davis wrote:
[...]
Well, given your example, I would strongly argue that you
should write a range that calls read in its constructor and in
popFront rather (so that calling front multiple times doesn't
matter) rather than using map. While ma
On Friday, 8 April 2016 at 01:14:11 UTC, Jonathan M Davis wrote:
[...]
Lazy means that it's not going to consume the entire range when
you call the function. Rather, it's going to return a range
that you can iterate over. It may or may not process the first
element before returning, depending
@nogc unittest {
int[2] a = [1, 2];
assert(a == [1, 2]); // OK
immutable(int)[2] b = [1, 2];
assert(b == [1, 2]); // fail: array literal may cause
allocation
}
Is there any logic behind allowing the comparison with `a` but
not `b`, or is this a compiler bug?
On Friday, April 08, 2016 00:30:05 Puming via Digitalmars-d-learn wrote:
> On Thursday, 7 April 2016 at 18:15:07 UTC, Jonathan M Davis wrote:
> > On Thursday, April 07, 2016 08:47:15 Puming via
> >
> > Digitalmars-d-learn wrote:
> >> On Thursday, 7 April 2016 at 08:27:23 UTC, Edwin van Leeuwen
> >>
On Thursday, 7 April 2016 at 18:15:07 UTC, Jonathan M Davis wrote:
On Thursday, April 07, 2016 08:47:15 Puming via
Digitalmars-d-learn wrote:
On Thursday, 7 April 2016 at 08:27:23 UTC, Edwin van Leeuwen
wrote:
> On Thursday, 7 April 2016 at 08:17:38 UTC, Puming wrote:
>> On Thursday, 7 April 20
On Thursday, 7 April 2016 at 21:36:37 UTC, Alex Parrill wrote:
On Thursday, 7 April 2016 at 20:31:12 UTC, jmh530 wrote:
I've been playing around with __traits and I find myself
confused on one aspect. In the code below, I was testing
whether some templates would compile given types. For the mos
On Thursday, 7 April 2016 at 20:31:12 UTC, jmh530 wrote:
I've been playing around with __traits and I find myself
confused on one aspect. In the code below, I was testing
whether some templates would compile given types. For the most
part it works as I would expect.
I think I get why the thir
On 04/07/2016 01:49 PM, default0 wrote:
On Thursday, 7 April 2016 at 20:47:35 UTC, Adam D. Ruppe wrote:
On Thursday, 7 April 2016 at 20:42:17 UTC, default0 wrote:
If I enter "5,5,5" on the commandline, hit enter, then enter "5,5,5"
When you hit enter, that puts a \n character in the buffer.
On Thursday, 7 April 2016 at 20:47:35 UTC, Adam D. Ruppe wrote:
On Thursday, 7 April 2016 at 20:42:17 UTC, default0 wrote:
If I enter "5,5,5" on the commandline, hit enter, then enter
"5,5,5"
When you hit enter, that puts a \n character in the buffer.
readf doesn't skip that automatically, s
On Thursday, 7 April 2016 at 20:43:04 UTC, Johan Engelen wrote:
Does anybody know how to get the class's vtable pointer without
doing a memory read?
I don't think you can... why do you want it though?
On Thursday, 7 April 2016 at 20:42:17 UTC, default0 wrote:
If I enter "5,5,5" on the commandline, hit enter, then enter
"5,5,5"
When you hit enter, that puts a \n character in the buffer. readf
doesn't skip that automatically, so it complains upon hitting
that newline (the error message show
I am trying to get the vtable pointer as a constant (!).
I've found
auto vptr = typeid(A).vtbl.ptr
gets me the pointer, but because TypeInfo is not immutable
(another forum thread), this will read the pointer from memory
instead of loading a direct value.
Does anybody know how to get the cla
Consider the following program:
import std.stdio;
void main(string[] args) {
int a, b, c;
while(true) {
readf("%d,%d,%d", &a, &b, &c);
writeln(a, b, c);
}
}
If I enter "5,5,5" on the commandline, hit enter, then enter
"5,5,5" a second time, hit enter again, the seco
I've been playing around with __traits and I find myself confused
on one aspect. In the code below, I was testing whether some
templates would compile given types. For the most part it works
as I would expect.
I think I get why the third one works with foo!(int). My guess is
that it assumed t
On 04/07/2016 11:35 AM, Ali Çehreli wrote:
On 04/07/2016 11:29 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Thursday, April 07, 2016 07:45:06 yawniek via Digitalmars-d-learn
wrote:
what is the way one is supposed to parse e.g. a
double of unixtime (as delived by nginx logs) into a Sys
On Thursday, 7 April 2016 at 18:29:19 UTC, Jonathan M Davis wrote:
On Thursday, April 07, 2016 07:45:06 yawniek via
Digitalmars-d-learn wrote:
So, while I understand your frustration, I just don't see any
other sane way to approach this problem than what you've done.
Putting it all in a wrapper
On 04/07/2016 11:29 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Thursday, April 07, 2016 07:45:06 yawniek via Digitalmars-d-learn wrote:
what is the way one is supposed to parse e.g. a
double of unixtime (as delived by nginx logs) into a SysTime?
currently i'm creating a wrapper stru
On Thursday, April 07, 2016 07:45:06 yawniek via Digitalmars-d-learn wrote:
> what is the way one is supposed to parse e.g. a
> double of unixtime (as delived by nginx logs) into a SysTime?
>
> currently i'm creating a wrapper struct around SysTime with alias
> this as:
>
> https://gist.github.com/
On Thursday, April 07, 2016 08:47:15 Puming via Digitalmars-d-learn wrote:
> On Thursday, 7 April 2016 at 08:27:23 UTC, Edwin van Leeuwen
>
> wrote:
> > On Thursday, 7 April 2016 at 08:17:38 UTC, Puming wrote:
> >> On Thursday, 7 April 2016 at 08:07:12 UTC, Edwin van Leeuwen
> >> wrote:
> >>
> >> O
On 07.04.2016 14:57, rikki cattermole wrote:
Ugh, 2.070.2 definitely has it still.
I have no idea when that changed
I don't think """...""" ever was a thing. You could definitely put
newlines in normal "..." literals since basically forever. And
concatenation of adjacent "..." literals is
On 4/6/16 3:54 PM, Jonathan Villa wrote:
I wrote a little program that given some number it generates a list of
different combinations (represented by a ubyte array), so in the end my
function with name GenerateCombinations(int x) returns a ubyte[][] (list
of arrays of ubytes).
Now the problem i
On Thursday, 7 April 2016 at 10:05:02 UTC, Andrea Fontana wrote:
On Thursday, 7 April 2016 at 10:02:05 UTC, Andrea Fontana wrote:
On Wednesday, 6 April 2016 at 20:30:33 UTC, Jonathan Villa
wrote:
Anything change if you wrap your code like:
while ...
{
...
{
ubyte[][] ...
...
On 4/6/16 11:10 AM, Andre wrote:
Hi,
With 2.071 following coding does not compile anymore and somehow I feel
it should compile.
The issue is with line "cat.create();".
Cat is a sub type of Animal. Animal "owns" method create and I want to
call the method
create within the class Animal for cat.
On 4/5/16 2:11 PM, Johan Engelen wrote:
On Tuesday, 5 April 2016 at 18:01:05 UTC, Nick Sabalausky wrote:
These days, DMD/DMDFE version numbers are three parts, ex: 2.070.1.
I can get the first two via std.compiler.version_major and
std.compiler.version_minor. Is there a way to get the third par
On Thursday, 7 April 2016 at 13:40:17 UTC, Rene Zwanenburg wrote:
On Thursday, 7 April 2016 at 13:25:29 UTC, Jerry wrote:
I generated a visuald project and tried that. Now suddenly it
is working as expected. So I guess it's a bug in dub.
That's possible of course, but I'd expect something so
On Thursday, 7 April 2016 at 13:40:17 UTC, Rene Zwanenburg wrote:
That's possible of course, but I'd expect something so
fundamental breaking to be noticed sooner.
Just to make sure, could you run dub with --force to rule out
that it's picking up some stale object files from somewhere?
And i
On Thursday, 7 April 2016 at 13:25:29 UTC, Jerry wrote:
I generated a visuald project and tried that. Now suddenly it
is working as expected. So I guess it's a bug in dub.
That's possible of course, but I'd expect something so
fundamental breaking to be noticed sooner.
Just to make sure, cou
On Thursday, 7 April 2016 at 13:17:32 UTC, Jerry wrote:
On Thursday, 7 April 2016 at 13:13:14 UTC, Suliman wrote:
dup upgdare
dub upgdare
Tried that. I have to say this is odd.
I generated a visuald project and tried that. Now suddenly it is
working as expected. So I guess it's a bug in du
dup upgdare
dub upgdare
On Thursday, 7 April 2016 at 13:13:14 UTC, Suliman wrote:
dup upgdare
dub upgdare
Tried that. I have to say this is odd.
On Thursday, 7 April 2016 at 12:01:59 UTC, Jerry wrote:
Hello, I am trying to use vibe with DMD 2.67, dub and windows.
But in some way the default main function is sneaking in my
build system even when I'm using VibeCustomMain version.
Main file:
import vibe.vibe;
void main() {
writeln("H
On Thursday, 7 April 2016 at 12:43:54 UTC, rikki cattermole wrote:
On 08/04/2016 12:39 AM, Suliman wrote:
On Thursday, 7 April 2016 at 12:30:59 UTC, rikki cattermole
wrote:
On 08/04/2016 12:19 AM, Kagamin wrote:
Create a range that would remove the newline characters from
string,
then decode
On 08/04/2016 12:52 AM, ag0aep6g wrote:
On 07.04.2016 13:59, rikki cattermole wrote:
"abc" strings are not multiline.
Use """abc""" for that purpose.
Wat. We're talking about, aren't we? In D, "abc" strings are multiline,
and """abc""" is not a thing. `"""abc"""` is the same as `"" "abc" ""`
i
On Thursday, 7 April 2016 at 10:57:25 UTC, Edwin van Leeuwen
wrote:
On Thursday, 7 April 2016 at 09:55:56 UTC, Puming wrote:
[...]
That seems like a bug to me and you might want to submit it to
the bug tracker. Even converting it to an array first does not
seem to work:
[...]
Thanks. I j
I need to extract binary blob from PostgreSQL. It's input/output
by default work in hex mode.
http://www.postgresql.org/docs/current/static/datatype-binary.html
I need to extract data and write them on FS as normal file (byte
[] I suppose).
Here is my question on SO
http://stackoverflow.com
On 07.04.2016 13:59, rikki cattermole wrote:
"abc" strings are not multiline.
Use """abc""" for that purpose.
Wat. We're talking about, aren't we? In D, "abc" strings are multiline,
and """abc""" is not a thing. `"""abc"""` is the same as `"" "abc" ""`
is the same as `"" ~ "abc" ~ ""` is the
On 08/04/2016 12:39 AM, Suliman wrote:
On Thursday, 7 April 2016 at 12:30:59 UTC, rikki cattermole wrote:
On 08/04/2016 12:19 AM, Kagamin wrote:
Create a range that would remove the newline characters from string,
then decode from that.
Can confirm, its \n and \r that is causing the problems
On Thursday, 7 April 2016 at 12:30:59 UTC, rikki cattermole wrote:
On 08/04/2016 12:19 AM, Kagamin wrote:
Create a range that would remove the newline characters from
string,
then decode from that.
Can confirm, its \n and \r that is causing the problems here.
with:
std.file.write("output.pn
On 08/04/2016 12:19 AM, Kagamin wrote:
Create a range that would remove the newline characters from string,
then decode from that.
Can confirm, its \n and \r that is causing the problems here.
On Thursday, 7 April 2016 at 12:24:06 UTC, Suliman wrote:
On Thursday, 7 April 2016 at 12:19:48 UTC, Kagamin wrote:
Create a range that would remove the newline characters from
string, then decode from that.
std.file.write("output.png", Base64.decode(myimg.chomp));
The same error
Anyway if
chomp only trims the string at the beginning and at the end, not
in the middle.
I like how dmd has the -profile switch, but I'm not sure how to
go about profiling ldc2. I don't see any compiler flags in the
-help.
I'm also using Windows, if that matters, but if the best options
are on Linux, I can dual-boot.
On Thursday, 7 April 2016 at 12:19:48 UTC, Kagamin wrote:
Create a range that would remove the newline characters from
string, then decode from that.
std.file.write("output.png", Base64.decode(myimg.chomp));
The same error
Create a range that would remove the newline characters from
string, then decode from that.
On Thursday, 7 April 2016 at 11:59:09 UTC, rikki cattermole wrote:
On 07/04/2016 11:49 PM, Suliman wrote:
It's look like my data have padding that cause crush on
function:
std.file.write("output.png", Base64.decode(myimg));
Invalid character:
It's look like I should to use template function,
Hello, I am trying to use vibe with DMD 2.67, dub and windows.
But in some way the default main function is sneaking in my build
system even when I'm using VibeCustomMain version.
Main file:
import vibe.vibe;
void main() {
writeln("Hello world");
}
And dub file:
{
"targetType": "exe
On 07/04/2016 11:49 PM, Suliman wrote:
It's look like my data have padding that cause crush on function:
std.file.write("output.png", Base64.decode(myimg));
Invalid character:
It's look like I should to use template function, but I can't figure out
how to use it. Could anybody show example?
M
It's look like my data have padding that cause crush on
function: std.file.write("output.png", Base64.decode(myimg));
Invalid character:
It's look like I should to use template function, but I can't
figure out how to use it. Could anybody show example?
My code:
http://www.everfall.com/paste/
On Thursday, 7 April 2016 at 08:03:34 UTC, Edwin van Leeuwen
wrote:
You can try this library:
https://code.dlang.org/packages/dateparser
nope this will not work and the question is broader:
i want to have a standard datatype parsed in a specific way and
so that i can
use other std library too
On Thursday, 7 April 2016 at 08:06:03 UTC, Puming wrote:
On Thursday, 7 April 2016 at 07:45:06 UTC, yawniek wrote:
what is the way one is supposed to parse e.g. a
double of unixtime (as delived by nginx logs) into a SysTime?
currently i'm creating a wrapper struct around SysTime with
alias thi
On Thursday, 7 April 2016 at 09:55:56 UTC, Puming wrote:
When compiled, I get the error:
Error: open path skips field __caches_field_0
source/app.d(19, 36): Error: template instance
std.algorithm.iteration.cache!(MapResult!(__lambda1, int[]))
error instantiating
That seems like a bug to me a
On Thursday, 7 April 2016 at 10:02:05 UTC, Andrea Fontana wrote:
On Wednesday, 6 April 2016 at 20:30:33 UTC, Jonathan Villa
wrote:
On Wednesday, 6 April 2016 at 19:54:32 UTC, Jonathan Villa
wrote:
I wrote a little program that given some number it generates a
TL;DR: My program generates a ver
On Wednesday, 6 April 2016 at 20:30:33 UTC, Jonathan Villa wrote:
On Wednesday, 6 April 2016 at 19:54:32 UTC, Jonathan Villa
wrote:
I wrote a little program that given some number it generates a
TL;DR: My program generates a very large `ubyte[][]`, and after
I call destroy and GC.collect() an
On Thursday, 7 April 2016 at 08:27:23 UTC, Edwin van Leeuwen
wrote:
On Thursday, 7 April 2016 at 08:17:38 UTC, Puming wrote:
On Thursday, 7 April 2016 at 08:07:12 UTC, Edwin van Leeuwen
wrote:
OK. Even if it consumes the first two elements, then why does
it have to consume them AGAIN when act
On Thursday, 7 April 2016 at 08:27:23 UTC, Edwin van Leeuwen
wrote:
On Thursday, 7 April 2016 at 08:17:38 UTC, Puming wrote:
On Thursday, 7 April 2016 at 08:07:12 UTC, Edwin van Leeuwen
wrote:
OK. Even if it consumes the first two elements, then why does
it have to consume them AGAIN when act
On Thursday, 7 April 2016 at 08:17:38 UTC, Puming wrote:
On Thursday, 7 April 2016 at 08:07:12 UTC, Edwin van Leeuwen
wrote:
OK. Even if it consumes the first two elements, then why does
it have to consume them AGAIN when actually used? If the
function mkarray has side effects, it could lead
On Thursday, 7 April 2016 at 08:07:12 UTC, Edwin van Leeuwen
wrote:
On Thursday, 7 April 2016 at 07:07:40 UTC, Puming wrote:
[...]
Apparently it works processing the first two elements at
creation. All the other elements will be processed lazily.
Even when a range is lazy the algorithm stil
On Thursday, 7 April 2016 at 07:07:40 UTC, Puming wrote:
Hi:
when I use map with joiner, I found that function in map are
called. In the document it says joiner is lazy, so why is the
function called?
say:
int[] mkarray(int a) {
writeln("mkarray called!");
return [a * 2]; // just for
On Thursday, 7 April 2016 at 07:45:06 UTC, yawniek wrote:
what is the way one is supposed to parse e.g. a
double of unixtime (as delived by nginx logs) into a SysTime?
currently i'm creating a wrapper struct around SysTime with
alias this as:
https://gist.github.com/yannick/6caf5a5184beea0c24
On Thursday, 7 April 2016 at 07:45:06 UTC, yawniek wrote:
what is the way one is supposed to parse e.g. a
double of unixtime (as delived by nginx logs) into a SysTime?
currently i'm creating a wrapper struct around SysTime with
alias this as:
https://gist.github.com/yannick/6caf5a5184beea0c24
what is the way one is supposed to parse e.g. a
double of unixtime (as delived by nginx logs) into a SysTime?
currently i'm creating a wrapper struct around SysTime with alias
this as:
https://gist.github.com/yannick/6caf5a5184beea0c24f35d9d4a4c7783
really ugly imho.
is there a better way to
Hi:
when I use map with joiner, I found that function in map are
called. In the document it says joiner is lazy, so why is the
function called?
say:
int[] mkarray(int a) {
writeln("mkarray called!");
return [a * 2]; // just for test
}
void main() {
auto xs = [1, 2];
auto r = xs.
71 matches
Mail list logo