Re: More Elegant Settable Methods?

2023-01-29 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 21 January 2023 at 23:07:45 UTC, jwatson-CO-edu wrote: I am trying to create a struct with a settable method that has access to the struct scope. Is this the only way? Is there a way to give access without explicitly passing `this`? Why not use the delegate? What exactly do you

Which TOML package, or SDLang?

2023-01-29 Thread Daren Scot Wilson via Digitalmars-d-learn
So, which package do I use for TOML? I find these three: * toml-foolery (Andrej Petrović) * toml-d, or toml.d (oglu on github) at ver 0.3.0 * toml, (dlang community on github) at ver 2.0.1 I'm guessing from version numbers that the third one, toml, is officially good for real world use. But

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-01-29 Thread RTM via Digitalmars-d-learn
On Saturday, 28 January 2023 at 23:19:35 UTC, ProtectAndHide wrote: That is, you can do OOP without classes How so? Every OOP definition includes classes (encapsulation + inheritance).

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-01-29 Thread thebluepandabear via Digitalmars-d-learn
I hate a world with the classes. I can do almost anything I want without the classes. The software world soared above C without classes. SDB@79 As I said in my email to you -- each to their own. There's no point in arguing about whether OOP is the best method of doing things or procedural

Re: How to get the body of a function/asm statement in hexadecimal

2023-01-29 Thread Ali Çehreli via Digitalmars-d-learn
On 1/29/23 14:19, max haughton wrote: > it is not trivial to find where the *end* of a > function is I suspected as much and did run ... > objdump ... to fool myself into thinking that 0xc3 was . Well, arguments e.g. pointer values can have 0xc3 bytes in them. So, yes, I am fooled! :) Ali

Re: How to get the body of a function/asm statement in hexadecimal

2023-01-29 Thread max haughton via Digitalmars-d-learn
On Sunday, 29 January 2023 at 21:45:11 UTC, Ruby the Roobster wrote: I'm trying to do something like ```d void main() { auto d = *d.writeln; } void c() { } ``` In an attempt to get the hexadecimal representation of the machine code of a function. Of course, function pointers

Re: How to get the body of a function/asm statement in hexadecimal

2023-01-29 Thread Ali Çehreli via Digitalmars-d-learn
On 1/29/23 13:45, Ruby the Roobster wrote: > Of course, function pointers cannot be dereferenced. Since you want to see the bytes, just cast it to ubyte*. The following function dumps its own bytes: import std; void main() { enum end = 0xc3; for (auto p = cast(ubyte*)&_Dmain; true;

How to get the body of a function/asm statement in hexadecimal

2023-01-29 Thread Ruby the Roobster via Digitalmars-d-learn
I'm trying to do something like ```d void main() { auto d = *d.writeln; } void c() { } ``` In an attempt to get the hexadecimal representation of the machine code of a function. Of course, function pointers cannot be dereferenced. What do? Furthermore, I would like to be able to

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-01-29 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 28 January 2023 at 23:19:35 UTC, ProtectAndHide wrote: On Wednesday, 25 January 2023 at 15:43:46 UTC, ryuukk_ wrote: using static class and static function is not "OOP way" of doing things, it's a hack to mimic procedural style because Java doesn't have proper modules / scoping