~bouncepaw/agidel

adeacda009e90ff6a8ea6319169aa0d56057faf6 — Timur Ismagilov 5 years ago 66558f9
Make using the transpiler safer
2 files changed, 10 insertions(+), 6 deletions(-)

M agidel
M agidel.lisp
M agidel => agidel +5 -3
@@ 1,5 1,7 @@
#!/bin/sh
import_statement="(import (only scheme define quote string-append display)"
import_statement="(import (prefix (only scheme define string-append display)
                      AGIDEL/)
              (only scheme quote)"
for plugin in "$@"; do
import_statement+="(agidel-plugin $plugin)"



@@ 8,8 10,8 @@ import_statement+=")"
csi $csi_args -batch -quiet -eval "(begin
        (module agidel_temp (main)
                $import_statement
                (define (main)
                   (display (string-append $(cat /dev/stdin)))))
                (AGIDEL/define (main)
                   (AGIDEL/display (AGIDEL/string-append $(cat /dev/stdin)))))
        (import agidel_temp)
        (main))"
echo

M agidel.lisp => agidel.lisp +5 -3
@@ 1,6 1,8 @@
(shebang!)
(set 'import_statement
     "(import (only scheme define quote string-append display)")
     "(import (prefix (only scheme define string-append display)
                      AGIDEL/)
              (only scheme quote)")
(for-each-cli-arg
 'plugin
 (set 'import_statement '+ "(agidel-plugin $plugin)"))


@@ 10,8 12,8 @@
      "(begin
        (module agidel_temp (main)
                $import_statement
                (define (main)
                   (display (string-append $(cat /dev/stdin)))))
                (AGIDEL/define (main)
                   (AGIDEL/display (AGIDEL/string-append $(cat /dev/stdin)))))
        (import agidel_temp)
        (main))"]
['echo]