On Wednesday, 4 June 2014 at 06:04:22 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
toString is a member of Tuple, and there's no way to override
that externally.
...
Hi Jonathan,
Yeah, I'll probably just keep my locally cobbled version of
typecons.d in my path.
The other options wou
On Wed, 04 Jun 2014 05:35:18 +
Steve D via Digitalmars-d-learn
wrote:
> Is it possible to override std tuple's toString format?
>
> so that
> auto a = tuple("hello",1,2,3);
> writeln(a);
>
> prints
> ("hello", 1, 2, 3)
> and not
> Tuple!(string, int, int, i
On Tue, 03 Jun 2014 22:54:11 +
Brad Anderson via Digitalmars-d-learn
wrote:
> On Tuesday, 3 June 2014 at 18:22:59 UTC, Jonathan M Davis via
> Digitalmars-d-learn wrote:
> > Well, I would prefer to do it myself, but I obviously can't say
> > that I
> > wouldn't accept it if someone else did it
Is it possible to override std tuple's toString format?
so that
auto a = tuple("hello",1,2,3);
writeln(a);
prints
("hello", 1, 2, 3)
and not
Tuple!(string, int, int, int)("hello", 1, 2, 3)
I'm aware I could write a custom formatter function, but it would
be nic
Thanks! that was perfect.
-Harpo
On Wednesday, 4 June 2014 at 04:46:59 UTC, ed wrote:
On Wednesday, 4 June 2014 at 03:49:25 UTC, Harpo wrote:
Hello I am having the following problem. I am trying to turn a
program I have written into a shared object. I have ran into
some problems however. When I use writeln instead of printf my
On Wednesday, 4 June 2014 at 03:49:25 UTC, Harpo wrote:
Hello I am having the following problem. I am trying to turn a
program I have written into a shared object. I have ran into
some problems however. When I use writeln instead of printf my
program segfaults. I have edited the code to just th
Hello I am having the following problem. I am trying to turn a
program I have written into a shared object. I have ran into some
problems however. When I use writeln instead of printf my program
segfaults. I have edited the code to just the parts causing the
problem.
=main.d t
On Tuesday, 3 June 2014 at 22:10:06 UTC, bioinfornatics wrote:
I do not see why it fail in debug output we see that tuple have
a
field with given name.
Your generated output (short and formatted)
alias TL = Tuple!(int,"x", bool function( const ref string ),
"xStartsWith ", bool function(
On Tuesday, 3 June 2014 at 18:22:59 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
Well, I would prefer to do it myself, but I obviously can't say
that I
wouldn't accept it if someone else did it and did a good job of
it. The main
problem however is that we need to come up with a good
for
On 06/03/2014 08:22 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
> On Tue, 03 Jun 2014 19:39:14 +0200
> Robert Schadek via Digitalmars-d-learn
> wrote:
>
>> On 06/03/2014 07:12 PM, Jonathan M Davis via Digitalmars-d-learn
>> wrote:
>>> On Tue, 03 Jun 2014 17:07:02 +0200
>>> Robert Schadek v
Etienne:
Are asserts supposed to be evaluated in DMD release? I was
getting a "privileged instructions error 0xC096" which was
caused by an assert, when doing some gc programming in druntime
assert(0) are not removed in release builds. They are a HALT.
Bye,
bearophile
On Tuesday, 3 June 2014 at 19:21:08 UTC, Etienne wrote:
Are asserts supposed to be evaluated in DMD release? I was
getting a "privileged instructions error 0xC096" which was
caused by an assert, when doing some gc programming in druntime
Is this part of the runtime precompiled? If not the
Are asserts supposed to be evaluated in DMD release? I was getting a
"privileged instructions error 0xC096" which was caused by an
assert, when doing some gc programming in druntime
On Tuesday, 3 June 2014 at 13:30:13 UTC, Steven Schveighoffer
wrote:
There is a school of thought (to which I subscribe) that says
you shouldn't allocate a separate closure for each loop
iteration.
Basically, a closure will only use the stack frame of the
calling function, not any loop iterat
On Tue, 03 Jun 2014 19:39:14 +0200
Robert Schadek via Digitalmars-d-learn
wrote:
> On 06/03/2014 07:12 PM, Jonathan M Davis via Digitalmars-d-learn
> wrote:
> > On Tue, 03 Jun 2014 17:07:02 +0200
> > Robert Schadek via Digitalmars-d-learn
> > wrote:
> >
> >> Is there a function in phobos that le
On Tuesday, 3 June 2014 at 15:14:06 UTC, bioinfornatics wrote:
without using a delegate, with a function that will not work as
(int a) => a == 42 is a delegate no ?
D will decide the type based on if context is needed. If you look
at the output you had:
, __ctmp1474).this(function (int
On Tuesday, 3 June 2014 at 17:41:27 UTC, Chris Saunders wrote:
Thanks, I somehow missed the vibe.d forums...
I'd need an ldc solution in the end, but trying dmd is a good
idea. The result is some kind of link error to libevent?:
"""
dub build
vibe-d: ["vibe-d", "libevent", "openssl"]
test: [
Thanks, I somehow missed the vibe.d forums...
I'd need an ldc solution in the end, but trying dmd is a good
idea. The result is some kind of link error to libevent?:
"""
dub build
vibe-d: ["vibe-d", "libevent", "openssl"]
test: ["test", "vibe-d", "libevent", "openssl"]
Target is up to date. U
On 06/03/2014 07:12 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
> On Tue, 03 Jun 2014 17:07:02 +0200
> Robert Schadek via Digitalmars-d-learn
> wrote:
>
>> Is there a function in phobos that lets me do something like
>> DateTime.format("MM:DD: ") with a DateTime instance?
> Not cur
On Tue, 03 Jun 2014 17:07:02 +0200
Robert Schadek via Digitalmars-d-learn
wrote:
> Is there a function in phobos that lets me do something like
> DateTime.format("MM:DD: ") with a DateTime instance?
Not currently. It's on my todo list. I intend to get back to it after I've
finished with
On 05/24/2014 11:01 AM, Ali Çehreli wrote:
On 05/24/2014 10:02 AM, w0rp wrote:
> I have been writing my own hashmap which can provide forward ranges
> usable in @safe pure nothrow functions, because it's going to be useful
> for creating graph data structures with the same. I came to writing
On Tuesday, 3 June 2014 at 16:16:10 UTC, Chris Saunders wrote:
I've made my first attempt to use dub/vibe.d and I'm running
into some issues I can't find on the list.
I'm on Ubuntu 14.04/x86_64, using the latest stable dub
(0.9.21). I can create a new dub project:
“””
$ dub init test vibe.d
I've made my first attempt to use dub/vibe.d and I'm running into
some issues I can't find on the list.
I'm on Ubuntu 14.04/x86_64, using the latest stable dub (0.9.21).
I can create a new dub project:
“””
$ dub init test vibe.d
Successfully created an empty project in
'/home/csaunders/devel
On Tuesday, 3 June 2014 at 13:23:36 UTC, Steven Schveighoffer
wrote:
On Mon, 02 Jun 2014 17:25:24 -0400, John Colvin
wrote:
On Monday, 2 June 2014 at 20:23:12 UTC, Steven Schveighoffer
wrote:
On Mon, 02 Jun 2014 15:58:01 -0400, Steven Schveighoffer
wrote:
I'm trying to think of a way to
delegate has a context pointer that it uses when executing
at run-time. However, there can't be a run-time context of a
delegate that is created at compile-time. I think that is why
the segfault.
Is there a reason why it needs to be a delegate?
Replacing every 'delegate' with 'function' makes
Is there a function in phobos that lets me do something like
DateTime.format("MM:DD: ") with a DateTime instance?
On Tuesday, 3 June 2014 at 15:00:05 UTC, Ali Çehreli wrote:
On 06/03/2014 05:57 AM, bioinfornatics wrote:
> On Tuesday, 3 June 2014 at 12:27:45 UTC, bioinfornatics wrote:
I would like store the delegate to another var but when i
try i
get:
testTraitsWithDelegate.d(13):
On 06/03/2014 05:57 AM, bioinfornatics wrote:
> On Tuesday, 3 June 2014 at 12:27:45 UTC, bioinfornatics wrote:
I would like store the delegate to another var but when i try i
get:
testTraitsWithDelegate.d(13): Error: expression template
__lambda2 is void and has no
On Mon, 02 Jun 2014 19:43:58 -0400, Rene Zwanenburg
wrote:
On Monday, 2 June 2014 at 20:09:12 UTC, Edwin van Leeuwen wrote:
I'm probably missing something basic, but I am confused by what is
going on in the following code.
unittest {
size_t delegate()[size_t] events;
foreach( i; 1
On Mon, 02 Jun 2014 17:25:24 -0400, John Colvin
wrote:
On Monday, 2 June 2014 at 20:23:12 UTC, Steven Schveighoffer wrote:
On Mon, 02 Jun 2014 15:58:01 -0400, Steven Schveighoffer
wrote:
I'm trying to think of a way to do this without loops, but not sure.
I'm surprised, I looked for
On Tuesday, 3 June 2014 at 12:27:45 UTC, bioinfornatics wrote:
On Monday, 2 June 2014 at 23:27:03 UTC, Meta wrote:
On Monday, 2 June 2014 at 22:18:39 UTC, bioinfornatics wrote:
Hi,
I would like store the delegate to another var but when i try
i
get:
testTraitsWithDelegate.d(13): Error: exp
On Monday, 2 June 2014 at 23:27:03 UTC, Meta wrote:
On Monday, 2 June 2014 at 22:18:39 UTC, bioinfornatics wrote:
Hi,
I would like store the delegate to another var but when i try i
get:
testTraitsWithDelegate.d(13): Error: expression template
__lambda2 is void and has no value
I do not want
No. We've been able to return by ref for ages. However, when
Thx
On Tue, 03 Jun 2014 10:14:21 +
"Nordlöw" via Digitalmars-d-learn
wrote:
> The title
>
> "More ref return fixes in std.datetime now that the compiler
> allows them"
>
> of
>
> https://github.com/D-Programming-Language/phobos/pull/2227/files
>
> made me curious to what is meant by ref return. I
The title
"More ref return fixes in std.datetime now that the compiler
allows them"
of
https://github.com/D-Programming-Language/phobos/pull/2227/files
made me curious to what is meant by ref return. Is this a recent
improvement in DMD?
Ali Çehreli:
Here is a workaround:
unittest {
size_t delegate()[size_t] events;
auto makeClosure(size_t i) {
return { return i; };
}
foreach( i; 1..4 ) {
events[i] = makeClosure(i);
}
You can also use two lambdas to do that, without the
"makeClosure":
h
On Tuesday, 3 June 2014 at 07:00:35 UTC, Ali Çehreli wrote:
Here is a workaround:
unittest {
size_t delegate()[size_t] events;
auto makeClosure(size_t i) {
return { return i; };
}
foreach( i; 1..4 ) {
events[i] = makeClosure(i);
}
assert( events[1]() ==
Hah, sorry, I didn't read the last post. I did exactly what Ali
just suggested.
I've run across this myself. The workaround I used was to call a
function from inside the foreach loop, and in that function you
construct the delegate (with the index variable passed as a
parameter).
On 06/02/2014 10:40 PM, Edwin van Leeuwen wrote:
On Monday, 2 June 2014 at 23:44:01 UTC, Rene Zwanenburg wrote:
On Monday, 2 June 2014 at 20:09:12 UTC, Edwin van Leeuwen wrote:
As you may have guessed, a workaround is to copy the iteration
variable yourself:
unittest {
size_t delegate()[siz
41 matches
Mail list logo