Re: BetterC unexpected results

2023-01-08 Thread areYouSureAboutThat via Digitalmars-d-learn
On Sunday, 8 January 2023 at 13:49:22 UTC, DLearner wrote: I thought dynamic arrays were unavailable under -betterC. .. ... See the 'Retained Features' section, and the 'Unavailable Features' section https://dlang.org/spec/betterc.html

Re: Address of a class object

2023-01-05 Thread areYouSureAboutThat via Digitalmars-d-learn
On Thursday, 5 January 2023 at 17:23:39 UTC, H. S. Teoh wrote: On Thu, Jan 05, 2023 at 06:32:47AM +, areYouSureAboutThat Also, I cannot read hex, [...] IMNSHO, anyone who claims to be a programmer should at least know that much. ?? Well, like all, I learnt this at uni. .. as well as

Re: forgetting -betterC means no runtime bounds checking?

2023-01-05 Thread areYouSureAboutThat via Digitalmars-d-learn
On Thursday, 5 January 2023 at 09:10:00 UTC, areYouSureAboutThat wrote: btw. the output (when you forget to use -betterC): 0 1 2 3 4 src/rt/dwarfeh.d:330: uncaught exception reached top of stack This might happen if you're missing a top level catch in your fiber or signal handler

forgetting -betterC means no runtime bounds checking?

2023-01-05 Thread areYouSureAboutThat via Digitalmars-d-learn
I was playing around with betterC, when I discovered, that if i accidently forget to provide -betterC to the compiler, it will still compile this, but, there will be no runtime bounds checking occuring. My question is: why is there no bounds checking occurring if I forget to use -betterC?

Re: Address of a class object

2023-01-04 Thread areYouSureAboutThat via Digitalmars-d-learn
On Thursday, 5 January 2023 at 04:04:39 UTC, Paul wrote: .. Do I have this much right? ... First, i would say, add @safe to your main. @safe void main() ... Then you will see you are treading on dangerous waters ;-) Second, to be sure your getting the correct results, it would be nice if

Re: Compile time vs run time -- what is the difference?

2022-12-28 Thread areYouSureAboutThat via Digitalmars-d-learn
On Wednesday, 28 December 2022 at 12:42:24 UTC, thebluepandabear wrote: Before even running the code I get an IDE warning (IntelliJ). Does IntelliJ compile the code in the background? It will NOT compile successfully unless you do one of these things: (1) ensure the result of the 'static

Re: Compile time vs run time -- what is the difference?

2022-12-28 Thread areYouSureAboutThat via Digitalmars-d-learn
On Wednesday, 28 December 2022 at 02:31:45 UTC, thebluepandabear wrote: .. Other errors are only able to be spotted during run time such as exceptions, dividing by zero, assert blocks. With regards to the 'assert blocks' you mention, D (like C++) has both static assert and runtime assert.

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: 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

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

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 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 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