On Sunday, 27 September 2020 at 11:59:49 UTC, Anonymouse wrote:
On Sunday, 27 September 2020 at 10:17:39 UTC, realhet wrote:
On Saturday, 26 September 2020 at 17:13:17 UTC, Anonymouse
wrote:
On Saturday, 26 September 2020 at 16:05:58 UTC, realhet wrote:
That looks the closes to the python
On 9/27/20 11:54 AM, tastyminerals wrote:
> I have a collection of functions that all have the same input, a string.
> The output however is different and depending on what the function does
> it can be ulong, double or bool.
The following approach overcomes the different return type issue by
On 9/26/20 9:45 AM, Steven Schveighoffer wrote:
On 9/26/20 3:33 AM, 60rntogo wrote:
and this is an error: "struct pack.foo.Foo at source/pack/foo.d(3,1)
conflicts with alias pack.bar.Foo at source/pack/bar.d(3,8)". I seems
like the import in package.d sees Foo both in pack.foo and pack.bar,
On Sunday, 27 September 2020 at 21:41:25 UTC, Adam D. Ruppe wrote:
On Sunday, 27 September 2020 at 21:38:43 UTC, ddcovery wrote:
i.e. checking this Regex expression
`^[a-zA-Z_]*[a-zA-Z0-9_]*[a-zA-Z][a-zA-Z0-9_]*$`
Is there any way to check a regular expression at compile time?
Not really
On Sunday, 27 September 2020 at 21:38:43 UTC, ddcovery wrote:
i.e. checking this Regex expression
`^[a-zA-Z_]*[a-zA-Z0-9_]*[a-zA-Z][a-zA-Z0-9_]*$`
Is there any way to check a regular expression at compile time?
Not really and I'd actually suggest not trying because even if it
did work,
I have a "variation" of "unaryFun" that I name "unaryProp" that,
basically, doesn't require to specify "a." at the beginning of
the expression.
template unaryProp(alias propName)
{
static assert(is(typeof(propName) : string), "Sorry, propName
must be an string");
auto
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), because it often leads to highly
On Sunday, 27 September 2020 at 18:54:11 UTC, tastyminerals wrote:
This is rather a generic implementation question not
necessarily related to D but I'd like to get some opinions.
I have a collection of functions that all have the same input,
a string. The output however is different and
On 9/27/20 1:17 AM, 60rntogo wrote:
On Sunday, 27 September 2020 at 03:33:20 UTC, Mike Parker wrote:
package.d is for your external interface.
Fair enough, thanks.
This isn't an issue with package, it's an issue with a circular dependency.
You are importing yourself and trying alias
On Sunday, 27 September 2020 at 19:37:10 UTC, Per Nordlöw wrote:
On Sunday, 27 September 2020 at 18:39:10 UTC, Per Nordlöw wrote:
How do I defined an AA with class as key where keys are
compared using `is` instead of `opEquals`? Do I have to store
the key as a `void*`?
I got a good answer at
On Sunday, 27 September 2020 at 18:39:10 UTC, Per Nordlöw wrote:
How do I defined an AA with class as key where keys are
compared using `is` instead of `opEquals`? Do I have to store
the key as a `void*`?
I got a good answer at
https://dlang.slack.com/archives/C1ZDHBB2S/p1601234030016700
On Sunday, 27 September 2020 at 18:56:15 UTC, Ferhat Kurtulmuş
wrote:
By looking at object.d and aaA.d of druntime, I d say you don't
need to use void*. Object class has required infrastructure
ready for using classes aa keys (have not tried though). Object
class has both toHash and opEquals
On Wednesday, 23 September 2020 at 20:58:00 UTC, Imperatorn wrote:
On Wednesday, 23 September 2020 at 20:54:51 UTC, Imperatorn
wrote:
On Wednesday, 23 September 2020 at 20:44:51 UTC, Ali Çehreli
wrote:
On 9/23/20 1:19 PM, Imperatorn wrote:
> [...]
send a
> [...]
with timeout.
[...]
Sorry,
On Sunday, 27 September 2020 at 18:39:10 UTC, Per Nordlöw wrote:
How do I defined an AA with class as key where keys are
compared using `is` instead of `opEquals`? Do I have to store
the key as a `void*`?
By looking at object.d and aaA.d of druntime, I d say you don't
need to use void*.
This is rather a generic implementation question not necessarily
related to D but I'd like to get some opinions.
I have a collection of functions that all have the same input, a
string. The output however is different and depending on what the
function does it can be ulong, double or bool. The
On Sunday, 27 September 2020 at 16:39:45 UTC, Ali Çehreli wrote:
On 9/27/20 6:33 AM, Ferhat Kurtulmuş wrote:
> [...]
Kurtulmuş wrote:
>> [...]
wrote:
> [...]
processing
> [...]
How many flame threads do you need? I thought one image
processor and one flame thrower, no? Even if you
How do I defined an AA with class as key where keys are compared
using `is` instead of `opEquals`? Do I have to store the key as a
`void*`?
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote:
I need windowsx.d but for I don't know the reason is not in
dmd. Someone that have it can send to me? I don't know convert
windowsx.h to windowsx.d
I converting it using VisualD:
https://pastebin.com/jzwKRnKZ
Try it, maybe it works
Do we have any D dependency scanning available for D in Cmake,
just like the built in C/C++ dependency scanner which is handy,
or do you have to use the option to compile everything into one
module (--deps=full)?
I have some problems when there is a mix of inlining and calling
the separately
On 9/27/20 6:33 AM, Ferhat Kurtulmuş wrote:
> On Sunday, 27 September 2020 at 12:05:13 UTC, Ferhat Kurtulmuş wrote:
>> On Sunday, 27 September 2020 at 10:40:25 UTC, Ali Çehreli wrote:
>>> On 9/27/20 3:06 AM, Ferhat Kurtulmuş wrote:
>
> Oh, It will work fine if I imitate my time-consuming image
On Sun, Sep 27, 2020 at 01:59:07PM +, DMon via Digitalmars-d-learn wrote:
> Are these in the Specification or Phobos?
See: https://dlang.org/articles/d-array-article.html
T
--
Государство делает вид, что платит нам зарплату, а мы делаем вид, что работаем.
On Sun, Sep 27, 2020 at 01:02:04PM +, Per Nordlöw via Digitalmars-d-learn
wrote:
> Is it safe to remove AA-elements from an `aa` I'm iterating over via
> aa.byKeyValue?
No. Modifying a container while iterating over it is, in general, a bad
idea (unless the container is designed to be used
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
Are these in the Specification or Phobos? I figured them out a
few days ago. These are from my snippet journal on arrays and
there may be more.
void main()
{
int[5] a = [1, 2, 3, 4, 5];
int[5][3] b = [[6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16,
17, 18, 19, 20]];
int[5] c;
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
On Sunday, 27 September 2020 at 12:05:13 UTC, Ferhat Kurtulmuş
wrote:
On Sunday, 27 September 2020 at 10:40:25 UTC, Ali Çehreli wrote:
On 9/27/20 3:06 AM, Ferhat Kurtulmuş wrote:
Oh, It will work fine if I imitate my time-consuming image
processing like this.
I think it is Ok now.
import
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
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 (aa.length == 0)
aa = null;
Is there a better way?
On Sunday, 27 September 2020 at 10:40:25 UTC, Ali Çehreli wrote:
On 9/27/20 3:06 AM, Ferhat Kurtulmuş wrote:
> __gshared DList!Entry queue;
> __gshared bool shouldRun = true;
Have you considered passing messages with
std.concurrency.send() and std.concurrency.receive() and
friends? You
On Sunday, 27 September 2020 at 10:17:39 UTC, realhet wrote:
On Saturday, 26 September 2020 at 17:13:17 UTC, Anonymouse
wrote:
On Saturday, 26 September 2020 at 16:05:58 UTC, realhet wrote:
The closest I can get is @(S.init.c(9).f(42)) with use of
opDispatch, which is easier to read but still
On Sunday, 27 September 2020 at 10:52:58 UTC, Ferhat Kurtulmuş
wrote:
On Sunday, 27 September 2020 at 10:40:25 UTC, Ali Çehreli wrote:
[...]
[...]
I remember that your book covers passing messages with send().
Probably I will rewrite it using that mechanism, you are right,
I noticed that
On Sunday, 27 September 2020 at 10:40:25 UTC, Ali Çehreli wrote:
On 9/27/20 3:06 AM, Ferhat Kurtulmuş wrote:
Have you considered passing messages with
std.concurrency.send() and std.concurrency.receive() and
friends? You wouldn't need 'queue' because all of your threads
already have mail
On 9/27/20 3:06 AM, Ferhat Kurtulmuş wrote:
> __gshared DList!Entry queue;
> __gshared bool shouldRun = true;
Have you considered passing messages with std.concurrency.send() and
std.concurrency.receive() and friends? You wouldn't need 'queue' because
all of your threads already have mail
On Saturday, 26 September 2020 at 17:13:17 UTC, Anonymouse wrote:
On Saturday, 26 September 2020 at 16:05:58 UTC, realhet wrote:
The closest I can get is @(S.init.c(9).f(42)) with use of
opDispatch, which is easier to read but still ugly.
All I can get is that the
- an identifier of a member
On Friday, 25 September 2020 at 13:37:09 UTC, Steven
Schveighoffer wrote:
Given the rate and the number of concurrent tasks, I'd say
threads.
-Steve
Here is my testable and minimal code using 1 extra thread. Thank
you all!
import core.thread;
import std.stdio;
import std.concurrency;
On Saturday, 26 September 2020 at 11:30:23 UTC, k2aj wrote:
It does work, the problem is that scoped returns a Voldemort
type, so you have to use
typeof(scoped!SomeClass(someConstructorArgs)) to declare a
field. Gets really annoying when doing it with any class that
doesn't have a
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote:
I need windowsx.d but for I don't know the reason is not in
dmd. Someone that have it can send to me? I don't know convert
windowsx.h to windowsx.d
Maybe it is already available on code.dlang.org?
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote:
I need windowsx.d but for I don't know the reason is not in
dmd. Someone that have it can send to me? I don't know convert
windowsx.h to windowsx.d
https://wiki.dlang.org/Bindings#Binding_generators
On Sunday, 27 September 2020 at 07:55:56 UTC, Imperatorn wrote:
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote:
I need windowsx.d but for I don't know the reason is not in
dmd. Someone that have it can send to me? I don't know convert
windowsx.h to windowsx.d
You don't want to
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote:
I need windowsx.d but for I don't know the reason is not in
dmd. Someone that have it can send to me? I don't know convert
windowsx.h to windowsx.d
You don't want to just include it?
40 matches
Mail list logo