From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0DA5615808B for ; Sat, 2 Apr 2022 15:35:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 99320E087A; Sat, 2 Apr 2022 15:35:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3B74CE0882 for ; Sat, 2 Apr 2022 15:35:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E46F33417A3 for ; Sat, 2 Apr 2022 15:34:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6292A385 for ; Sat, 2 Apr 2022 15:34:56 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1648913511.ffcc1b4636c13a05a915ffc6ee3dfe7d3d9d9e78.ulm@gentoo> Subject: [gentoo-commits] proj/lisp:master commit in: misc/ X-VCS-Repository: proj/lisp X-VCS-Files: misc/interpret misc/interpret-slib misc/scheme.scm X-VCS-Directories: misc/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: ffcc1b4636c13a05a915ffc6ee3dfe7d3d9d9e78 X-VCS-Branch: master Date: Sat, 2 Apr 2022 15:34:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fc496a45-3dca-4c54-9152-1d22d8a7191a X-Archives-Hash: 262925e330597d70b2ea50793c9d89a3 commit: ffcc1b4636c13a05a915ffc6ee3dfe7d3d9d9e78 Author: Ulrich Müller gentoo org> AuthorDate: Sat Apr 2 15:31:51 2022 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sat Apr 2 15:31:51 2022 +0000 URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=ffcc1b46 misc: Remove unused directory Signed-off-by: Ulrich Müller gentoo.org> misc/interpret | 122 ---------------------------------------------------- misc/interpret-slib | 1 - misc/scheme.scm | 50 --------------------- 3 files changed, 173 deletions(-) diff --git a/misc/interpret b/misc/interpret deleted file mode 100755 index 30cfea8a..00000000 --- a/misc/interpret +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash -#set -x -# Usage: -# interpret a file: ./interpret mzscheme < scheme.scm -# interpret code: ./interpret <<< "(display \"hello\nworld\")(newline)" -# use SLIB: ./interpret-slib <<< "(slib:report)" - -# tricky examples: -# ./interpret bigloo <<< "(display (eq? (string->symbol \"\`\") '|\`|)))(newline)" -# ./interpret bigloo <<< '(display (eq? (string->symbol "`") '\''|`|)))(newline)' - -# LOAD_SLIB=$(if [[ $0 == *slib* ]]; then echo "slib"; else echo ""; fi) -if [[ $0 = *slib* ]]; then LOAD_SLIB="slib"; fi - -#echo "${LOAD_SLIB}" - -read -r -d "" PROGRAM -echo "PROGRAM = ${PROGRAM}" -PROGRAM="(begin ${PROGRAM} (newline))" - -IMPLEMENTATION="${1:-all}" - -make_load_expression() { - echo "(load \"/usr/share/slib/$1.init\")" -} - -run_bigloo() { - SLIB_INIT="bigloo" - echo "bigloo:" -# bigloo -s -eval "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}") (exit)" - if [[ $LOAD_SLIB ]]; then bigloo -s -eval "$(make_load_expression $SLIB_INIT) $PROGRAM (exit)"; else bigloo -s -eval "$PROGRAM (exit)"; fi -} - -run_chicken() { - SLIB_INIT="chicken" - echo "chicken:" -# csi -require-extension syntax-case -eval \ - csi -eval "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" -} - -run_gambit() { - SLIB_INIT="gambit" - echo "gambit:" - gambit-interpreter -e "(load \"~~/lib/syntax-case\") $([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" -} - -run_gauche() { - SLIB_INIT="gauche" - echo "gauche:" - gosh -e "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" -} - -run_guile() { - SLIB_INIT="guile" - echo "guile:" - guile -c "(use-modules (ice-9 syncase)) $([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" -} - -run_mit-scheme() { - SLIB_INIT="mitscheme" - echo "mit-scheme:" -#mit-scheme --batch-mode --eval "(set! load-noisily? #t) (load \"$1\")" -#echo "(set! load-noisily? #t) (load \"$1\")" | mit-scheme --batch-mode -#mit-scheme --batch-mode --eval "(set! load/suppress-loading-message? #t)" # (load \"$1\")" - echo "(set! load/suppress-loading-message? #t) $([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" | mit-scheme --batch-mode -#echo "(load \"$1\")" | mit-scheme --batch-mode -} - -run_mzscheme() { - SLIB_INIT="DrScheme" - echo "mzscheme:" - mzscheme -vme "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "(begin $(make_load_expression ${SLIB_INIT}) ${PROGRAM})")" -} - -run_scm() { - SLIB_INIT="scm" - echo "scm:" - scm -e "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" -} - -run_stklos() { - SLIB_INIT="STk" - [[ -z ${LOAD_SLIB} ]] || PROGRAM="$(make_load_expression STk) ${PROGRAM}" - echo "stklos with full-syntax:" - stklos -e "(begin (require \"full-syntax\") $([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}"))" - echo "stklos:" - stklos -e "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" -} - -run_elk() { - SLIB_INIT="elk" - echo "elk:" -# echo "$([[ -z ${LOAD_SLIB} ]] && echo "${PROGRAM}" || echo "$(make_load_expression ${SLIB_INIT}) ${PROGRAM}")" | elk -l - - { [[ -z $LOAD_SLIB ]] && echo "$PROGRAM" || echo "$(make_load_expression "$SLIB_INIT" "$PROGRAM")"; } | elk -l - -} - -run_all() { - run_bigloo - [[ -z ${LOAD_SLIB} ]] && run_chicken - [[ -z ${LOAD_SLIB} ]] && run_elk - run_gambit - [[ -z ${LOAD_SLIB} ]] && run_gauche - run_guile - [[ -z ${LOAD_SLIB} ]] && run_mit-scheme - run_mzscheme - run_scm - [[ -z ${LOAD_SLIB} ]] && run_stklos -} - -case ${IMPLEMENTATION} in - bigloo) run_bigloo;; - chicken) run_chicken;; - elk) run_elk;; - gambit) run_gambit;; - gauche) run_gauche;; - guile) run_guile;; - mit-scheme) run_mit-scheme;; - mzscheme) run_mzscheme;; - scm) run_scm;; - stklos) run_stklos;; - all) run_all;; -esac diff --git a/misc/interpret-slib b/misc/interpret-slib deleted file mode 120000 index f483b4f0..00000000 --- a/misc/interpret-slib +++ /dev/null @@ -1 +0,0 @@ -interpret \ No newline at end of file diff --git a/misc/scheme.scm b/misc/scheme.scm deleted file mode 100644 index e219bd70..00000000 --- a/misc/scheme.scm +++ /dev/null @@ -1,50 +0,0 @@ -(require (lib "43.ss" "srfi"))(require (lib "69.ss" "srfi"))(require (lib "process.ss")) -;(require-extension srfi-43) - -;(use-modules (ice-9 srfi-43)(ice-9 syncase)) - -(define database (make-hash-table)) - -(define-syntax (define-implementation x) - (syntax-case x () - ((_ implementation evaluate-command interpret-command compile-command run-compiled-command) - (syntax (hash-table-set! database 'implementation - (vector evaluate-command interpret-command compile-command run-compiled-command)))))) - -(define-syntax (define-accessor x) - (syntax-case x () - ((_ name position) - (syntax (define (name implementation) - (let ((entry (hash-table-ref/default database implementation #f))) - (if entry (vector-ref entry position) (error "no such implementation known!")))))))) - -(define-accessor implementation->evaluate-command 0) -(define-accessor implementation->interpret-command 1) -(define-accessor implementation->compile-command 2) -(define-accessor implementation->run-compiled-command 3) - -(define-implementation bigloo - (lambda (x) (string-append "echo '" x "' | bigloo -s")) - (lambda (x) (string-append "bigloo -i" x)) - (lambda (x) (string-append "bigloo -native" x " -o ." x "_bigloo")) - (lambda (x) (string-append "./." x "_bigloo"))) - -(define-implementation mzscheme - (lambda (x) (string-append "echo '" x "' | mzscheme --mute-banner")) - (lambda (x) (string-append "mzscheme --script" x)) - (lambda (x) (string-append "mzc --extension --autodir" x)) - (lambda (x) (implementation->evaluate-command mzscheme (append-string "(load/use-compiled \"" x "\")")))) - -(define-syntax (define-command x) - (syntax-case x () - ((_ name implementation->command) - (syntax (define (name implementation program) - (system ((implementation->command implementation) program))))))) - -(define-command evaluate implementation->evaluate-command) -(define-command interpret implementation->interpret-command) -(define-command compile implementation->compile-command) -(define-command run-compiled implementation->run-compiled-command) - -(evaluate 'mzscheme "(+ 1 2)") -(evaluate 'bigloo '"(+ 5 2)")