On Thursday, 18 June 2020 at 14:43:54 UTC, H. S. Teoh wrote:
I have an array of input data that I'm looping over, and, based
on some condition, generate new items that are appended onto a
target array (which may already contain data). Since the
creation of new items is quite expensive, I'm thin
On Thursday, 18 June 2020 at 14:53:58 UTC, aberba wrote:
On Tuesday, 12 December 2017 at 20:51:30 UTC, Steven
Schveighoffer wrote:
On 12/11/17 6:33 PM, Seb wrote:
[...]
Since iopipe was mentioned several times, I will say a couple
things:
[...]
I should really try iopipe this time round.
On Thursday, 18 June 2020 at 17:57:49 UTC, Ali Çehreli wrote:
Here is an earlier experiment of nested templates, which may be
useful in this case.
:
I think you should be able to pass callables as 'alias'
template arguments
Sounds good. This gives me an opportunity to learn how nested
te
On Wednesday, 17 June 2020 at 11:50:27 UTC, Per Nordlöw wrote:
Should a range-compliant aggregate type realizing a parser be
encoded as a struct or class? In dmd `Lexer` and `Parser` are
both classes.
In general how should I reason about whether an aggregate type
should be encoded as a struct
On 6/18/20 5:13 AM, Denis wrote:
> Templates offer a clean syntax
Here is an earlier experiment of nested templates, which may be useful
in this case. This is unrelated to your problem but the syntax can be
pretty readable with templates:
// If there are template arguments, then the result i
On Thursday, 18 June 2020 at 12:50:35 UTC, Stanislav Blinov wrote:
No, there isn't a way to write an operator.
OK, first choice eliminated.
On Thursday, 18 June 2020 at 13:57:39 UTC, Dukc wrote:
No reason to use templates here
pragma(inline, true) auto not(bool cond) { return !cond(); }
I
Oh an also https://github.com/dlang/dmd/pull/9899
On Wednesday, 17 June 2020 at 14:32:09 UTC, Adam D. Ruppe wrote:
On Wednesday, 17 June 2020 at 14:24:01 UTC, Stefan Koch wrote:
Parser in dmd does even inherit from Lexer.
why would a parser ever inherit from a lexer?
So you can write nextToken() instead of lexer.nextToken()
On Thursday, 18 June 2020 at 13:58:33 UTC, Dukc wrote:
On Thursday, 18 June 2020 at 13:57:39 UTC, Dukc wrote:
if (not!(abra && cadabra)) ...
if (not(abra && cadabra)) ...
Which is a quite a complicated way to write
if (!(abra && cadabra)) ...
On Thursday, 18 June 2020 at 15:03:38 UTC, Steven Schveighoffer
wrote:
On 6/18/20 10:53 AM, aberba wrote:
On Tuesday, 12 December 2017 at 20:51:30 UTC, Steven
Schveighoffer wrote:
On 12/11/17 6:33 PM, Seb wrote:
[...]
Since iopipe was mentioned several times, I will say a couple
things:
[..
On 6/18/20 10:53 AM, aberba wrote:
On Tuesday, 12 December 2017 at 20:51:30 UTC, Steven Schveighoffer wrote:
On 12/11/17 6:33 PM, Seb wrote:
[...]
Since iopipe was mentioned several times, I will say a couple things:
[...]
I should really try iopipe this time round. I think I avoided toyin
On Tuesday, 12 December 2017 at 20:51:30 UTC, Steven
Schveighoffer wrote:
On 12/11/17 6:33 PM, Seb wrote:
[...]
Since iopipe was mentioned several times, I will say a couple
things:
[...]
I should really try iopipe this time round. I think I avoided
toying with it because the making conve
I have an array of input data that I'm looping over, and, based on some
condition, generate new items that are appended onto a target array
(which may already contain data). Since the creation of new items is
quite expensive, I'm thinking to parallelize it with parallel foreach.
To avoid data race
On Thursday, 18 June 2020 at 13:57:39 UTC, Dukc wrote:
No reason to use templates here
Pff. Me no think straight. -.-
On Thursday, 18 June 2020 at 12:50:35 UTC, Stanislav Blinov wrote:
auto not(alias cond)() { return !cond(); }
if (not!(() => abra && cadabra)) ...
but that is indeed even less readable.
No reason to use templates here
```
pragma(inline, true) auto not(bool cond) { return !cond(); }
if (not
On Thursday, 18 June 2020 at 13:57:39 UTC, Dukc wrote:
if (not!(abra && cadabra)) ...
if (not(abra && cadabra)) ...
On Thursday, 18 June 2020 at 12:13:21 UTC, Denis wrote:
THE ESSENTIAL QUESTION
Is there a way to write an `unless` operator that would allow
the condition to be expressed in an affirmative sense? It would
be used like `if`, i.e. something like:
unless ( ) {
; // Or even:
Let me clarify the requirements and rephrase the question --
REQUIREMENTS
`assert`, `enforce` and the `unless` function I wrote (above) all
allow the condition to be expressed in an affirmative sense, and
they also achieve the goal of readability. These are the initial
requirements.
`unless
18 matches
Mail list logo