digitalmars.D.learn - import locality with function parameters
- Carl Sturtivant (11/11) Feb 01 Hello,
- Steven Schveighoffer (4/15) Feb 01 Are you thinking of this?
- Carl Sturtivant (4/7) Feb 01 Yes! Glad it's now part of D.
Hello, I seem to recall that there is surprising template to import a module and get a type from it inside the declaration of the type of a parameter to a function, so that the module need not be imported outside of the function definition. I think there was a blog article some years ago about this where there was some indication that this or something with equivalent effect would be incorporated into D in some way. How do I define a function with a parameter that is a type in an outside module while keeping module import local to that definition?
Feb 01
On Friday, 2 February 2024 at 00:29:51 UTC, Carl Sturtivant wrote:Hello, I seem to recall that there is surprising template to import a module and get a type from it inside the declaration of the type of a parameter to a function, so that the module need not be imported outside of the function definition. I think there was a blog article some years ago about this where there was some indication that this or something with equivalent effect would be incorporated into D in some way. How do I define a function with a parameter that is a type in an outside module while keeping module import local to that definition?Are you thinking of this? https://dlang.org/phobos/object.html#.imported -Steve
Feb 01
On Friday, 2 February 2024 at 01:23:11 UTC, Steven Schveighoffer wrote:Are you thinking of this? https://dlang.org/phobos/object.html#.imported -SteveYes! Glad it's now part of D. Thank you.
Feb 01