~bouncepaw/agidel-syntrans

6dac725f481814eb727f8fd0e59388780f08033e — Timur Ismagilov 5 years ago 6de3c4b
Make `run` use new `<aeval>` object

I really like it :)
1 files changed, 2 insertions(+), 16 deletions(-)

M run.scm
M run.scm => run.scm +2 -16
@@ 3,23 3,9 @@
 (main)
 (import scheme
         (chicken base)
         (prefix (agidel core) core/)
         (prefix (agidel plugin) plugin/)
         (srfi 1)
         (srfi 13)
         (srfi 69)
         (clojurian syntax)
         format)
         (agidel aeval))

 ;; `source-tree` is a LIST, not a STRING!
 ;; This functions outputs a string though.
 (define (main source-tree plugins)
   ;; Import all plugins, prefixing Agidel macros from them with '/agidel.
   (->> plugins
        (map (lambda (p)
               `(prefix ,(symbol-append 'agidel-plugin. p) /agidel)))
        (cons 'import)
        eval)
   ;; Eval it, convert to string.
   (-> (map eval source-tree)
       (string-join "\n" 'infix))))
   (((<aeval> plugins) 'run) source-tree)))