import(__FILE_LITERAL__)
monkyyy
crazymonkyyy at gmail.com
Mon Sep 9 19:59:37 UTC 2024
On Monday, 9 September 2024 at 19:00:32 UTC, Daniel N wrote:
> 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()
> ```
Special token sequences are a major source of magic, my compile
time counter pattern uses `__LINE__` for example
Fundamentally if you want a template to be de-auto-memoized, your
probably putting in a a token sequence in the header
More information about the dip.ideas
mailing list