On Sunday 24 October 2010 20:33:40 Jonathan M Davis wrote:
> On Sunday 24 October 2010 18:20:53 Denis Koroskin wrote:
> > On Mon, 25 Oct 2010 05:03:50 +0400, Jonathan M Davis
> >
> >
> > wrote:
> > > I'm trying to read from the registry (thus far unsuccesfully).
> > > core.sys.windows.windows has
On Sunday 24 October 2010 18:20:53 Denis Koroskin wrote:
> On Mon, 25 Oct 2010 05:03:50 +0400, Jonathan M Davis
>
> wrote:
> > I'm trying to read from the registry (thus far unsuccesfully).
> > core.sys.windows.windows has RegOpenKeyExA() in it, and I'm trying to
> > use it to
> > read a registry
bearophile wrote:
> some buttons of your GUI
I doubt that one wants to _delete_ buttons of a GUI instead of inactivating
them and the OP did ask for "a function in the standard library to delete
an element from an array", i.e. arrays without any restrictions on the
number of elements as suppos
On Mon, 25 Oct 2010 05:03:50 +0400, Jonathan M Davis
wrote:
I'm trying to read from the registry (thus far unsuccesfully).
core.sys.windows.windows has RegOpenKeyExA() in it, and I'm trying to
use it to
read a registry key. However, when I use it, I get this error upon
compilation:
Erro
I'm trying to read from the registry (thus far unsuccesfully).
core.sys.windows.windows has RegOpenKeyExA() in it, and I'm trying to use it to
read a registry key. However, when I use it, I get this error upon compilation:
Error 42: Symbol Undefined _regopenkey...@20
I'm using wine, and accordi
On Sun, 24 Oct 2010 23:41:07 +0200
"Simen kjaeraas" wrote:
> spir wrote:
>
> > I would like to learn about possible workarounds, or other alternative
> > approaches to such problems, if ever you now any.
>
> Basically, you probably want to use alias this:
>
> http://digitalmars.com/d/2.0/cl
On Sun, 24 Oct 2010 18:54:15 -0400
bearophile wrote:
> spir:
>
> > But for any reason, this logic is not pushed to the point of providing type
> > hierarchy by subtyping. It would have been great for me, since much of the
> > common functionality is generic. Without a type hierarchy, I need to
On Sun, 24 Oct 2010 23:41:07 +0200
"Simen kjaeraas" wrote:
> spir wrote:
>
> > I would like to learn about possible workarounds, or other alternative
> > approaches to such problems, if ever you now any.
>
> Basically, you probably want to use alias this:
>
> http://digitalmars.com/d/2.0/cl
spir:
> But for any reason, this logic is not pushed to the point of providing type
> hierarchy by subtyping. It would have been great for me, since much of the
> common functionality is generic. Without a type hierarchy, I need to
> duplicate it on each struct type, which is _bad_ (as any prog
spir:
> But for any reason, this logic is not pushed to the point of providing type
> hierarchy by subtyping. It would have been great for me, since much of the
> common functionality is generic. Without a type hierarchy, I need to
> duplicate it on each struct type, which is _bad_ (as any prog
spir:
> Bearophile, what do you mean with "arrays dynamic to the right"? (that they
> extend/compress (only) on the right side?)
In Python you may add items at the start too of a list, but that's not an
efficient operation, Python lists are amortized efficient only if you append
items to their
spir wrote:
I would like to learn about possible workarounds, or other alternative
approaches to such problems, if ever you now any.
Basically, you probably want to use alias this:
http://digitalmars.com/d/2.0/class.html#AliasThis
It lets you subtype structs by propagating member field/fun
Hello dear D community,
I need to express a system of related types. The values are actually values,
meaning I absolutely need value semantics (no referencing, else I would be
forced to explicitely copy on each assignment). Also, they are structured,
record-like thingies.
I was very pleased to
> Your new example doesn't show it better, it's the only one you've given that
> shows it at all. What you had originally was
>
> auto a = [1, 2, 3, 4, 5, 6];
> auto b = delete(a, 4);
>
> assert([1, 2, 3, 4, 6] == b);
>
> which shows the removal of the element at index 4, not the element with
>
On Sun, 24 Oct 2010 14:47:43 -0400
bearophile wrote:
> Manfred_Nowak:
>
> > arrays are computational not well suited for deleting elements, nor are
> > lists.
Sequences of all kinds are the worst possible kind of collection for this
operation (not only linear search, but shift all elements pl
spir:
> In my opinion, such non-obvious complications are good reasons to have
> seemingly trivial operations implemented as builtin routines. (and should
> throw error in case of failure)
std.algorithm.delete contains code like if(rEnd == range.length), so if you
give it a signed integer comi
Manfred_Nowak:
> arrays are computational not well suited for deleting elements, nor are
> lists.
On the other hand dynamic arrays are handy for many other purposes. So if you
have just 20 items, like some buttons of your GUI, you may want to use a
dynamic array to add and remove them, especia
Adam Cigánek wrote:
> Is there a function in the standard library to delete an element from
> an array (or range)?
arrays are computational not well suited for deleting elements, nor are
lists.
-manfred
On 24/10/2010 12:24, Adam Cigánek wrote:
remove removes element at a given offset. I want to remove element
with a given value. This is example shows it better:
Your new example doesn't show it better, it's the only one you've given
that shows it at all. What you had originally was
auto
On Sun, 24 Oct 2010 15:51:29 +0200
Adam Cigánek wrote:
> > In my opinion, such non-obvious complications are good reasons to have
> > seemingly trivial operations implemented as builtin routines. (and should
> > throw error in case of failure)
>
> Or have them in the standard library - better
> In my opinion, such non-obvious complications are good reasons to have
> seemingly trivial operations implemented as builtin routines. (and should
> throw error in case of failure)
Or have them in the standard library - better for keeping the language small.
adam.
>
>
> Denis
> -- -- -- -- -
On Sun, 24 Oct 2010 09:31:12 -0400
bearophile wrote:
> Jonathan M Davis:
>
> > Well, then use indexOf() to get the offset and remove() to remove the
> > element.
>
> But you must test the result value of indexOf, because it returns -1 (a
> signed value, probably an integer, not a signed word,
Jonathan M Davis:
> Well, then use indexOf() to get the offset and remove() to remove the element.
But you must test the result value of indexOf, because it returns -1 (a signed
value, probably an integer, not a signed word, so it may give troubles on 64
bit systems) when the item is missing. T
> Well, then use indexOf() to get the offset and remove() to remove the element.
>
Yes, that's what I'm doing. I just thought that I maybe overlook such
function in the standard library. So there is none. No problem, I'll
keep using my own. Still think it would be useful to add it, because I
belie
On Sunday 24 October 2010 04:24:07 Adam Cigánek wrote:
> remove removes element at a given offset. I want to remove element
> with a given value. This is example shows it better:
>
> auto a = ["foo", "bar", "baz"];
> auto b = delete(a, "bar");
>
> assert(["foo", "baz"] == b);
>
>
> adam.
remove removes element at a given offset. I want to remove element
with a given value. This is example shows it better:
auto a = ["foo", "bar", "baz"];
auto b = delete(a, "bar");
assert(["foo", "baz"] == b);
adam.
2010/10/24 Simen kjaeraas :
> On Sun, 24 Oct 2010 13:02:24 +0200, Adam Cig
On Sun, 24 Oct 2010 13:02:24 +0200, Adam Cigánek
wrote:
Hello,
Is there a function in the standard library to delete an element from
an array (or range)? Something like:
auto a = [1, 2, 3, 4, 5, 6];
auto b = delete(a, 4);
assert([1, 2, 3, 4, 6] == b);
I've noticed there is eliminate
Hello,
Is there a function in the standard library to delete an element from
an array (or range)? Something like:
auto a = [1, 2, 3, 4, 5, 6];
auto b = delete(a, 4);
assert([1, 2, 3, 4, 6] == b);
I've noticed there is eliminate in std.algorithm, which seems to be
doing just that, but it's
28 matches
Mail list logo