Replies: 3 comments 5 replies
-
Thanks for the suggestion. It would indeed be nice to have something like this and we've added something similar with |
Beta Was this translation helpful? Give feedback.
-
I may perhaps try to propose a PR… but I would have to discover the dune architecture before being able to propose something. A grep « :include » may help finding the spots where to include the « :if » implementation (once it is developed).--Frédéric LoyerLe 3 mars 2024 à 16:28, Rudi Grinberg ***@***.***> a écrit :
Thanks for the suggestion. It would indeed be nice to have something like this and we've added something similar with cond for lock directory selection. The only problem is that I'm really not a fan of having to annotate every special value with :if. Unfortunately, I don't have an alternative to propose either, so I suppose this is fine. @gridbugs do you have an opinion on this?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Sounds like a useful addition. If you haven't already, check out this page in our docs which states that we intend to add such a feature one day: https://dune.readthedocs.io/en/stable/reference/ordered-set-language.html
@rgrinberg I don't understand what you mean by:
Can you elaborate on what you mean by "special value". |
Beta Was this translation helpful? Give feedback.
-
Many stanzas supports an
(:include)
argument, but if we simply want a conditional argument, we need to declare a pair of rules like:With an
(:if)
argument, we can imagine something like:Ideally, the
(:if)
could also be used in the form(:if (condition) (if_true_value) (if_false_value))
, and theif_true_value
orif_false_value
could also be written as a nested(:if)
argument (https://github.com/lukstafi/ocaml-gccjit/blob/master/lib/dune gives a more complex example where nested:if
would be needed.We can also go further with
if_true_value
orif_false_value
using(:include)
(use case: having multiple static included files, and the:if
select the right one. But I admit it to be less usefull).Beta Was this translation helpful? Give feedback.
All reactions