Add for-loop support

* geesh/eval.scm (eval-sh): Handle '<sh-for>'.
This commit is contained in:
Timothy Sample 2018-10-16 15:28:19 -04:00
parent db56b1cc0a
commit 2db7833d61
1 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,9 @@ environment @var{env}."
(match args
((name . args) (apply sh:exec env name args))
(() #f))))
(('<sh-for> (name (words ...)) . sub-exps)
(sh:for env `(,name ,(append-map (cut eval-word env <>) words))
(exps->thunk env sub-exps)))
(('<sh-not> exp)
(sh:not env (exp->thunk env exp)))
(('<sh-or> exp1 exp2)