Nice. Exactly what I was looking for.
I knew I was missing something tiny.
Now I just need to figure out why that works and I can say I've learned
something!
Thanks guys,
Jude
On Sat, Nov 5, 2011 at 5:38 AM, bearophile wrote:
> Jude Young:
>
> > icon = *(toStringz(text(num)));
> >
> > icon is
On Sat, 05 Nov 2011 17:28:34 -0400, Marco Leise wrote:
Am 02.11.2011, 12:48 Uhr, schrieb Steven Schveighoffer
:
In dcollections, removing a specific element (using the default
comparison operator for that element) on a *fast lookup* container is
as simple as:
container.remove(container.f
"Marco Leise" wrote:
> Are you this Alex?
yes.
> As I understand it this function is defined in object_.d which is always
> imported by default and can be called on an (associative) array through a
> mechanism called "universal function call", that matches the part before
> the dot with the fi
Am 26.10.2011, 18:00 Uhr, schrieb Dominic Jones :
Also an plain array is a good stack. :)
I'd rather not use a plain array because (I assume) that when I push
or pop using arrays, a swap array is created to resize the original.
If this is not the case, then an array will certainly do.
-Dominic
Am 02.11.2011, 12:48 Uhr, schrieb Steven Schveighoffer
:
In dcollections, removing a specific element (using the default
comparison operator for that element) on a *fast lookup* container is as
simple as:
container.remove(container.find(x));
Which removes the element x if it's found. Howe
Am 05.11.2011, 21:30 Uhr, schrieb Alex_Dovhal :
Hi, D have "clear" property for arrays and AA, but I failed to find it's
description in docs. Where it's?
Are you this Alex?
http://aichallenge.org/forums/viewtopic.php?f=21&t=1315#p10776
As I understand it this function is defined in object_.d
Hi, D have "clear" property for arrays and AA, but I failed to find it's
description in docs. Where it's?
bearophile wrote:
> "Type tuples" (that are allowed to contain more than just types) aren't
> Phobos constructs, they are built-in in the language.
Haven't tried any of the proposed solutions yet, but they seem all very
easy.
If the solution were not that simple, std.typetuple could be augmented
Tobias Pankrath:
>I do like it, just it would be nice to have an alternative in phobos, iff
>there is no other way I am not aware of.<
"Type tuples" (that are allowed to contain more than just types) aren't Phobos
constructs, they are built-in in the language.
--
Christoph
Jude Young:
> icon = *(toStringz(text(num)));
>
> icon is a char, num is an integer.
Are you trying to convert a single-digit number?
import std.stdio;
void main() {
int x = 5; // in [0 .. 10]
char c = cast(char)(x + '0');
writeln(c);
}
Bye,
bearophile
On Sat, 05 Nov 2011 10:29:36 +0200, Jude Young <10equa...@gmail.com> wrote:
icon = *(toStringz(text(num)));
icon is a char, num is an integer.
I don't suppose there is an easier way to do this?
It's too late and ma brains is mushy.
If I understood the problem correctly:
icon = text(num)[0];
icon = *(toStringz(text(num)));
icon is a char, num is an integer.
I don't suppose there is an easier way to do this?
It's too late and ma brains is mushy.
12 matches
Mail list logo