On Thursday, 15 November 2018 at 19:01:45 UTC, Ali Çehreli wrote:
On 11/15/2018 09:14 AM, Carl Sturtivant wrote:
> opDispatch is special in that it allows for functions to be
added to a
> class or struct when undefined overtly but used elsewhere but
it seems
> those functions sadly are final.
>
On Sunday, 18 November 2018 at 00:51:51 UTC, drug wrote:
On 18.11.2018 1:26, Adam D. Ruppe wrote:
That's because the compiler passes it a hidden pointer to
refer to the context outside. The compiler could perhaps be
smarter about it, and see if those methods actually refer to
the context, bu
On 18.11.2018 1:26, Adam D. Ruppe wrote:
That's because the compiler passes it a hidden pointer to refer to the
context outside. The compiler could perhaps be smarter about it, and see
if those methods actually refer to the context, but it seems to simply
say if the method is there, it might
On Saturday, 17 November 2018 at 21:33:37 UTC, drug wrote:
Another problem I'm trying to resolve is that if I define
struct S outside of unittest or inside of unittest but using
static qualifier AllMembers does not return "this". Also if
struct S do not have methods AllMembers also doesn't retu
On Sat, 17 Nov 2018 21:16:13 +, aliak wrote:
> Could do. But it's not scalable. I'd have to comment out all the
> unittests that call the template function with a T that allocates inside
> the @nogc template (if I understood you correctly that it)
I meant something like:
void debugln(T...
On 18.11.2018 0:09, Adam D. Ruppe wrote:
On Saturday, 17 November 2018 at 20:54:24 UTC, drug wrote:
https://run.dlang.io/is/IygU5D
AllMembers states that struct S contains "this" member, but hasMember
negates it. Is it bug or misusing?
I'm not sure what it is supposed to do, but since this i
On Saturday, 17 November 2018 at 17:48:43 UTC, Neia Neutuladh
wrote:
On Sat, 17 Nov 2018 13:55:24 +, aliak wrote:
You can use "debug blah" to hide inside functions that are
attributed, but when you have an attributed function that
calls a template, attribtues of which are supposed to be
in
On Saturday, 17 November 2018 at 17:58:54 UTC, John Chapman wrote:
Has anyone had a similar need and come up with a solution?
You might be able to just pass it the Calendar type, and then
fetch its parent module and get the ICalendarFactory from there
(assuming they are defined in the same mo
On Saturday, 17 November 2018 at 20:54:24 UTC, drug wrote:
https://run.dlang.io/is/IygU5D
AllMembers states that struct S contains "this" member, but
hasMember negates it. Is it bug or misusing?
I'm not sure what it is supposed to do, but since this is kinda
special - it is a keyword for the
https://run.dlang.io/is/IygU5D
AllMembers states that struct S contains "this" member, but hasMember
negates it. Is it bug or misusing?
On Sat, 17 Nov 2018 17:58:54 +, John Chapman wrote:
> The idea is that users could type (for example) makeWith!`Calendar`(…)
> instead of the longer makeWith!ICalendarFactory(…).
Your project might define a hundred types named ICalendarFactory; the
compiler can't figure out which one you're t
The following code doesn't compile because the generated type
name needs to be available inside the mixin's scope, whereas it's
actually in another module.
auto makeWith(string className, Args…)(auto ref Args args) {
mixin("return makeWith!(I", className, "Factory)(args);"); //
Fowarded to i
On Sat, 17 Nov 2018 13:55:24 +, aliak wrote:
> You can use "debug blah" to hide inside functions that are attributed,
> but when you have an attributed function that calls a template,
> attribtues of which are supposed to be inferred, it seems to fail.
You can explicitly mark a templated funct
On Saturday, 17 November 2018 at 13:46:00 UTC, Nicholas Wilson
wrote:
On Saturday, 17 November 2018 at 13:13:36 UTC, aliak wrote:
On Friday, 16 November 2018 at 13:21:39 UTC, Stanislav Blinov
wrote:
auto assumeNoGC(T)(return scope T t) @trusted { /* ... */ }
Sawweet! Thanks, that made the pri
On Saturday, 17 November 2018 at 13:55:24 UTC, aliak wrote:
You can use "debug blah" to hide inside functions that are
attributed, but when you have an attributed function that calls
a template, attribtues of which are supposed to be inferred, it
seems to fail.
Maybe a bug if it's supposed t
On Saturday, 17 November 2018 at 13:43:20 UTC, Stanislav Blinov
wrote:
On Saturday, 17 November 2018 at 13:13:36 UTC, aliak wrote:
Sawweet! Thanks, that made the printing possible!
You're welcome ;) Still, try a more recent compiler. This works
fine:
void foo() @nogc {
debug {
On Saturday, 17 November 2018 at 13:13:36 UTC, aliak wrote:
On Friday, 16 November 2018 at 13:21:39 UTC, Stanislav Blinov
wrote:
auto assumeNoGC(T)(return scope T t) @trusted { /* ... */ }
Sawweet! Thanks, that made the printing possible!
"scope" is const from what I understand right? It work
On Saturday, 17 November 2018 at 13:13:36 UTC, aliak wrote:
Sawweet! Thanks, that made the printing possible!
You're welcome ;) Still, try a more recent compiler. This works
fine:
void foo() @nogc {
debug {
import std.stdio;
writefln("%d", 42);
}
}
"scope" is const
On Friday, 16 November 2018 at 13:03:40 UTC, Zoadian wrote:
debug {
import std.stdio;
writeln(args);
}
As mentioned in the original post, that does not work.
On Friday, 16 November 2018 at 13:21:39 UTC, Stanislav Blinov
wrote:
At 'point 1', you just take by value. If `t` ends up being a
closure, D will allocate. That's where it breaks the @nogc.
Solution:
auto assumeNoGC(T)(return scope T t) { /* ... */ }
Now you take (and return) a `scope` t, in
On Saturday, 17 November 2018 at 12:35:45 UTC, Daniel Kozák wrote:
On Saturday, 17 November 2018 at 11:48:56 UTC, Václav Kozák
wrote:
Hello, I have a column of type money in my database. I need to
pull the data from the db in my vibe.d backend, but it can't
handle such data type. How can I do i
On Saturday, 17 November 2018 at 11:48:56 UTC, Václav Kozák wrote:
Hello, I have a column of type money in my database. I need to
pull the data from the db in my vibe.d backend, but it can't
handle such data type. How can I do it? Should I use some
library (which?)? Thanks.
You could use row.
On Saturday, 17 November 2018 at 11:48:56 UTC, Václav Kozák wrote:
Hello, I have a column of type money in my database. I need to
pull the data from the db in my vibe.d backend, but it can't
handle such data type. How can I do it? Should I use some
library (which?)? Thanks.
At code.dlang.org
Hello, I have a column of type money in my database. I need to
pull the data from the db in my vibe.d backend, but it can't
handle such data type. How can I do it? Should I use some library
(which?)? Thanks.
On Friday, 16 November 2018 at 17:36:01 UTC, Domain wrote:
When I link the app with /subsystem:windows, and all writeln
and writefln will cause a enforcement failed (stdio.d:2889).
I think this is unacceptable.
Another option is to enhance / correct the third party component
if possible. You
On Saturday, 17 November 2018 at 08:17:36 UTC, Paul Backus wrote:
You could run the calculation in another thread and use
std.concurrency.receiveTimeout [1] to stop waiting for the
result after a certain amount of time.
[1]
https://dlang.org/phobos/std_concurrency.html#.receiveTimeout
Ah.
On Saturday, 17 November 2018 at 06:19:25 UTC, Alex wrote:
It can happen, that the input params are correct, however, the
calculation lasts too long. Is there a way, to measure the
execution time of foo (á la benchmark) and then, if some
execution time limit is exceeded to interrupt the calcula
27 matches
Mail list logo