Add support for #use_output "<command>" (was: #use "| <command>")#9283
Add support for #use_output "<command>" (was: #use "| <command>")#92835 commits merged intotrunkfrom unknown repository
#use "| <command>")#9283Conversation
|
I have no particular thoughts on the feature itself, but the syntax seems unnecessarily opaque. Why not use something like |
|
The pipe syntax looks nicer to me, but happy to go with the flow for the syntax really. |
|
I think Leo's suggestion of a new directive such as |
#use "| <command>")
|
That's a good point. I updated the PR to add a new directive |
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
#use "| <command>")#use "| <command>")
Co-Authored-By: David Allsopp <david.allsopp@metastack.com>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
|
This is a trivial addition to a non-critical part of the compiler, so I'm merging this. |
Regression from ocaml#9283. Fixes ocaml#9455
This PR adds a new toplevel directive
#use_output "<command>"for running a command and evaluating its output.This feature allows to embed toplevel scripts directly in executables. This is nice when you want to distribute a self-contained relocatable binary and provide some toplevel features.
I would like to use this feature in Dune to provide
#use_command "dune top". It would work in any toplevel and supersededune utop(cf ocaml/dune#2952).