Re: Group dots not working

2023-12-19 Thread Joel via Digitalmars-d-learn
On Wednesday, 20 December 2023 at 01:45:57 UTC, Joel wrote: The dots are supposed to keep moving till they hit something then change direction. [...] Oh, I found the problem, I wasn't resetting the hit bool variable.

Re: Operator "+=" overloading for class?

2023-12-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On Monday, 18 December 2023 at 14:38:14 UTC, Ki Rill wrote: your code just return result value, but it should not return but save result to "this" see example at https://dlang.org/spec/operatoroverloading.html#index_op_assignment I get an error, but don't understand why. ```d auto

Group dots not working

2023-12-19 Thread Joel via Digitalmars-d-learn
The dots are supposed to keep moving till they hit something then change direction. Using DotsLogicType.solid the move at first, but then stop moving once they hit something. What supposed to happen: First they check left or right (depending on the dir.x is negative or positive). If no dots

Re: serve-d and emacs

2023-12-19 Thread Renato via Digitalmars-d-learn
On Thursday, 20 April 2023 at 19:54:11 UTC, Christian Köstlin wrote: I tried to reproduce my old eglot experiment, and for me serve-d was not even compiling with the newest dmd. Which versions are you using? Kind regards, Christian I've just managed to make Emacs 29 work with serve-d using

Re: SIGSEGV (Segmentation Fault) upon setting character in char array (object member var)

2023-12-19 Thread John Kiro via Digitalmars-d-learn
On Tuesday, 19 December 2023 at 14:01:31 UTC, John Kiro wrote: Thanks Adam. I agree, the behavior associated with the initialization here is confusing (compared for example to a similarly-looking code in Java). Also I don't get why an array of characters would be considered as an immutable

Re: SIGSEGV (Segmentation Fault) upon setting character in char array (object member var)

2023-12-19 Thread John Kiro via Digitalmars-d-learn
Thanks Adam. I agree, the behavior associated with the initialization here is confusing (compared for example to a similarly-looking code in Java). Also I don't get why an array of characters would be considered as an immutable array of characters (that is a **string**). I agree this could be

Re: SIGSEGV (Segmentation Fault) upon setting character in char array (object member var)

2023-12-19 Thread Adam D Ruppe via Digitalmars-d-learn
On Tuesday, 19 December 2023 at 13:10:40 UTC, John Kiro wrote: class Test { static enum MAX = 10; uint index = 0; auto intArray = new int[MAX]; auto charArray = new char[MAX]; This is run at compile time, and the compiler treats any char array at compile time

SIGSEGV (Segmentation Fault) upon setting character in char array (object member var)

2023-12-19 Thread John Kiro via Digitalmars-d-learn
Hello there, First time to experiment with DLang, after a long time. I'm getting a weird behavior with an **array of chars**, where I get a segmentation fault upon writing to it (see code and output below). What makes this problem weird it two things: 1) Why there is no problem with the