On Sunday, 27 September 2020 at 13:02:04 UTC, Per Nordlöw wrote:
Is it safe to remove AA-elements from an `aa` I'm iterating
over via aa.byKeyValue?
I'm currently doing this:
foreach (ref kv; aa.byKeyValue)
{
if (pred(kv.key))
aa.remove(kv.key); // ok?
}
if
I wish to use load / save for sparse compressed matrices using
mir.
import mir.sparse;
auto sp = sparse!double(5, 8);
auto crs = sp.compress;
How can I save/load sparse compressed arrays in `npz` format?
(format: ``csc``, ``csr``, ``bsr``, ``dia`` or coo``)
how can i again decompr
On Sunday, 27 September 2020 at 18:30:10 UTC, Imperatorn wrote:
I converting it using VisualD:
https://pastebin.com/jzwKRnKZ
Try it, maybe it works
Somehow, I don't think this is going to fly:
static if(__cplusplus) {
extern (C) {/* Assume C declarations for C++ */
} /* __cplusplu
On Tuesday, 29 September 2020 at 01:46:56 UTC, Ruby The Roobster
wrote:
I thought alias could work like this with classes:
alias test = MyClass(3,"H",9.1); //Assume the constructor
parameters for MyClass are (int,string,double).
Can anybody fix this code?
`alias` lets you create a new name
On 9/28/20 6:46 PM, Ruby The Roobster wrote:
I thought alias could work like this with classes:
That would work with template parameters:
alias A = Foo!(3, "hello");
alias test = MyClass(3,"H",9.1); //Assume the constructor parameters for
MyClass are (int,string,double).
Can anybody fix
I thought alias could work like this with classes:
alias test = MyClass(3,"H",9.1); //Assume the constructor
parameters for MyClass are (int,string,double).
Can anybody fix this code?
On Sunday, 27 September 2020 at 05:22:36 UTC, 60rntogo wrote:
How would I check if it is actually a free function?
but this doesn't even compile since I defined add inside my
main function
ah that's not a free function!!
That's a nested function and thus actually has a hidden argument.
On 9/28/20 3:28 PM, Bastiaan Veelo wrote:
I’m leaning towards ditching the memory mapped I/O on the D end, and
replace it by regular serialisation/deserialisation. That will be a
manual rewrite though, which is a bit of bummer as memory mapped files
are widely used in our Pascal code. But this
On 9/28/20 1:18 PM, ikod wrote:
On Monday, 28 September 2020 at 14:58:15 UTC, Steven Schveighoffer wrote:
On 9/27/20 4:43 PM, Per Nordlöw wrote:
On Sunday, 27 September 2020 at 14:23:11 UTC, H. S. Teoh wrote:
No. Modifying a container while iterating over it is, in general, a
bad idea (unless
On Mon, Sep 28, 2020 at 08:04:49PM +, ikod via Digitalmars-d-learn wrote:
> On Monday, 28 September 2020 at 19:18:20 UTC, H. S. Teoh wrote:
[...]
> > The problem with arbitrary, unrestricted modification of a container
> > while iterating over it, is that it inevitably leads to
> > counterintui
On Monday, 28 September 2020 at 19:18:20 UTC, H. S. Teoh wrote:
On Mon, Sep 28, 2020 at 05:18:41PM +, ikod via
Digitalmars-d-learn wrote:
On Monday, 28 September 2020 at 14:58:15 UTC, Steven
Schveighoffer wrote:
[...]
> One could write a specific function to iterate and remove. I
This loo
On Monday, 28 September 2020 at 15:44:44 UTC, Steven
Schveighoffer wrote:
On 9/28/20 8:57 AM, Bastiaan Veelo wrote:
I am glad to have found the cause of the breakage finally, but
it won't be easy to find a generic solution...
Obviously, this isn't a real piece of code, but there is no way
ar
On Mon, Sep 28, 2020 at 05:18:41PM +, ikod via Digitalmars-d-learn wrote:
> On Monday, 28 September 2020 at 14:58:15 UTC, Steven Schveighoffer wrote:
[...]
> > One could write a specific function to iterate and remove. I
>
> This looks like dead end to me, as you may not only remove items from
The documentation of std.uni [1] says that the unicode struct
provides sets for several binary properties. I am looking for a
way to query non-binary properties of a character. Is that
possible with std.uni or do I need to use a third-party library?
I am specifically interested in the East_Asi
On Monday, 28 September 2020 at 14:58:15 UTC, Steven
Schveighoffer wrote:
On 9/27/20 4:43 PM, Per Nordlöw wrote:
On Sunday, 27 September 2020 at 14:23:11 UTC, H. S. Teoh wrote:
No. Modifying a container while iterating over it is, in
general, a bad idea (unless the container is designed to be
On 9/28/20 7:11 AM, Ruby The Roobster wrote:
For example:
class test {}
class T {
auto c = new test();
}
Any way to tell if an object of type test is a member of object T? I
don't want to use the name of the member variable. I just want to know
if this works in general.
Why am I asking this?
On 9/28/20 8:57 AM, Bastiaan Veelo wrote:
I am glad to have found the cause of the breakage finally, but it won't
be easy to find a generic solution...
Obviously, this isn't a real piece of code, but there is no way around
this. You have to align your pointers. The other option is to not use
On Monday, 28 September 2020 at 14:36:01 UTC, Mike Parker wrote:
There's the `parent` trait. You can wrap it like this:
``
then is (hasParent!f) legal code?
On 9/27/20 4:43 PM, Per Nordlöw wrote:
On Sunday, 27 September 2020 at 14:23:11 UTC, H. S. Teoh wrote:
No. Modifying a container while iterating over it is, in general, a
bad idea (unless the container is designed to be used that way, but
even then, such removal is generally restricted), becau
On Monday, 28 September 2020 at 14:23:12 UTC, Ruby The Roobster
wrote:
On Monday, 28 September 2020 at 14:22:34 UTC, Ruby The Roobster
wrote:
I meant User Defined types. not UDAs. Anyways, the whole thing
is me trying to find a hacky workaround that allows something
similar to multiple alias th
On Monday, 28 September 2020 at 14:09:07 UTC, Paul Backus wrote:
Can you re-write this as actual valid D code, but with the
implementation of the function stubbed out? I still don't
understand what your function is supposed to take as its
input(s), or what "parent object is a member variable of
On Monday, 28 September 2020 at 14:22:34 UTC, Ruby The Roobster
wrote:
I meant User Defined types. not UDAs. Anyways, the whole thing
is me trying to find a hacky workaround that allows something
similar to multiple alias this declarations(because multiple of
these are not possible). And for th
On Monday, 28 September 2020 at 13:45:30 UTC, Ruby The Roobster
wrote:
On Monday, 28 September 2020 at 13:00:43 UTC, Paul Backus wrote:
Can you give some examples of inputs and corresponding outputs
for this, like you would for a unit test? I don't understand
exactly what you're asking, and it
On Monday, 28 September 2020 at 13:00:43 UTC, Paul Backus wrote:
Can you give some examples of inputs and corresponding outputs
for this, like you would for a unit test? I don't understand
exactly what you're asking, and it would help clarify.
Okay. Here is an example.
class Test {
this.is_in
On Monday, 28 September 2020 at 11:11:13 UTC, Ruby The Roobster
wrote:
For example:
class test {}
class T {
auto c = new test();
}
Any way to tell if an object of type test is a member of object
T? I don't want to use the name of the member variable. I just
want to know if this works in gener
On Friday, 5 June 2020 at 21:20:09 UTC, Steven Schveighoffer
wrote:
This kind of sounds like a codegen bug, a race condition, or
(worst case) memory corruption.
I think it must have been memory corruption: I had not realized
that our old Pascal compiler aligns struct members on one byte
bound
On Monday, 28 September 2020 at 11:40:40 UTC, k2aj wrote:
pragma(msg, hasFieldOfType!(T, int)); //false
pragma(msg, hasFieldOfType!(T, test)); //true
Not exactly what I meant. I more of meant is there a way to check
if a test object is a member variable, not if it is in a
particular class.
On Monday, 28 September 2020 at 11:11:13 UTC, Ruby The Roobster
wrote:
For example:
class test {}
class T {
auto c = new test();
}
Any way to tell if an object of type test is a member of object
T? I don't want to use the name of the member variable. I just
want to know if this works in gener
For example:
class test {}
class T {
auto c = new test();
}
Any way to tell if an object of type test is a member of object
T? I don't want to use the name of the member variable. I just
want to know if this works in general.
Why am I asking this? Because I need it to develop this Multiple
Al
On Monday, 28 September 2020 at 10:01:23 UTC, ikod wrote:
Is it specific to some types? What if collection supports
stable "foreach"?
Yes it depends on how collection members (such as insert, find,
replace, erase, etc) are implemented.
I presume we need attributes on mutating collection memb
On Monday, 28 September 2020 at 10:10:10 UTC, Per Nordlöw wrote:
On Monday, 28 September 2020 at 10:01:23 UTC, ikod wrote:
Is it specific to some types? What if collection supports
stable "foreach"?
Yes it depends on how collection members (such as insert, find,
replace, erase, etc) are imple
On Monday, 28 September 2020 at 09:41:02 UTC, Per Nordlöw wrote:
On Monday, 28 September 2020 at 07:15:27 UTC, Imperatorn wrote:
Yes, this should be a compile-time error
Spec here:
https://dlang.org/spec/statement.html#foreach_restrictions
Is it specific to some types? What if collection su
On Monday, 28 September 2020 at 07:15:27 UTC, Imperatorn wrote:
Yes, this should be a compile-time error
Spec here:
https://dlang.org/spec/statement.html#foreach_restrictions
On Monday, 28 September 2020 at 08:26:15 UTC, Per Nordlöw wrote:
In the case where the AA-KeyType is a class (which is
represented as a pointer in D) I want the equality (opEquals)
and the hashing (toHash) of the AA to compare and hash the
pointers themselves, not the fields the classes points
On Sunday, 27 September 2020 at 19:45:07 UTC, Ferhat Kurtulmuş
wrote:
Sorry I did not understand what you meant. It would be better
if you share the answer here. I found this also
https://dlang.org/library/std/traits/key_type.html, but I dont
know if it is related.
In the case where the AA-Ke
On Sunday, 27 September 2020 at 20:43:19 UTC, Per Nordlöw wrote:
On Sunday, 27 September 2020 at 14:23:11 UTC, H. S. Teoh wrote:
[...]
I believe it's high time we start thinking about detecting
these violations at compile-time. I recall it's in the spec
somewhere so we should start a depreca
36 matches
Mail list logo