Re: Catching C errors

2022-10-20 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 20 October 2022 at 13:02:52 UTC, bachmeier wrote: I've done an initial release of the second version: https://github.com/bachmeil/embedrv2 The two biggest changes are - Moving to Dub as the default for compilation, which allows the use of any other Dub libraries - It writes the

Re: How to pass noncopyable variadic arguments with ref?

2022-10-20 Thread user1234 via Digitalmars-d-learn
On Thursday, 20 October 2022 at 16:34:34 UTC, user1234 wrote: On Thursday, 20 October 2022 at 14:03:10 UTC, tchaloupka wrote: Hi, I've found strange behavior where: [...] Shouldn't it at least protest that objects can't be passed to the function as they aren't copyable? it's clearly a compile

Re: How to pass noncopyable variadic arguments with ref?

2022-10-20 Thread user1234 via Digitalmars-d-learn
On Thursday, 20 October 2022 at 14:03:10 UTC, tchaloupka wrote: Hi, I've found strange behavior where: [...] Shouldn't it at least protest that objects can't be passed to the function as they aren't copyable? it's clearly a compiler bug to me. Something is not checked when the call is verifie

Re: How to pass noncopyable variadic arguments with ref?

2022-10-20 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 20 October 2022 at 14:03:10 UTC, tchaloupka wrote: Hi, I've found strange behavior where: ```D import std.stdio; struct Foo { @disable this(this); int x; } void test(Foo[] foos...) { foreach (ref f; foos) { writeln(&f, ": ", f.x); f.x = 0; } } void

How to pass noncopyable variadic arguments with ref?

2022-10-20 Thread tchaloupka via Digitalmars-d-learn
Hi, I've found strange behavior where: ```D import std.stdio; struct Foo { @disable this(this); int x; } void test(Foo[] foos...) { foreach (ref f; foos) { writeln(&f, ": ", f.x); f.x = 0; } } void main() { Foo f1 = Foo(1); Foo f2 = Foo(2); writeln("

Re: Catching C errors

2022-10-20 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 20 October 2022 at 12:14:38 UTC, jmh530 wrote: On Thursday, 20 October 2022 at 11:59:45 UTC, data pulverizer wrote: [snip] Mine is also private for now till it reaches an acceptable state when I'll think about whether it should be publicly released or jealously guarded. It's a pro

Re: Compiler Error while using Validation in the hunt-framework

2022-10-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/19/22 3:00 PM, Roman Funk wrote: Hello, I started playing with D and the hunt-framework. But I bumped into an error using Validation. ```d module app.forms.LoginForm; import hunt.validation; import hunt.framework.http.Form; class LoginForm : Form {     mixin MakeForm;     @Email    

Re: Catching C errors

2022-10-20 Thread bachmeier via Digitalmars-d-learn
On Thursday, 20 October 2022 at 10:13:41 UTC, Sergey wrote: On Thursday, 20 October 2022 at 09:52:05 UTC, data pulverizer wrote: I'm currently writing a D interop with R, the dynamic statistical programming language. There's a function called How is your project related to EmbedR? The descrip

Re: Catching C errors

2022-10-20 Thread jmh530 via Digitalmars-d-learn
On Thursday, 20 October 2022 at 11:59:45 UTC, data pulverizer wrote: [snip] Mine is also private for now till it reaches an acceptable state when I'll think about whether it should be publicly released or jealously guarded. It's a project I'm building for my own use really. It can't hurt to

Re: Catching C errors

2022-10-20 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 20 October 2022 at 10:13:41 UTC, Sergey wrote: On Thursday, 20 October 2022 at 09:52:05 UTC, data pulverizer wrote: I'm currently writing a D interop with R, the dynamic statistical programming language. There's a function called How is your project related to EmbedR? The descrip

Re: Catching C errors

2022-10-20 Thread Sergey via Digitalmars-d-learn
On Thursday, 20 October 2022 at 09:52:05 UTC, data pulverizer wrote: I'm currently writing a D interop with R, the dynamic statistical programming language. There's a function called How is your project related to EmbedR? The description of the project could be found here: https://dlang.org/b

Re: Catching C errors

2022-10-20 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 16:48:10 UTC, Ali Çehreli wrote: On 10/19/22 07:05, data pulverizer wrote: > I am calling code from a C API, and would like to know how to catch exit > errors If you are talking about the exit() Posix function, you can't do anything about that because its purpo

Re: Hipreme's #1 Tip of the day

2022-10-20 Thread Sergey via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 23:28:46 UTC, Hipreme wrote: Hey guys, I'm going to start making a tip of the day (although I'm pretty sure I won't be able to give every day a tip), but those things are really interesting to newcomers to know and may be obvious to some of the old schoolers the