On 10/08/2014 02:31 PM, bearophile wrote:
> For indexes now there is also "enumerate".
>
> Bye,
> bearophile
Thanks for the tip. std.range.enumerate makes a big difference:
foreach (i, element; MyRange(42).enumerate) {
// ...
}
versus sequence!"n" and zip:
foreach (i, elem
On 10/12/14 3:46 PM, ketmar via Digitalmars-d-learn wrote:
Hello.
please, how to call template constructor of a class? it's completely
escaped my mind. i.e. i have this class:
class A {
this(alias ent) (string name) {
...
}
}
and i want to do:
void foo () { ... }
On Sun, 12 Oct 2014 22:05:16 +
Gary Willoughby via Digitalmars-d-learn
wrote:
> Ah right, so these methods changed recently?
yes. this is from gdc source:
static void* calloc( size_t sz, uint ba = 0 ) pure nothrow
and this is from current dmd HEAD:
static void* calloc( size_t sz, uint
On Sunday, 12 October 2014 at 19:34:30 UTC, Iain Buclaw wrote:
On Sunday, 12 October 2014 at 19:20:49 UTC, Gary Willoughby
wrote:
I've been recently trying GDC out to compile some D code and
i'm running into the problem of differing function signatures
in core modules.
For example:
stack.d:7
On Sun, 12 Oct 2014 20:29:39 +
JR via Digitalmars-d-learn wrote:
> Template the whole class? class A(alias ent)?
no, that will produce different classes for different types, and i need
just one class, but initialized with different entities. with templated
class i need to make A ancestor of
On Sunday, 12 October 2014 at 19:46:41 UTC, ketmar via
Digitalmars-d-learn wrote:
Hello.
please, how to call template constructor of a class? it's
completely
escaped my mind. i.e. i have this class:
class A {
this(alias ent) (string name) {
...
}
}
and i want to do:
void
On Sunday, 12 October 2014 at 19:46:41 UTC, ketmar via
Digitalmars-d-learn wrote:
Hello.
please, how to call template constructor of a class? it's
completely
escaped my mind. i.e. i have this class:
class A {
this(alias ent) (string name) {
...
}
}
and i want to do:
void
On Sunday, 12 October 2014 at 20:17:38 UTC, Nordlöw wrote:
https://github.com/nordlow/phobos/commit/5c57cb18c2b9d340a19d19207deca5af0339cf7e#diff-0
Made some corrections
https://github.com/nordlow/phobos/compare/inout-array-range
but gives a similar error
array.d(223,19): Error: variable
s
On Sunday, 12 October 2014 at 19:46:41 UTC, ketmar via
Digitalmars-d-learn wrote:
Hello.
please, how to call template constructor of a class? it's
completely
escaped my mind. i.e. i have this class:
class A {
this(alias ent) (string name) {
...
}
}
and i want to do:
void
I'm trying to figure out how to add complete support for
constness in std.container.array.Array at
https://github.com/D-Programming-Language/phobos/commit/703305f0bfb1cc22eff3e44e351cc3db3e03f94f#commitcomment-8114056
My current solution (which currently fails) at
https://github.com/nordlow/ph
Hello.
please, how to call template constructor of a class? it's completely
escaped my mind. i.e. i have this class:
class A {
this(alias ent) (string name) {
...
}
}
and i want to do:
void foo () { ... }
auto a = new A!foo("xFn");
yet compiler tells me that
"template in
On Sunday, 12 October 2014 at 19:20:49 UTC, Gary Willoughby wrote:
I've been recently trying GDC out to compile some D code and
i'm running into the problem of differing function signatures
in core modules.
For example:
stack.d:79: error: function core.memory.GC.calloc (ulong sz,
uint ba = 0
On Sun, 12 Oct 2014 19:20:47 +
Gary Willoughby via Digitalmars-d-learn
wrote:
> These compile fine using DMD. Anybody know what the issue is here?
gdc is still 2.065, while official dmd is 2.066. signatures of this
functions was changed inbetween. or maybe that was changed for
upcoming 2.067,
I've been recently trying GDC out to compile some D code and i'm
running into the problem of differing function signatures in core
modules.
For example:
stack.d:79: error: function core.memory.GC.calloc (ulong sz, uint
ba = 0u) is not callable using argument types (ulong, BlkAttr,
TypeInfo_A
On Sunday, 12 October 2014 at 16:07:19 UTC, Laeeth Isharc wrote:
Any thoughts on speed in 2014 of pyd vs using cython to talk
to D directly via C/C++ interface? I saw this old coment here:
pyd is basically just a convenience layer on top of the C
interface. The part that would most likely
Thanks for this.
I am aware of pyd and will take a look at source/build process.
Any thoughts on speed in 2014 of pyd vs using cython to talk to
D directly via C/C++ interface? I saw this old coment here:
prabhuramachandran.blogspot.co.uk/2008/09/python-vs-cython-vs-d-pyd-vs-c-swig
" predi
On Sunday, 12 October 2014 at 04:17:42 UTC, Jack wrote:
Disclaimer: Don't eat me.
I was just wondering to those who are experienced in using
yajl-d to show me the proper implementation of using it with
arrays.
So far this is what I understand from parsing Json Objects:
class random{
private
yawniek:
i found two snippets from the functional docs that do not work
(anymore?)
http://dlang.org/phobos/std_functional.html
assert(compose!(map!(to!(int)), split)("1 2 3") == [1, 2, 3]);
and
int[] a = pipe!(readText, split, map!(to!(int)))("file.txt");
throwing a std.array.array into the
On 10/12/2014 08:04 AM, yawniek wrote:
i found two snippets from the functional docs that do not work (anymore?)
http://dlang.org/phobos/std_functional.html
assert(compose!(map!(to!(int)), split)("1 2 3") == [1, 2, 3]);
and
int[] a = pipe!(readText, split, map!(to!(int)))("file.txt");
throwing
i found two snippets from the functional docs that do not work
(anymore?)
http://dlang.org/phobos/std_functional.html
assert(compose!(map!(to!(int)), split)("1 2 3") == [1, 2, 3]);
and
int[] a = pipe!(readText, split, map!(to!(int)))("file.txt");
throwing a std.array.array into the mix works f
On Sunday, 12 October 2014 at 10:35:19 UTC, monarch_dodra wrote:
On Sunday, 12 October 2014 at 09:45:22 UTC, Algo wrote:
DList seems to have an issue with remove:
void main()
{
import std.container, std.range, std.algorithm;
auto list = DList!int([1, 2, 4, 6]);
auto res = find(list[],
On Sunday, 12 October 2014 at 09:45:22 UTC, Algo wrote:
DList seems to have an issue with remove:
void main()
{
import std.container, std.range, std.algorithm;
auto list = DList!int([1, 2, 4, 6]);
auto res = find(list[], 2);
list.remove(res); //ok
/*
list.remove(res.takeO
DList seems to have an issue with remove:
void main()
{
import std.container, std.range, std.algorithm;
auto list = DList!int([1, 2, 4, 6]);
auto res = find(list[], 2);
list.remove(res); //ok
/*
list.remove(res.takeOne);
Error: function std.container.dlist.DList!int.DList.
23 matches
Mail list logo