On Wednesday, 24 June 2015 at 08:30:29 UTC, Adrian Matoga wrote:
input.byLine() yields char[]'s as range elements, while props
is (correctly) indexed by strings, i.e. immutable(char)[].
Ooops, more precisely it's because of the second argument of
add() being string, but the solution above
On Wednesday, 24 June 2015 at 08:18:52 UTC, Stefan wrote:
I tried to refactor some existing code to use more of the
functional patterns/style (map, filter, reduce, ..).
The task is to read in some sort of a simple property file and
present the result as an associative array.
My attempt is:
On Wednesday, 24 June 2015 at 06:54:57 UTC, weaselcat wrote:
On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins wrote:
On Tuesday, 23 June 2015 at 03:31:37 UTC, weaselcat wrote:
On Tuesday, 23 June 2015 at 03:29:14 UTC, Charles Hawkins
wrote:
[...]
Try to compile with either ldc or
On Tuesday, 23 June 2015 at 23:52:52 UTC, Adam D. Ruppe wrote:
On Tuesday, 23 June 2015 at 23:14:13 UTC, Steven Schveighoffer
wrote:
I'm not completely sure on the syntax, try adding some parens.
Yeah, I'm pretty sure it needs to be
@(full.name.here) void foo()
Yep, something like this
On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins wrote:
On Tuesday, 23 June 2015 at 03:31:37 UTC, weaselcat wrote:
On Tuesday, 23 June 2015 at 03:29:14 UTC, Charles Hawkins
wrote:
[...]
Try to compile with either ldc or gdc and the -g flag, it
should give you a backtrace. dmd seems
I tried to refactor some existing code to use more of the
functional patterns/style (map, filter, reduce, ..).
The task is to read in some sort of a simple property file and
present the result as an associative array.
My attempt is:
import std.stdio;
import std.algorithm.iteration : filter,
On Wednesday, 24 June 2015 at 08:33:29 UTC, Adrian Matoga wrote:
On Wednesday, 24 June 2015 at 08:30:29 UTC, Adrian Matoga wrote:
input.byLine() yields char[]'s as range elements, while props
is (correctly) indexed by strings, i.e. immutable(char)[].
Ooops, more precisely it's because of the
On Wednesday, 24 June 2015 at 09:35:35 UTC, Adrian Matoga wrote:
On Wednesday, 24 June 2015 at 08:58:10 UTC, Stefan wrote:
On Wednesday, 24 June 2015 at 08:33:29 UTC, Adrian Matoga
wrote:
[...]
Thanks! That does it!
Any idea how to make the 'ugly' reduce step more 'pleasant'?
I.e. make it
On Wednesday, 24 June 2015 at 11:39:51 UTC, Nordlöw wrote:
What to do?
See also: Discussion at
http://dlang.org/library/std/process/kill.html
On 6/24/15 7:39 AM, Nordlöw wrote:
I have a process that shall suspend itself using SIGTSTP or SIGSTOP.
My current plan is
import std.process: thisProcessID, kill, Pid;
import core.sys.posix.signal: SIGKILL, SIGSTOP, SIGTSTP;
const thisPid = thisProcessID;
// some call to
On Wednesday, 24 June 2015 at 08:58:10 UTC, Stefan wrote:
On Wednesday, 24 June 2015 at 08:33:29 UTC, Adrian Matoga wrote:
On Wednesday, 24 June 2015 at 08:30:29 UTC, Adrian Matoga
wrote:
input.byLine() yields char[]'s as range elements, while props
is (correctly) indexed by strings, i.e.
On Wednesday, 24 June 2015 at 11:39:51 UTC, Nordlöw wrote:
I have a process that shall suspend itself using SIGTSTP or
SIGSTOP.
My current plan is
import std.process: thisProcessID, kill, Pid;
import core.sys.posix.signal: SIGKILL, SIGSTOP, SIGTSTP;
const thisPid = thisProcessID;
I have a process that shall suspend itself using SIGTSTP or
SIGSTOP.
My current plan is
import std.process: thisProcessID, kill, Pid;
import core.sys.posix.signal: SIGKILL, SIGSTOP, SIGTSTP;
const thisPid = thisProcessID;
// some call to kill()
but kill() needs a `Pid`
so
On Wednesday, 24 June 2015 at 11:39:51 UTC, Nordlöw wrote:
What to do?
I believe the best solution is to add a new function
Pid thisProcessPid()
to std.process and refer to this from kill(Pid). Should I do PR?
On Thursday, 25 June 2015 at 00:24:23 UTC, Paul D Anderson wrote:
The code snippet below compiles but the linker fails with Error
42: Symbol undefined.
What am I doing wrong?
void main()
{
int foo(int a);
alias FP = int delegate(int);
FP fp = foo;
}
Paul
Uh, never
On Tuesday, 23 June 2015 at 18:49:59 UTC, David DeWitt wrote:
On Monday, 22 June 2015 at 20:30:40 UTC, David DeWitt wrote:
I am getting an core.exception.InvalidMemoryOperationError@(0)
auto recs = f // Open for reading
.byLineCopy();
The code snippet below compiles but the linker fails with Error
42: Symbol undefined.
What am I doing wrong?
void main()
{
int foo(int a);
alias FP = int delegate(int);
FP fp = foo;
}
Paul
Hi!
What is the straightest way to safely cast from one enum type A
to another enum type B, when B, in terms of values as well as
identifiers, is a strict subset of A?
Ideally, that should be as simple as to!B(a). So far I've tried
a couple of things, and one way I found was to first cast A
Is this intended or is it a bug?
void main(string[] args)
{
Test a;
a.foo(5); // Fails to compile
}
struct Test
{
mixin testMix;
void foo(string y){}
}
mixin template testMix()
{
void foo(int x){}
}
Is there a place where these should be posted for discussion?
On Wednesday, 24 June 2015 at 16:44:06 UTC, DLearner wrote:
Is there a place where these should be posted for discussion?
The general forum:
http://forum.dlang.org/group/general
On Wednesday, 24 June 2015 at 07:52:10 UTC, Charles Hawkins wrote:
On Wednesday, 24 June 2015 at 06:54:57 UTC, weaselcat wrote:
On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins
wrote:
[...]
you can instruct dub to use other compilers with the
--compiler option
valid options
I'm trying to understand filtering an Associative Array the D
way. I have the code below
(Using while readln cause problem failing on Debian using
byLineCopy()). When the byKeyValue().filter evaluates to reduce
the number of Keys:Values to only the ones in the filtered
header, what is the
On Thursday, 25 June 2015 at 03:49:04 UTC, Tofu Ninja wrote:
Is this intended or is it a bug?
Intended, the mixin template works on the basis of names. This
means that you can override methods from the mixin by writing a
member with the same name - very useful thing - but also means no
I'm trying to pass a function pointer while keeping the default
parameter values intact. Given the following:
import std.traits;
import std.stdio;
int foo(int a, int b = 1)
{
return a;
}
alias FOOP = int function(int, int = 1);
struct ST(POOF)
{
FOOP fctn;
this(POOF fctn)
{
On Wednesday, 24 June 2015 at 15:29:03 UTC, Roland Hadinger wrote:
Hi!
What is the straightest way to safely cast from one enum type A
to another enum type B, when B, in terms of values as well as
identifiers, is a strict subset of A?
Ideally, that should be as simple as to!B(a). So far
Note that this is a very simple example. You need to check in the
function that a valid StyleColor will actually be produced.
Otherwise, it'll happily produce a StyleColor that's invalid.
On 06/24/2015 09:08 AM, David DeWitt wrote:
I'm trying to understand filtering an Associative Array the D way. I
have the code below
(Using while readln cause problem failing on Debian using
byLineCopy()). When the byKeyValue().filter evaluates to reduce the
number of Keys:Values to only the
On Sunday, 7 June 2015 at 15:39:17 UTC, Marc Schütz wrote:
On Sunday, 7 June 2015 at 15:17:27 UTC, 1967 wrote:
I've got a template that takes in a type. Sometimes the type
is a class, sometimes a struct, sometimes just an int. It
doesn't much matter what it is, but if it's a reference type I
On Wednesday, 24 June 2015 at 18:16:42 UTC, Meta wrote:
std.conv.to really should be able to do this, but I guess not
many people have needed to do this. You can write an
extension to `to` which does it for you:
import std.traits;
auto to(To, From)(From f)
if (is(From == enum) is(To ==
30 matches
Mail list logo