-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
super + include #172
Comments
My first reaction is that this would be awfully difficult to follow, because despite the name, it would not be obvious at all which template would Trying to pretend this has anything to do with inheritance would be a rather bad idea. Pan does not have any concept of objects, and this super construct would not behave like one would naively expect from any object-oriented language. Calling it If you want to make include if_exists("X_custom"); That would make the control flow much easier to follow. The reason we don't need this construct is not due to the templates Aquilon generates, but because we're not afraid of just editing Note that dependency tracking around |
Also, if you want to pretend there's some kind of inheritance going on, then I'd really expect |
@gombasg thanks a lot for the feedback. i admit i didn't give it that much thought yet 😉 the syntax should actually be wrt i really like the idea that aquilon generates this for you, so it's there to use, but you don't have to add it yourself. i do not think your remark wrt |
Discussed at RAL workshop. @gombasg will write up his proposed solution in this issue. |
@gombasg any updates? |
I'm just looking at the issue/proposal but I find it a very complicated and potentially ambiguous approach to something that can be done with a proper layout of templates. Waiting for @gombasg summary! |
i ran into this a few times already, and wondered if the following would make sense:
given includes and/or loadpath with order
dir1,dir2
, when we have a template X in dir2, and do aninclude X
and the template fromdir2/X
gets included.but sometimes we want to customise (who doesn't), and would like to do the following: make a template
dir1/X
, that also includesdir2/X
. we now renamedir1/X
todir1/XY
and do aninclude X
indir1/X
to get the default/normal behaviour.keeping the name
X
is just much nicer; but it would require asuper include X
to include thedir2/X
instead of creating a loop.i use
super
because it looks to me this is very similar to what class inheritance uses.maybe there's a good reason why this is not available in pan, but i can't think of one...
(i'm aware that aquilon injects a lot of pre and post templates automagically, so less of an issue there, but we aren't using aquilon yet 😄
The text was updated successfully, but these errors were encountered: