Hi D
So the compile error messages getting from dmd are starting to
remind me of the notorious 130 line error message I once got from
a C++ compiler for missing a comma in a template. :-/
(After fixing that bug, I left work early and came back the next
day with a python book.)
So, like
On Friday, 14 May 2021 at 22:39:29 UTC, frame wrote:
When using opDispatch()
Thanks! I stumbled around with static asserts and mixins...
totally forgot about the constraints but they will to the trick.
On Friday, 14 May 2021 at 22:39:29 UTC, frame wrote:
When using opDispatch()
- how can I tell the compiler that I do not want to handle some
calls? Some code is testing for range methods (empty, front,
popFront) and I don't know where and which side effects it
causes.
Use a template
On Friday, 14 May 2021 at 22:39:29 UTC, frame wrote:
- how can I tell the compiler that I do not want to handle some
calls?
Put a template constraint on it. `void opDispatch(string s)()
if(s == "whatever")` or minimally like `if(s != "popFront")`
This kind of thing is why I always put
When using opDispatch()
- how can I tell the compiler that I do not want to handle some
calls? Some code is testing for range methods (empty, front,
popFront) and I don't know where and which side effects it causes.
- how can I dismiss calls from __traits(compiles)?
On 15/05/2021 9:42 AM, DLearner wrote:
I am getting 'Error 42: Symbol Undefined' while testing some (fairly)
complex imports.
There was a reference in January to an Optlink bug that seemed like it
could be responsible.
If rdmd can use another linker (and one was recommended), I might be
I am getting 'Error 42: Symbol Undefined' while testing some
(fairly) complex imports.
There was a reference in January to an Optlink bug that seemed
like it could be responsible.
If rdmd can use another linker (and one was recommended), I might
be able to test things further.
Best
On Sunday, 2 May 2021 at 13:43:11 UTC, evilrat wrote:
Anyway, I might try to look at this next weekend. Do you have
this project available on github/google drive?
Open-sourced the code see:
https://github.com/DannyArends/CalderaD
Danny
On Friday, 14 May 2021 at 15:30:06 UTC, Imperatorn wrote:
https://www.amazon.com/Programming-Language-Former-Python-Developers-ebook/dp/B08MD7ZB2X
Anyone read it?
From the thread title, I thought you were asking about my book!
On Friday, 14 May 2021 at 14:14:03 UTC, Steven Schveighoffer
wrote:
On 5/13/21 11:49 PM, Jack wrote:
[...]
Just slice the `a`, appropriately. You have to translate the
indexes back into the original array.
```d
auto opSlice(size_t start, size_t end)
{
return typeof(this)(a[$ - end .. $ -
On Friday, 14 May 2021 at 10:00:44 UTC, Christian Köstlin wrote:
On 2021-05-14 05:49, Jack wrote:
[...]
arr.retro()[0..2] already works.
see https://run.dlang.io/is/U8u3br
oh, how i silly of i didn't notice that before
On Friday, 14 May 2021 at 15:30:06 UTC, Imperatorn wrote:
https://www.amazon.com/Programming-Language-Former-Python-Developers-ebook/dp/B08MD7ZB2X
Anyone read it?
Haven't read it, the title has me at the first five words though.
https://www.amazon.com/Programming-Language-Former-Python-Developers-ebook/dp/B08MD7ZB2X
Anyone read it?
On Friday, 14 May 2021 at 10:00:28 UTC, PinDPlugga wrote:
Hi thank you both for your answers. I had understood from an
earlier chapter how this could introduce a bug, but I was
confused because the warning suggests attaching ```return``` to
the parameter, which is empty in the declaration.
On 5/13/21 11:49 PM, Jack wrote:
How can I implement ranges in the retro range? I'd like to do this
without allocate a new array with .array from std.array, can I do that?
use like this:
```d
auto arr = [1, 2, 3, 4, 5];
auto a = new A!int(arr);
auto b = a.retro[0 .. 2]; // 4, 5
On Friday, 14 May 2021 at 14:03:17 UTC, DLearner wrote:
So 'alias' only valid from definition to end-of-function,
rather than whole function?
Best regards
Yes. This applies to all definitions inside a function, not just
aliases.
>>>
void foo(pint p1) {
alias pint=uint;
import std.stdio;
writeln("p1 = ", p1);
}
void main() {
alias pint=uint;
pint var1;
var1 = 7;
foo(var1);
}
<<<
Does not compile.
But the rather similar:
alias pint=uint;
void
On 14.05.21 12:00, PinDPlugga wrote:
Hi thank you both for your answers. I had understood from an earlier
chapter how this could introduce a bug, but I was confused because the
warning suggests attaching ```return``` to the parameter, which is empty
in the declaration.
`this` is considered a
On Thursday, 13 May 2021 at 19:48:44 UTC, Ali Çehreli wrote:
I was writing this example that shows a use case for the
problem (marked with BUG below):
```D
struct Fraction {
auto n = 0L;
auto d = 1L;
// ... other bits ...
ref Fraction reduce() {
import std.numeric : gcd;
On 2021-05-14 05:49, Jack wrote:
How can I implement ranges in the retro range? I'd like to do this
without allocate a new array with .array from std.array, can I do that?
use like this:
```d
auto arr = [1, 2, 3, 4, 5];
auto a = new A!int(arr);
auto b = a.retro[0 .. 2]; // 4, 5
On Thursday, 13 May 2021 at 18:31:41 UTC, Ali Çehreli wrote:
On 5/13/21 11:29 AM, Ali Çehreli wrote:
create a dynamic InputRange!string object for dynamic
polymorphism that InputRange provides. And that's achieved by
function inputRangeObject():
Some examples:
21 matches
Mail list logo