On Monday, 13 June 2022 at 21:45:39 UTC, Paul Backus wrote:
On Monday, 13 June 2022 at 19:48:06 UTC, JG wrote:
Hi,
I reduced my code to the following. Could anyone help me to
discover why the line marked with //THIS LINE
causes memcpy to be called, and how can I avoid this?
Reduced
On Monday, 13 June 2022 at 19:48:06 UTC, JG wrote:
Hi,
I reduced my code to the following. Could anyone help me to
discover why the line marked with //THIS LINE
causes memcpy to be called, and how can I avoid this?
Reduced further:
```d
import std.sumtype;
struct Tuple
{
void
On Monday, 13 June 2022 at 20:25:00 UTC, Steven Schveighoffer
wrote:
On 6/13/22 4:09 PM, JG wrote:
Thanks. It seems to be something to do with the variadic
template since this
works:
```d
import std;
struct ParseError { string msg; }
alias ParseErrorOr(T) = SumType!(ParseError,T);
auto
On 6/13/22 4:09 PM, JG wrote:
Thanks. It seems to be something to do with the variadic template since
this
works:
```d
import std;
struct ParseError { string msg; }
alias ParseErrorOr(T) = SumType!(ParseError,T);
auto parseErrorOr(T)(T x) { return ParseErrorOr!T(x); }
auto parserOr(I,alias
On Monday, 13 June 2022 at 19:59:16 UTC, Steven Schveighoffer
wrote:
On 6/13/22 3:48 PM, JG wrote:
Hi,
I reduced my code to the following. Could anyone help me to
discover why the line marked with //THIS LINE
causes memcpy to be called, and how can I avoid this?
```d
import std;
struct
On 6/13/22 3:48 PM, JG wrote:
Hi,
I reduced my code to the following. Could anyone help me to discover
why the line marked with //THIS LINE
causes memcpy to be called, and how can I avoid this?
```d
import std;
struct ParseError { string msg; }
alias ParseErrorOr(T) =
Hi,
I reduced my code to the following. Could anyone help me to
discover why the line marked with //THIS LINE
causes memcpy to be called, and how can I avoid this?
```d
import std;
struct ParseError { string msg; }
alias ParseErrorOr(T) = SumType!(ParseError,T);
auto parseErrorOr(T)(T x)
On Monday, 13 June 2022 at 14:03:13 UTC, Steven Schveighoffer
wrote:
Merge sort only works if it's easy to manipulate the structure,
like a linked-list, or to build a new structure, like if you
don't care about allocating a new array every iteration.
The easiest option is to have two buffers
On 6/13/22 9:44 AM, Ola Fosheim Grøstad wrote:
On Monday, 13 June 2022 at 13:22:52 UTC, Steven Schveighoffer wrote:
I would think sort(joiner([arr1, arr2, arr3])) should work, but it's
not a random access range.
Yes, I got the error «must satisfy the following constraint:
On Monday, 13 June 2022 at 13:22:52 UTC, Steven Schveighoffer
wrote:
I would think sort(joiner([arr1, arr2, arr3])) should work, but
it's not a random access range.
Yes, I got the error «must satisfy the following constraint:
isRandomAccessRange!Range`».
It would be relatively easy to make
On 6/13/22 9:15 AM, Steven Schveighoffer wrote:
Yes. If you don't execute the rollback and start executing more DB
calls, they all get included in the transaction (and might be expected
to be).
Should have said "might *not* be expected to be"
-Steve
On 6/13/22 4:51 AM, Ola Fosheim Grøstad wrote:
Is there a dynamic chain primitive, so that you can add to the chain at
runtime?
Context: the following example on the front page is interesting.
```d
void main()
{
int[] arr1 = [4, 9, 7];
int[] arr2 = [5, 2, 1, 10];
int[] arr3 =
On 6/12/22 4:11 PM, kdevel wrote:
On Tuesday, 7 June 2022 at 18:37:13 UTC, Steven Schveighoffer wrote:
[...]
My very common use of `scope(failure)` for my DB code:
```d
conn.exec("START TRANSACTION");
scope(success) conn.exec("COMMIT");
scope(failure) conn.exec("ROLLBACK");
```
Are there
On Monday, 13 June 2022 at 09:08:40 UTC, Salih Dincer wrote:
On Monday, 13 June 2022 at 08:51:03 UTC, Ola Fosheim Grøstad
wrote:
But it would be much more useful in practice if "chain" was a
dynamic array.
Already so:
I meant something like: chain = [arr1, arr2, …, arrN]
I don't use
On Monday, 13 June 2022 at 08:51:03 UTC, Ola Fosheim Grøstad
wrote:
But it would be much more useful in practice if "chain" was a
dynamic array.
Already so:
```d
int[] arr = [4, 9, 7, 5, 2, 1, 10, 6, 8, 3];
int[] arr1 = arr[0..3];
int[] arr2 = arr[3..7];
int[] arr3 = arr[7..$];
Is there a dynamic chain primitive, so that you can add to the
chain at runtime?
Context: the following example on the front page is interesting.
```d
void main()
{
int[] arr1 = [4, 9, 7];
int[] arr2 = [5, 2, 1, 10];
int[] arr3 = [6, 8, 3];
sort(chain(arr1, arr2, arr3));
On Monday, 13 June 2022 at 07:38:54 UTC, user1234 wrote:
On Thursday, 9 June 2022 at 23:50:10 UTC, user1234 wrote:
On Thursday, 9 June 2022 at 21:20:27 UTC, JG wrote:
[...]
No, for now there if there are other ways they are as hacky as
yours.
The compiler usually uses a global counter to
On Thursday, 9 June 2022 at 23:50:10 UTC, user1234 wrote:
On Thursday, 9 June 2022 at 21:20:27 UTC, JG wrote:
[...]
No, for now there if there are other ways they are as hacky as
yours.
The compiler usually uses a global counter to generate
temporaries.
There's [been attempts] to expose
On Sunday, 12 June 2022 at 05:05:46 UTC, forkit wrote:
Is it possible to create a package.d, consisting of (for
example), two modules, where each module can access private
declarations within each other.
In essence, declaring 'a module level friendship', or a kind of
'extended module' if you
19 matches
Mail list logo