dune icon indicating copy to clipboard operation
dune copied to clipboard

Allow variables in the payload of `%{read*:<path>}`

Open MisterDA opened this issue 4 weeks ago • 3 comments

The payload for %{read:<path>} (also read-lines and read-strings) is treated as strings but there is no reason is couldn't be expanded further.

MisterDA avatar Nov 28 '25 14:11 MisterDA

Yeah, this is a good point. Unfortunately, our little DSL for pforms is quite limited. So in order to implement this feature we need an alternative way (preferably using sexps) to express such pforms.

rgrinberg avatar Nov 28 '25 14:11 rgrinberg

One possibility is to extend the existing syntax to allow %{<sexp>}. Macros %{foo:bar} could be considered as shorthands for %{(foo "bar")}. It is not very pretty though.

nojb avatar Nov 30 '25 07:11 nojb

I suppose doing %(<sexp...>) could break user code without a version gate. That could be just more pleasant than using both curly and curvy parentheses

MisterDA avatar Dec 08 '25 21:12 MisterDA