-
Notifications
You must be signed in to change notification settings - Fork 5
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
Enhancement: add "|none" to each named argument of each code section method #78
Comments
|
It would make the prototypes too complicated. Try to use tuples to make attribute lists. |
Currently impossible/difficult due to bug daokoder/dao#507 . |
Bug daokoder/dao#507 has been fixed, but the example doesn't work anyway. What did you mean by Try to use tuples to make attribute lists.? |
routine r(...: tuple<enum<x>, int>|tuple<enum<y>, string> as args) { io.writeln(args) }
t = 0 == 0 ? (($x,9),) : (($y, "c"), ($x,3))
r(t, ...) This also doesn't work (of course, because tuple types are not matching), even though it can be solved pretty easily with casting to |
Only that you can attempt to construct tuples of arguments based on your conditions and then pass them to tag functions. |
Currently it's impossible to simply express, that one doesn't want to mention an attribute in some cases, but does want to in other cases
anchor(_class=%c ? c : none){ ...
. This might be easily achieved by enhancing the interface of each code section method argument with|none
with the following semantics:anchor(href=none){}
-><a></a>
anchor(href=5){}
-><a href="5"></a>
none
could be also used with the same semantics for return values of code section methods:anchor { "" }
-><a></a>
anchor {}
->->
But this use for whole tags seems slightly odd, even though it's handy.
The text was updated successfully, but these errors were encountered: