On Wednesday, 23 September 2020 at 18:37:45 UTC, wjoe wrote:
I have some similar functions:
void register(C: IFoo)()
{
_insert!C();
}
void register(C)() if (behavesLikeFoo!C)
{
_insert!C();
}
There are more overloads with parameters so I want to merge them
void register(C, ARGS...)(ARGS
On Wednesday, 23 September 2020 at 04:15:51 UTC, mw wrote:
On Saturday, 27 October 2012 at 01:08:12 UTC, Jonathan M Davis
wrote:
Yes. But using core.memory.GC.free is unsafe for the same
reasons that delete is. It's just that it's a druntime
function instead of a part of the language, so it's
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, I can't see the problem. Could you be more specific
about what you
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, I can't see the problem. Could you be more specific about
what you want to achieve?
On Wednesday, 23 September 2020 at 20:19:04 UTC, data pulverizer
wrote:
This has prompted me to write a data structure that I thought
would be impossible until now
False alarm:
```
writeln("typeof(x.next): ", typeof(x.next).stringof);
```
gives:
```
typeof(x.next): const(Node)
```
Oh
On 9/23/20 1:19 PM, Imperatorn wrote:
> No. You should not share anything. Personally I would just send a
> message to request termination or use the solution provided with timeout.
std.concurrency does not allow "mutable thread-local data"; so one needs
to cast to shared (assuming copying is
On Wednesday, 23 September 2020 at 20:19:04 UTC, data pulverizer
wrote:
This has prompted me to write a data structure that I thought
would be impossible until now. [...SNIP...]
Here is the function with the correct template constraint:
```
auto makeChain(Args...)(Args args)
if(Args.length >
On Wednesday, 23 September 2020 at 19:27:13 UTC, wjoe wrote:
Appologies if you took offense. Your replies are very much
appreciated.
No offense taken.
On Wednesday, 23 September 2020 at 19:16:13 UTC, H. S. Teoh wrote:
Of course the compiler knows. And of course it can use this
information for static dispatch. That's why D is so awesome at
metaprogramming. ;-)
What the compiler *doesn't* know is whether a variable of some
supertype of Foo
On Wednesday, 23 September 2020 at 17:33:50 UTC, drathier wrote:
On Tuesday, 22 September 2020 at 21:55:51 UTC, Imperatorn wrote:
[...]
Blocking is perfectly fine. I'm wondering if I need things to
be shared now or something? Not used to programming with
threads. Adding a shared modifier
On Wednesday, 23 September 2020 at 19:50:13 UTC, Denis Feklushkin
wrote:
On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев
wrote:
How to implement fastcall ?
( stdcall is calling convention for pass function arguments
via registers )
Hypothesis: it is possible what LLVM + Link
On Wednesday, 23 September 2020 at 19:26:43 UTC, aliak wrote:
Yeah, you can make a property setter:
private void x(int newValue) { _x = newValue }
I'm aware of this, but it does not achieve what I asked for. It
only allows me to assign to _x, it doesn't give me a reference to
x, so I cannot
On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев
wrote:
How to implement fastcall ?
( stdcall is calling convention for pass function arguments via
registers )
Hypothesis: it is possible what LLVM + Link Time Optimization
does by this way.
On 9/23/20 2:38 PM, 60rntogo wrote:
So my questions are:
1. Can I achieve my original goal of being able to refer to _x by one
name, so that I have read only access from outside the module and
read/write access from inside?
I would guess no. You have to use different names.
2. Is the
On Wednesday, 23 September 2020 at 19:27:13 UTC, Steven
Schveighoffer wrote:
This is a bug in the language.
勞
On Wednesday, 23 September 2020 at 18:38:53 UTC, 60rntogo wrote:
There are really two questions here, one that I intended to ask
and one that came out while I was trying to figure out the
answer. Consider this simple code:
[...]
Yeah, you can make a property setter:
private void x(int
On Wednesday, 23 September 2020 at 19:08:47 UTC, data pulverizer
wrote:
On Wednesday, 23 September 2020 at 18:56:33 UTC, wjoe wrote:
[...]
Didn't think that the compiler didn't know but wasn't aware
that you could use that information to statically dispatch. My
mistake, I'll shut up now!
On Wed, Sep 23, 2020 at 07:08:47PM +, data pulverizer via
Digitalmars-d-learn wrote:
> On Wednesday, 23 September 2020 at 18:56:33 UTC, wjoe wrote:
> >
> > It doesn't occur to me that the compiler doesn't know at compile
> > time that
> >
> > interface IFoo{}
> > class Foo: IFoo {}
> >
> >
On Wednesday, 23 September 2020 at 18:56:33 UTC, wjoe wrote:
It doesn't occur to me that the compiler doesn't know at
compile time that
interface IFoo{}
class Foo: IFoo {}
class Foo implements interface IFoo.
Didn't think that the compiler didn't know but wasn't aware that
you could use
On Wednesday, 23 September 2020 at 18:49:28 UTC, data pulverizer
wrote:
On Wednesday, 23 September 2020 at 18:37:45 UTC, wjoe wrote:
[...]
A class at compile time is it's own static type, OOP
polymorphism is a runtime feature not compile time. You have to
write your own traits for specific
On Wednesday, 23 September 2020 at 18:50:28 UTC, H. S. Teoh wrote:
Try this:
interface I {}
class C : I {}
class D {}
struct S {}
pragma(msg, is(C : I)); // true
pragma(msg, is(D : I)); // false
pragma(msg, is(S : I)); // false
So
Try this:
interface I {}
class C : I {}
class D {}
struct S {}
pragma(msg, is(C : I)); // true
pragma(msg, is(D : I)); // false
pragma(msg, is(S : I)); // false
So probably what you want is something like this:
void register(C,
On Wednesday, 23 September 2020 at 18:37:45 UTC, wjoe wrote:
I have some similar functions:
void register(C: IFoo)()
{
_insert!C();
}
void register(C)() if (behavesLikeFoo!C)
{
_insert!C();
}
There are more overloads with parameters so I want to merge them
void register(C, ARGS...)(ARGS
There are really two questions here, one that I intended to ask
and one that came out while I was trying to figure out the
answer. Consider this simple code:
---
module foo;
struct Foo
{
private int _x;
int x() const
{
return _x;
}
}
---
If I have an instance of Foo outside of
I have some similar functions:
void register(C: IFoo)()
{
_insert!C();
}
void register(C)() if (behavesLikeFoo!C)
{
_insert!C();
}
There are more overloads with parameters so I want to merge them
void register(C, ARGS...)(ARGS args) if (behavesLikeFoo!C ||
isInstanceOf!(C, IFoo))
{
On Tuesday, 22 September 2020 at 21:55:51 UTC, Imperatorn wrote:
On Tuesday, 22 September 2020 at 09:32:13 UTC, drathier wrote:
What's the obvious way to put a timeout around a function
call? I'm thinking a 5 or 30 second timeout, and I'm expecting
it to pretty much never time out.
You have
On 23.09.20 02:06, DlangUser38 wrote:
The following analysis might be wrong but I think that `scope` as a
**member** function attribute is not supposed to be used as that is not
even documented.
It's documented here:
https://dlang.org/spec/memory-safe-d.html#scope-return-params
Quote:
On Wednesday, 23 September 2020 at 00:06:38 UTC, DlangUser38
wrote:
Hmm, why would `b` have longer lifetime? Isn't the lifetime of
`b` throughout `bar`?
The following analysis might be wrong but I think that `scope`
as a **member** function attribute is not supposed to be used
as that is not
On Wednesday, 23 September 2020 at 10:02:58 UTC, Dylan Graham
wrote:
On Friday, 18 September 2020 at 07:44:50 UTC, Dylan Graham
wrote:
On Monday, 7 September 2020 at 19:12:59 UTC, aberba wrote:
On Monday, 7 September 2020 at 16:18:00 UTC, IGotD- wrote:
On Monday, 7 September 2020 at 15:23:28
Wow, I have just received a link to this topic from my colleague.
Here is also another thread about druntime for MCUs:
https://forum.dlang.org/post/cwtkntyjhrwvpahfk...@forum.dlang.org
On Friday, 18 September 2020 at 07:44:50 UTC, Dylan Graham wrote:
On Monday, 7 September 2020 at 19:12:59 UTC, aberba wrote:
On Monday, 7 September 2020 at 16:18:00 UTC, IGotD- wrote:
On Monday, 7 September 2020 at 15:23:28 UTC, Severin Teona
wrote:
[...]
Use betterC, which is much better
On Tuesday, 22 September 2020 at 11:39:31 UTC, Daniel Kozak wrote:
On Tue, Sep 22, 2020 at 1:30 PM ShadoLight via
Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote:
This is not really "overriding", it is more akin to
"overloading"
No it is not overloading, overloading is
On Wednesday, 23 September 2020 at 04:15:51 UTC, mw wrote:
What do you mean by saying "it's definitely not safe" here?
I mean: if I'm careful and know what I'm doing, e.g. remove all
the reference to any part of the `object` before call
core.memory.GC.free(object), is there still any inherit
On Wednesday, 23 September 2020 at 04:15:51 UTC, mw wrote:
It's there because there _are_ times when it makes sense and
is useful, but it's definitely not safe, so you have to be
careful and know what you're doing.
What do you mean by saying "it's definitely not safe" here?
I mean: if I'm
34 matches
Mail list logo