~bouncepaw/agidel

66558f9d36f48f8085c9bfa7217a35317b959245 — Timur Ismagilov 5 years ago 632d99e
New version of Agidel transpiler

Now with almost clear namespace
2 files changed, 25 insertions(+), 9 deletions(-)

M agidel
M agidel.lisp
M agidel => agidel +12 -6
@@ 1,9 1,15 @@
#!/bin/sh
csi_args="-batch -quiet "
for plugin in "$@"
do
    csi_args+="-require-extension agidel-plugin.$plugin "
done
import_statement="(import (only scheme define quote string-append display)"
for plugin in "$@"; do
import_statement+="(agidel-plugin $plugin)"

csi $csi_args -e "(display (string-append $(cat /dev/stdin)))"
done
import_statement+=")"
csi $csi_args -batch -quiet -eval "(begin
        (module agidel_temp (main)
                $import_statement
                (define (main)
                   (display (string-append $(cat /dev/stdin)))))
        (import agidel_temp)
        (main))"
echo

M agidel.lisp => agidel.lisp +13 -3
@@ 1,7 1,17 @@
(shebang!)
(set 'csi_args "-batch -quiet ")
(set 'import_statement
     "(import (only scheme define quote string-append display)")
(for-each-cli-arg
 'plugin
 (set 'csi_args + "-require-extension agidel-plugin.$plugin "))
['csi '$csi_args '-e "(display (string-append $(cat /dev/stdin)))"]
 (set 'import_statement '+ "(agidel-plugin $plugin)"))
(set 'import_statement '+ ")")
['csi '$csi_args
      '-batch '-quiet '-eval
      "(begin
        (module agidel_temp (main)
                $import_statement
                (define (main)
                   (display (string-append $(cat /dev/stdin)))))
        (import agidel_temp)
        (main))"]
['echo]