Re: How to compiler dlang code on Apple M1?

2022-12-13 Thread zoujiaqing via Digitalmars-d-learn
On Saturday, 3 December 2022 at 20:33:59 UTC, Steven Schveighoffer wrote: The issue is dub. Make sure you are using the dub built for ARM. What Apple does is if any program in the same process group is x86 specific, then all the executed programs that are universal (including the linker)

Re: How to compiler dlang code on Apple M1?

2022-12-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/13/22 9:35 AM, zoujiaqing wrote: On Saturday, 3 December 2022 at 20:33:59 UTC, Steven Schveighoffer wrote: The issue is dub. Make sure you are using the dub built for ARM. What Apple does is if any program in the same process group is x86 specific, then all the executed programs that

Re: Is remove safe using foreach

2022-12-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/13/22 6:22 AM, Per Nordlöw wrote: On Monday, 12 December 2022 at 17:29:00 UTC, Steven Schveighoffer wrote: Removing keys while iterating is not supported. It will break, in confusing ways, and possibly include a null pointer dereference. IRC, the specs says that it's an error to modify

Re: Is remove safe using foreach

2022-12-13 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 12 December 2022 at 17:29:00 UTC, Steven Schveighoffer wrote: Removing keys while iterating is not supported. It will break, in confusing ways, and possibly include a null pointer dereference. IRC, the specs says that it's an error to modify a foreach aggregate but the compiler

Re: Is remove safe using foreach

2022-12-13 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 11:22:35 UTC, Per Nordlöw wrote: IRC, the specs says that it's an error to modify a foreach aggregate but the compiler curretly doesn't diagnose it. I believe it should.

Re: How to compiler dlang code on Apple M1?

2022-12-13 Thread rikki cattermole via Digitalmars-d-learn
Which ldc did you install? Was it: ldc2-1.30.0-osx-arm64.tar.xz

Re: How to compiler dlang code on Apple M1?

2022-12-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/13/22 10:20 AM, Steven Schveighoffer wrote: Yeah, that's a known issue: https://github.com/ldc-developers/ldc/issues/3864 Try building with `-b plain` to avoid the debug build Oh, also, I have MACOSX_DEPLOYMENT_TARGET=11 in my environment, that helps to avoid it as well. -Steve

Re: Is there such concept of a list in D?

2022-12-13 Thread ryuukk_ via Digitalmars-d-learn
On Monday, 12 December 2022 at 07:57:28 UTC, TTK Ciar wrote: On Sunday, 11 December 2022 at 17:45:20 UTC, ryuukk_ wrote: Why is it called ``DList`` and not just ``List``, i have no clue Probably because it is a *D*ouble-linked List :-) oh right, thanks, i never used that module before i

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Saturday, 10 December 2022 at 15:59:07 UTC, Ali Çehreli wrote: ... Object orientation don't go well with collections On what basis do you make that assertion? i.e. Which aspect of OOP programming 'don't go well with collections'? Is it encapsulation? Is it inheritance? Is it

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 23:34:45 UTC, Salih Dincer wrote: We have nothing to do with unsafe stuff! Why do we waste time with unsafe things; To learn or to teach? SDB@79 btw. I reject your axiom: 'We have nothing to do with unsafe stuff!' It is demonstratably not correct, given

How to use version in dub?

2022-12-13 Thread Leonardo A via Digitalmars-d-learn
Hello. How to use version in dub? https://dlang.org/spec/version.html "The version level and version identifier can be set on the command line by the -version" I tried everything but noting.

Re: How to use version in dub?

2022-12-13 Thread torhu via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 19:28:44 UTC, Leonardo A wrote: Hello. How to use version in dub? https://dlang.org/spec/version.html "The version level and version identifier can be set on the command line by the -version" I tried everything but noting. In SDL syntax, either at the top

Re: How to use version in dub?

2022-12-13 Thread torhu via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 19:50:15 UTC, torhu wrote: On Tuesday, 13 December 2022 at 19:28:44 UTC, Leonardo A wrote: Hello. How to use version in dub? https://dlang.org/spec/version.html "The version level and version identifier can be set on the command line by the -version" I tried

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Saturday, 10 December 2022 at 06:11:18 UTC, thebluepandabear wrote: I was wondering more if there is an object oriented way of creating arrays, like in Java there is an `ArrayList`, in C++ there is `std::vector`, etc. of course there is - I mean just imagine if there wasn't ;-) e.g (an

Re: Is there such concept of a list in D?

2022-12-13 Thread Salih Dincer via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 22:51:13 UTC, areYouSureAboutThat wrote: On Saturday, 10 December 2022 at 06:11:18 UTC, thebluepandabear wrote: I was wondering more if there is an object oriented way of creating arrays, like in Java there is an `ArrayList`, in C++ there is `std::vector`,

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 23:34:45 UTC, Salih Dincer wrote: We have nothing to do with unsafe stuff! Why do we waste time with unsafe things; To learn or to teach? SDB@79 @trusted class unsafeVector ... now it's @safe ;-)

Re: arsd.jni

2022-12-13 Thread jni via Digitalmars-d-learn
On Monday, 12 December 2022 at 15:03:13 UTC, Adam D Ruppe wrote: On Monday, 12 December 2022 at 11:17:47 UTC, jni wrote: It's good. But you did the java bindings by hand or is there a generator in arsd.jni for that too? It does it automatically. You compile jni.d with

Re: How to use version in dub?

2022-12-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/13/22 3:35 PM, ryuukk_ wrote: On Tuesday, 13 December 2022 at 20:01:40 UTC, torhu wrote: On Tuesday, 13 December 2022 at 19:50:15 UTC, torhu wrote: On Tuesday, 13 December 2022 at 19:28:44 UTC, Leonardo A wrote: Hello. How to use version in dub? https://dlang.org/spec/version.html "The

Re: How to use version in dub?

2022-12-13 Thread ryuukk_ via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 20:01:40 UTC, torhu wrote: On Tuesday, 13 December 2022 at 19:50:15 UTC, torhu wrote: On Tuesday, 13 December 2022 at 19:28:44 UTC, Leonardo A wrote: Hello. How to use version in dub? https://dlang.org/spec/version.html "The version level and version identifier

Re: Is there such concept of a list in D?

2022-12-13 Thread Ali Çehreli via Digitalmars-d-learn
On 12/13/22 14:21, areYouSureAboutThat wrote: > On Saturday, 10 December 2022 at 15:59:07 UTC, Ali Çehreli wrote: >> >> ... Object orientation don't go well with collections > > On what basis do you make that assertion? You stripped my answer. > i.e. Which aspect of OOP programming 'don't

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 22:33:02 UTC, Ali Çehreli wrote: Or I can tell what I think, you counter, and we all learn. Proofs... Axioms... Pfft... Ali "I suppose sir, you are going to explain your puzzling remarks."

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 23:34:45 UTC, Salih Dincer wrote: We have nothing to do with unsafe stuff! Why do we waste time with unsafe things; To learn or to teach? SDB@79 Really? That example I provided was just to demonstrate that 'yes' you can implement a container using OOP. I