www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - appendable alias squence

reply monkyyy <crazymonkyyy gmail.com> writes:
https://monkyyy.science/posts/mutable_templates/

https://github.com/crazymonkyyy/aliaslist

https://run.dlang.io/is/NeEq8Z

Tried to explain how my appendable alias sequence works ¯\_(ツ)_/¯

it uses compiler bugs and is likely fragile, but here it is 
anyway.
Jan 31
next sibling parent reply Nick Treleaven <nick geany.org> writes:
On Tuesday, 1 February 2022 at 01:39:19 UTC, monkyyy wrote:
 https://monkyyy.science/posts/mutable_templates/
I only skimmed the article as I'm AFK, but:
 I hate verbose folds, I hate this syntax, I hate that the 
 pieces are in a different order then for loops; but its how to 
 do heavy lifting in templates.
Perhaps alias assign would help? It might actually be related to why the `foo=foo_!(data);` bug 'works'. https://dlang.org/spec/declaration.html#AliasAssign
Feb 01
parent reply monkyyy <crazymonkyyy gmail.com> writes:
On Tuesday, 1 February 2022 at 15:30:17 UTC, Nick Treleaven wrote:
 On Tuesday, 1 February 2022 at 01:39:19 UTC, monkyyy wrote:
 https://monkyyy.science/posts/mutable_templates/
I only skimmed the article as I'm AFK, but:
 I hate verbose folds, I hate this syntax, I hate that the 
 pieces are in a different order then for loops; but its how to 
 do heavy lifting in templates.
Perhaps alias assign would help? It might actually be related to why the `foo=foo_!(data);` bug 'works'. https://dlang.org/spec/declaration.html#AliasAssign
I doubt bug is related to alias assign given I found it before (I think), and while I haven't played with alias assign yet I think theres going to be some baseline safety features to attempt making this sort of thing not happen
Feb 01
parent monkyyy <crazymonkyyy gmail.com> writes:
The AliasAssign and its corresponding AliasDeclaration must both 
be declared in the same TemplateDeclaration.
These are outside the template, so I really doubt they are related unless this aspect is purely to minimize fun
Feb 01
prev sibling parent reply max haughton <maxhaton gmail.com> writes:
On Tuesday, 1 February 2022 at 01:39:19 UTC, monkyyy wrote:
 https://monkyyy.science/posts/mutable_templates/

 https://github.com/crazymonkyyy/aliaslist

 https://run.dlang.io/is/NeEq8Z

 Tried to explain how my appendable alias sequence works 
 ¯\_(ツ)_/¯

 it uses compiler bugs and is likely fragile, but here it is 
 anyway.
The array template parameter bug will probably be fixed in the next release, just warning you.
Feb 01
parent monkyyy <crazymonkyyy gmail.com> writes:
On Tuesday, 1 February 2022 at 19:19:55 UTC, max haughton wrote:
 On Tuesday, 1 February 2022 at 01:39:19 UTC, monkyyy wrote:
 https://monkyyy.science/posts/mutable_templates/

 https://github.com/crazymonkyyy/aliaslist

 https://run.dlang.io/is/NeEq8Z

 Tried to explain how my appendable alias sequence works 
 ¯\_(ツ)_/¯

 it uses compiler bugs and is likely fragile, but here it is 
 anyway.
The array template parameter bug will probably be fixed in the next release, just warning you.
breaking my workflow >:( it maybe sorta coulda been useful in this one idea I put at the bottom of my todo list
Feb 02