Re: Get parent function of nested delegate

2025-03-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 16, 2025 12:38:09 AM MDT Anonymouse via Digitalmars-d-learn wrote: > I want to get a reference to a parent function from inside a > nested function. I need it for `getUDAs!(parentFunction, > attribute)`. > > `__traits(parent, mixin(__FUNCTION__))` works inside the parent > func

Re: Get parent function of nested delegate

2025-03-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, March 17, 2025 6:28:19 PM MDT Jonathan M Davis via Digitalmars-d-learn wrote: > On Sunday, February 16, 2025 12:38:09 AM MDT Anonymouse via > Digitalmars-d-learn wrote: > > I want to get a reference to a parent function from inside a > > nested function. I need it for `getUDAs!(parentF

Subclass TcpSocket?

2025-03-17 Thread Andy Valencia via Digitalmars-d-learn
The presence of the "accepting" API in Socket seems to indicate that subclassing Socket/TcpSocket is intended to be supported. But I'm just not seeing my way through the twisty maze of pure and @nothrow barriers? Andy import std.socket : TcpSocket, Address, getAddress; class Wrapped

Re: Generate PDF or HTML of source

2025-03-17 Thread Andrea Fontana via Digitalmars-d-learn
On Sunday, 16 March 2025 at 16:26:55 UTC, Anonymouse wrote: I want to generate PDFs of the individual source files of my project. Preferably with syntax highlighting, but if pressed I could live without it for this particular case. I would like line numbers though. HTML is fine too as I could

Re: Newbie style question about string constants

2025-03-17 Thread Ian via Digitalmars-d-learn
On Monday, 17 March 2025 at 08:27:17 UTC, Jonathan M Davis wrote: In any case, the normal way in D to declare a string constant is to use enum. So, that's primarily what you're going to see in most code. Whether you choose to do that in your own code is up to you. - Jonathan M Davis Hi Jo

Re: _memsetFloat Error with dmd

2025-03-17 Thread Paul Backus via Digitalmars-d-learn
On Monday, 17 March 2025 at 12:28:38 UTC, Maximilian Naderer wrote: Hello people, i have the following example. Compiled with dmd and ldc2 dmd main.d -betterC ldc2 main.d -betterC with dmd the compilation fails with lld-link: error: undefined symbol: _memsetFloat >>> referenced by app

Re: _memsetFloat Error with dmd

2025-03-17 Thread Maximilian Naderer via Digitalmars-d-learn
On Monday, 17 March 2025 at 12:28:38 UTC, Maximilian Naderer wrote: Hello people, i have the following example. Compiled with dmd and ldc2 dmd main.d -betterC ldc2 main.d -betterC with dmd the compilation fails with lld-link: error: undefined symbol: _memsetFloat >>> referenced by app

Re: Newbie style question about string constants

2025-03-17 Thread monkyyy via Digitalmars-d-learn
On Sunday, 16 March 2025 at 15:22:04 UTC, Ian wrote: It seems that in some cases static immutable is preferred, so why not use that always then, rather than having to keep two cases in my head? Enum is the indispensable one, immutable isnt important just theres a subsection of the community t

Re: Newbie style question about string constants

2025-03-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, March 16, 2025 9:22:04 AM MDT Ian via Digitalmars-d-learn wrote: > On Tuesday, 25 February 2025 at 00:34:45 UTC, Jonathan M Davis > wrote: > > For strings, the way that you normally do constants is with > > enum, e.g > > > > enum foo = "dlang"; > > > > An enum like this is called a m