import(__FILE_LITERAL__)

Daniel N no at public.email
Mon Sep 9 19:00:32 UTC 2024


On Monday, 9 September 2024 at 18:18:31 UTC, monkyyy wrote:
>
> ---
>
> I suggest that its safe to read the file the user is compiling 
> during compilation. I suggest that new special token that 
> generates ... something that an import expression can take 
> without a `-J=.`.
>
> ```d
> import foo;//lolz
> import std;
> enum string=import(__FILE_LITERAL__).split('/n').front;// 
> "import foo;//lolz"
> ```
>
> By separating it into two step process you could use the 
> special token magic
> `void foo(alias file=__FILE_LITERAL__,int line=__LINE__)(){`

I like this idea, I had the same need, although wouldn't it work 
with parameterless import?

```d
import()
```


More information about the dip.ideas mailing list