diff options
author | Arun Isaac | 2023-10-09 13:47:36 +0100 |
---|---|---|
committer | Arun Isaac | 2023-10-09 14:50:51 +0100 |
commit | 548cc54bc27b92c3a35a79d1af7440fbad896752 (patch) | |
tree | 759b53c95f871451a77e37d8403444041051eb57 /ccwl/ccwl.scm | |
parent | 3e8dac4240eb1f3abe46ce0efac83a97283b8fcc (diff) | |
download | ccwl-548cc54bc27b92c3a35a79d1af7440fbad896752.tar.gz ccwl-548cc54bc27b92c3a35a79d1af7440fbad896752.tar.lz ccwl-548cc54bc27b92c3a35a79d1af7440fbad896752.zip |
ccwl: In macro expansion, use eval instead of module introspection.
eval is not just more portable but also more flexible. It lets us
allow steps with expressions that evaluate to commands. Sadly, we do
not yet properly support commands defined in lexical scope.
* ccwl/ccwl.scm (function-object): Use eval instead of module
introspection.
* tests/ccwl.scm ("allow steps with expressions that evaluate to
commands"): New test.
Diffstat (limited to 'ccwl/ccwl.scm')
-rw-r--r-- | ccwl/ccwl.scm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index 00d503f..b158947 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -412,12 +412,12 @@ object or a <cwl-workflow> object." object) described by syntax X. If such a ccwl function is not defined, return #f." ;; TODO: What if function object is defined in lexical scope? - (let ((var (module-variable (current-module) - (syntax->datum x)))) - (and var - (or (command? (variable-ref var)) - (cwl-workflow? (variable-ref var))) - (variable-ref var)))) + (let ((result (false-if-exception + (eval (syntax->datum x) + (interaction-environment))))) + (and (or (command? result) + (cwl-workflow? result)) + result))) (define (collect-steps x input-keys) "Traverse ccwl workflow body X and return two values---a list of |