Re: Hipreme's #1 Tip of the day

2022-10-19 Thread z 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

Hipreme's #1 Tip of the day

2022-10-19 Thread Hipreme via Digitalmars-d-learn
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 there. Always public import a type that the user (including

Re: Find out what type my class is being converted to for comparisons

2022-10-19 Thread ryuukk_ via Digitalmars-d-learn
On Tuesday, 18 October 2022 at 18:53:41 UTC, Matthew Rushworth wrote: I am in the process of building a matrix class (uni project, with my choice of programming language) and appear to have run into a problem that I'm not too sure how to fix. My class uses templates to define the shape of the

Re: Catching C errors

2022-10-19 Thread ryuukk_ via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 16:47:49 UTC, data pulverizer wrote: On Wednesday, 19 October 2022 at 14:05:35 UTC, data pulverizer wrote: Hi all, I am calling code from a C API, and would like to know how to catch exit errors so that they can be handled and make them more like an

Compiler Error while using Validation in the hunt-framework

2022-10-19 Thread Roman Funk via Digitalmars-d-learn
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 string name; @Length(3,8) string

Re: Catching C errors

2022-10-19 Thread Ali Çehreli via Digitalmars-d-learn
On 10/19/22 09:47, data pulverizer wrote: > It's okay, I've found a work around. Do you simply check the return value? Ali

Re: Catching C errors

2022-10-19 Thread Ali Çehreli via Digitalmars-d-learn
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 purpose is to cause "normal process termination". Ali

Re: Catching C errors

2022-10-19 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 14:05:35 UTC, data pulverizer wrote: Hi all, I am calling code from a C API, and would like to know how to catch exit errors so that they can be handled and make them more like an exceptions so that the computation can continue. I've tried something similar

Catching C errors

2022-10-19 Thread data pulverizer via Digitalmars-d-learn
Hi all, I am calling code from a C API, and would like to know how to catch exit errors so that they can be handled and make them more like an exceptions so that the computation can continue. I've tried something similar to what is outlined here: https://dlang.org/phobos/object.html#.Error

Re: Find out what type my class is being converted to for comparisons

2022-10-19 Thread rassoc via Digitalmars-d-learn
On 10/19/22 00:43, Matthew Rushworth via Digitalmars-d-learn wrote: Thank you, that worked perfectly, not sure exactly what I did wrong, I'm assuming I forgot to make the parameter a const variable Object, the root of the class object hierarchy already defines an opEquals [1] and you need to

Re: Can someone tell me what the compiler thought I was trying to do?

2022-10-19 Thread zjh via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 05:41:26 UTC, zjh wrote: Why always afraid to `add features`? C++ is `so complicated` ,but that people are not afraid to continue to `add features`. Look at the `emerging` languages, which are not crazy about `adding features`. Even `go` is adding generics.

Re: Can someone tell me what the compiler thought I was trying to do?

2022-10-19 Thread zjh via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 05:50:18 UTC, zjh wrote: In my opinion, as long as `users` have reasonable needs, languages should added corresponding features, instead of becoming religions. `Some features` are very popular for users,I really don't know why they didn't add it. When you