On Wednesday, 27 February 2019 at 06:56:59 UTC, Nicholas Wilson
wrote:
On Wednesday, 27 February 2019 at 05:45:19 UTC, Michelle Long
wrote:
Basically
void foo(int k = 20)()
{
static if (k <= 0 || k >= 100) return;
foo!(k-1)();
}
Error Error: template instance `foo!-280` recursive
expan
On Tue, 2019-02-26 at 21:36 +, Jordan Wilson via Digitalmars-d-learn
wrote:
> On Tuesday, 26 February 2019 at 19:58:24 UTC, Andrey wrote:
> > Hello,
> > How to break from parallel foreach?
> > More general question - how to control such loop?
>
> A basic way would be to use a flag:
>
> shared
On Tue, 2019-02-26 at 19:58 +, Andrey via Digitalmars-d-learn wrote:
> Hello,
> How to break from parallel foreach?
> More general question - how to control such loop?
It is not clear to me that the concept of "breaking" from a parallel loop
makes sense.
For a sequential loop each loop body i
On Wednesday, 27 February 2019 at 05:45:19 UTC, Michelle Long
wrote:
Basically
void foo(int k = 20)()
{
static if (k <= 0 || k >= 100) return;
foo!(k-1)();
}
Error Error: template instance `foo!-280` recursive expansion
Yep, that return is a dynamic return, not a stat
Basically
void foo(int k = 20)()
{
static if (k <= 0 || k >= 100) return;
foo!(k-1)();
}
Error Error: template instance `foo!-280` recursive expansion
On Wednesday, 27 February 2019 at 04:11:09 UTC, Michelle Long
wrote:
doubles and ints are not upcasted properly to complex
foo(Complex!double c)
foo(3) fails
I'd like to do something like
alias CR(t) = Complex!double(t);
CR(3)
which would be equivalent to typing Complex!double(3) but much
doubles and ints are not upcasted properly to complex
foo(Complex!double c)
foo(3) fails
I'd like to do something like
alias CR(t) = Complex!double(t);
CR(3)
which would be equivalent to typing Complex!double(3) but much
shorter.
Writing a wrapper is overkill.
After following your suggestion to rewrite it with Stride it does
not work either. I assume the error is somehow related to
allSatisfy!.
https://github.com/vporton/struct-params-dlang/blob/c1adc86672f46fd6b743903cc270dceef120a8fe/source/struct_params.d
Please help. It is important for both D c
On Tuesday, 26 February 2019 at 22:56:37 UTC, Victor Porton wrote:
On Tuesday, 26 February 2019 at 22:51:15 UTC, Q. Schroll wrote:
Grouping arguments could be done, but from my experience, it
does not buy you anything; rather it makes it worse. Better
just deal with heterogeneous stuff just lik
On Tue, Feb 26, 2019 at 10:56:37PM +, Victor Porton via Digitalmars-d-learn
wrote:
[...]
> After fixing the error you pointed me, it does not work too:
>
> mixin ProviderParams!("S", ((int, "x"), (float, "y")));
Try this:
mixin ProviderParams!("S", int, "x", float, "y");
> Also: C
On Tuesday, 26 February 2019 at 22:51:15 UTC, Q. Schroll wrote:
On Tuesday, 26 February 2019 at 21:43:31 UTC, Victor Porton
wrote:
Compilation of unittest at the bottom of this file fails with
an error. What is my error?
...
You have the line
ProviderParams("S", ((int, "x"), (float, "y")))
On Tuesday, 26 February 2019 at 21:43:31 UTC, Victor Porton wrote:
Compilation of unittest at the bottom of this file fails with
an error. What is my error?
I cannot tell you, why exactly you get these error messages. I
can explain you the probable cause of the errors. I have not
tested anyth
Compilation of unittest at the bottom of this file fails with an
error. What is my error?
https://github.com/vporton/struct-params-dlang/blob/c32cfde60dbb03cb80a4a8aeb8185f5c86705790/source/struct_params.d
It is very important both for this useful little D project and my
bigger research projec
On 02/26/2019 01:36 PM, Jordan Wilson wrote:
On Tuesday, 26 February 2019 at 19:58:24 UTC, Andrey wrote:
Hello,
How to break from parallel foreach?
More general question - how to control such loop?
A basic way would be to use a flag:
shared stopWork=false;
foreach (wordBag; wordBags.parallel)
On 02/26/2019 10:50 AM, Mitacha wrote:
> I checked, just out of curiosity, what is staticMap's implementation.
> It's implemented using recursive, this made me think if there is way to
> use static foreach instead.
I'm pretty sure staticMap was implemented way before 'static foreach'.
Perhaps i
On Tuesday, 26 February 2019 at 19:58:24 UTC, Andrey wrote:
Hello,
How to break from parallel foreach?
More general question - how to control such loop?
A basic way would be to use a flag:
shared stopWork=false;
foreach (wordBag; wordBags.parallel) {
if (!stopWork) {
// do work
On Tuesday, 26 February 2019 at 19:58:24 UTC, Andrey wrote:
Hello,
How to break from parallel foreach?
More general question - how to control such loop?
Which expectation do you have on such a break?
Hello,
How to break from parallel foreach?
More general question - how to control such loop?
On Friday, 1 February 2019 at 08:12:23 UTC, Andre Pany wrote:
On Friday, 1 February 2019 at 07:35:34 UTC, Kagamin wrote:
It's a strong typed handle, in C it's declared as
#ifdef STRICT
typedef void *HANDLE;
#if 0 && (_MSC_VER > 1000)
#define DECLARE_HANDLE(name) struct name##__; typedef struct
Hi everyone,
I checked, just out of curiosity, what is staticMap's
implementation. It's implemented using recursive, this made me
think if there is way to use static foreach instead. I came out
with following solution: https://run.dlang.io/is/qvgJaw
I checked time it took compiler to compile
On Friday, 22 February 2019 at 11:36:35 UTC, solidstate1991 wrote:
If I want to copy an array of structs with .dup (cannot post
the link in question here at the moment due to non-working
clipboard, it's Color from pixelperfectengine.graphics.common)
I get all zeroes instead of the values from t
On Tuesday, February 26, 2019 3:06:04 AM MST Simen Kjærås via Digitalmars-d-
learn wrote:
> On Monday, 25 February 2019 at 15:26:33 UTC, Jonathan M Davis
>
> wrote:
> > On Monday, February 25, 2019 5:47:47 AM MST Simen Kjærås via
> >
> >> String functions can't access the local scope, and thus can'
On Tuesday, 26 February 2019 at 04:36:59 UTC, James Blachly wrote:
Sadly, the pragma does not accept enum:
Error: pragma `inline` pragma(inline, true or false) expected,
not inline_overlaps
That's most likely a (trivial) bug and should be fixed.
As stated in the docs, the pragma can also be
On 2019-02-25 21:57, Victor Porton wrote:
Can string mixing be split into several parts?
I have a mixin like this:
mixin("struct " ~ name ~ " {\n" ~
" struct Regular {\n" ~
" // ..." ~
" }\n" ~
" struct WithDefaults {\n" ~
" /
On 2019-02-26 05:17, Michelle Long wrote:
e.g., using sdl for different versions and have it automatically switch.
What would be nice is if one could stick all the files for x86 in one
dir and x64 in the others and they will be used depending on the
build(and copied)
Ideally one can do it fo
On Monday, 25 February 2019 at 21:04:48 UTC, Adam D. Ruppe wrote:
On Monday, 25 February 2019 at 20:57:37 UTC, Victor Porton
wrote:
Can string mixing be split into several parts?
I have a mixin like this:
mixin("struct " ~ name ~ " {\n" ~
" struct Regular {\n" ~
"/
On Monday, 25 February 2019 at 21:04:48 UTC, Adam D. Ruppe wrote:
On Monday, 25 February 2019 at 20:57:37 UTC, Victor Porton
wrote:
Also, what is the most proper thing to check that `name` is a
proper identified (not say !@#)?
just let the compiler do it imo.
Agreed. There are times when err
On Monday, 25 February 2019 at 15:26:33 UTC, Jonathan M Davis
wrote:
On Monday, February 25, 2019 5:47:47 AM MST Simen Kjærås via
String functions can't access the local scope, and thus can't
see Dummy. Using lambdas works. (string functions were
basically a workaround for no decent lambda synt
28 matches
Mail list logo