Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/lisp:master commit in: misc/
Date: Sat, 02 Apr 2022 15:35:09
Message-Id: 1648913511.ffcc1b4636c13a05a915ffc6ee3dfe7d3d9d9e78.ulm@gentoo
1 commit: ffcc1b4636c13a05a915ffc6ee3dfe7d3d9d9e78
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 2 15:31:51 2022 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 2 15:31:51 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=ffcc1b46
7
8 misc: Remove unused directory
9
10 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
11
12 misc/interpret | 122 ----------------------------------------------------
13 misc/interpret-slib | 1 -
14 misc/scheme.scm | 50 ---------------------
15 3 files changed, 173 deletions(-)
16
17 diff --git a/misc/interpret b/misc/interpret
18 deleted file mode 100755
19 index 30cfea8a..00000000
20 --- a/misc/interpret
21 +++ /dev/null
22 @@ -1,122 +0,0 @@
23 -#!/bin/bash
24 -#set -x
25 -# Usage:
26 -# interpret a file: ./interpret mzscheme < scheme.scm
27 -# interpret code: ./interpret <<< "(display \"hello\nworld\")(newline)"
28 -# use SLIB: ./interpret-slib <<< "(slib:report)"
29 -
30 -# tricky examples:
31 -# ./interpret bigloo <<< "(display (eq? (string->symbol \"\`\") '|\`|)))(newline)"
32 -# ./interpret bigloo <<< '(display (eq? (string->symbol "`") '\''|`|)))(newline)'
33 -
34 -# LOAD_SLIB=$(if [[ $0 == *slib* ]]; then echo "slib"; else echo ""; fi)
35 -if [[ $0 = *slib* ]]; then LOAD_SLIB="slib"; fi
36 -
37 -#echo "${LOAD_SLIB}"
38 -
39 -read -r -d "" PROGRAM
40 -echo "PROGRAM = ${PROGRAM}"
41 -PROGRAM="(begin ${PROGRAM} (newline))"
42 -
43 -IMPLEMENTATION="${1:-all}"
44 -
45 -make_load_expression() {
46 - echo "(load \"/usr/share/slib/$1.init\")"
47 -}
48 -
49 -run_bigloo() {
50 - SLIB_INIT="bigloo"
51 - echo "bigloo:"
52 -# bigloo -s -eval "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}") (exit)"
53 - if [[ $LOAD_SLIB ]]; then bigloo -s -eval "$(make_load_expression $SLIB_INIT) $PROGRAM (exit)"; else bigloo -s -eval "$PROGRAM (exit)"; fi
54 -}
55 -
56 -run_chicken() {
57 - SLIB_INIT="chicken"
58 - echo "chicken:"
59 -# csi -require-extension syntax-case -eval \
60 - csi -eval "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")"
61 -}
62 -
63 -run_gambit() {
64 - SLIB_INIT="gambit"
65 - echo "gambit:"
66 - gambit-interpreter -e "(load \"~~/lib/syntax-case\") $([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")"
67 -}
68 -
69 -run_gauche() {
70 - SLIB_INIT="gauche"
71 - echo "gauche:"
72 - gosh -e "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")"
73 -}
74 -
75 -run_guile() {
76 - SLIB_INIT="guile"
77 - echo "guile:"
78 - guile -c "(use-modules (ice-9 syncase)) $([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")"
79 -}
80 -
81 -run_mit-scheme() {
82 - SLIB_INIT="mitscheme"
83 - echo "mit-scheme:"
84 -#mit-scheme --batch-mode --eval "(set! load-noisily? #t) (load \"$1\")"
85 -#echo "(set! load-noisily? #t) (load \"$1\")" | mit-scheme --batch-mode
86 -#mit-scheme --batch-mode --eval "(set! load/suppress-loading-message? #t)" # (load \"$1\")"
87 - echo "(set! load/suppress-loading-message? #t) $([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" | mit-scheme --batch-mode
88 -#echo "(load \"$1\")" | mit-scheme --batch-mode
89 -}
90 -
91 -run_mzscheme() {
92 - SLIB_INIT="DrScheme"
93 - echo "mzscheme:"
94 - mzscheme -vme "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "(begin $(make_load_expression ${SLIB_INIT}) ${PROGRAM})")"
95 -}
96 -
97 -run_scm() {
98 - SLIB_INIT="scm"
99 - echo "scm:"
100 - scm -e "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")"
101 -}
102 -
103 -run_stklos() {
104 - SLIB_INIT="STk"
105 - [[ -z ${LOAD_SLIB} ]] || PROGRAM="$(make_load_expression STk) ${PROGRAM}"
106 - echo "stklos with full-syntax:"
107 - stklos -e "(begin (require \"full-syntax\") $([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}"))"
108 - echo "stklos:"
109 - stklos -e "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")"
110 -}
111 -
112 -run_elk() {
113 - SLIB_INIT="elk"
114 - echo "elk:"
115 -# echo "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" | elk -l -
116 - { [[ -z $LOAD_SLIB ]] && echo "$PROGRAM" || echo "$(make_load_expression "$SLIB_INIT" "$PROGRAM")"; } | elk -l -
117 -}
118 -
119 -run_all() {
120 - run_bigloo
121 - [[ -z ${LOAD_SLIB} ]] && run_chicken
122 - [[ -z ${LOAD_SLIB} ]] && run_elk
123 - run_gambit
124 - [[ -z ${LOAD_SLIB} ]] && run_gauche
125 - run_guile
126 - [[ -z ${LOAD_SLIB} ]] && run_mit-scheme
127 - run_mzscheme
128 - run_scm
129 - [[ -z ${LOAD_SLIB} ]] && run_stklos
130 -}
131 -
132 -case ${IMPLEMENTATION} in
133 - bigloo) run_bigloo;;
134 - chicken) run_chicken;;
135 - elk) run_elk;;
136 - gambit) run_gambit;;
137 - gauche) run_gauche;;
138 - guile) run_guile;;
139 - mit-scheme) run_mit-scheme;;
140 - mzscheme) run_mzscheme;;
141 - scm) run_scm;;
142 - stklos) run_stklos;;
143 - all) run_all;;
144 -esac
145
146 diff --git a/misc/interpret-slib b/misc/interpret-slib
147 deleted file mode 120000
148 index f483b4f0..00000000
149 --- a/misc/interpret-slib
150 +++ /dev/null
151 @@ -1 +0,0 @@
152 -interpret
153 \ No newline at end of file
154
155 diff --git a/misc/scheme.scm b/misc/scheme.scm
156 deleted file mode 100644
157 index e219bd70..00000000
158 --- a/misc/scheme.scm
159 +++ /dev/null
160 @@ -1,50 +0,0 @@
161 -(require (lib "43.ss" "srfi"))(require (lib "69.ss" "srfi"))(require (lib "process.ss"))
162 -;(require-extension srfi-43)
163 -
164 -;(use-modules (ice-9 srfi-43)(ice-9 syncase))
165 -
166 -(define database (make-hash-table))
167 -
168 -(define-syntax (define-implementation x)
169 - (syntax-case x ()
170 - ((_ implementation evaluate-command interpret-command compile-command run-compiled-command)
171 - (syntax (hash-table-set! database 'implementation
172 - (vector evaluate-command interpret-command compile-command run-compiled-command))))))
173 -
174 -(define-syntax (define-accessor x)
175 - (syntax-case x ()
176 - ((_ name position)
177 - (syntax (define (name implementation)
178 - (let ((entry (hash-table-ref/default database implementation #f)))
179 - (if entry (vector-ref entry position) (error "no such implementation known!"))))))))
180 -
181 -(define-accessor implementation->evaluate-command 0)
182 -(define-accessor implementation->interpret-command 1)
183 -(define-accessor implementation->compile-command 2)
184 -(define-accessor implementation->run-compiled-command 3)
185 -
186 -(define-implementation bigloo
187 - (lambda (x) (string-append "echo '" x "' | bigloo -s"))
188 - (lambda (x) (string-append "bigloo -i" x))
189 - (lambda (x) (string-append "bigloo -native" x " -o ." x "_bigloo"))
190 - (lambda (x) (string-append "./." x "_bigloo")))
191 -
192 -(define-implementation mzscheme
193 - (lambda (x) (string-append "echo '" x "' | mzscheme --mute-banner"))
194 - (lambda (x) (string-append "mzscheme --script" x))
195 - (lambda (x) (string-append "mzc --extension --autodir" x))
196 - (lambda (x) (implementation->evaluate-command mzscheme (append-string "(load/use-compiled \"" x "\")"))))
197 -
198 -(define-syntax (define-command x)
199 - (syntax-case x ()
200 - ((_ name implementation->command)
201 - (syntax (define (name implementation program)
202 - (system ((implementation->command implementation) program)))))))
203 -
204 -(define-command evaluate implementation->evaluate-command)
205 -(define-command interpret implementation->interpret-command)
206 -(define-command compile implementation->compile-command)
207 -(define-command run-compiled implementation->run-compiled-command)
208 -
209 -(evaluate 'mzscheme "(+ 1 2)")
210 -(evaluate 'bigloo '"(+ 5 2)")