From: Tom Tromey <tom@tromey.com>
To: cgen@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFC 06/14] Remove support for old versions of Guile
Date: Sat, 19 Aug 2023 11:42:05 -0600 [thread overview]
Message-ID: <20230819174900.866436-7-tom@tromey.com> (raw)
In-Reply-To: <20230819174900.866436-1-tom@tromey.com>
This removes support for older versions of Guile.
---
README | 2 +-
cos.scm | 9 +------
guile.scm | 71 +++++--------------------------------------------------
3 files changed, 8 insertions(+), 74 deletions(-)
diff --git a/README b/README
index cc286d4..e9f9c7f 100644
--- a/README
+++ b/README
@@ -43,7 +43,7 @@ Binutils/GDB developers wishing to use CGEN must configure Binutils/GDB with
opcodes/Makefile and sim/<arch>/Makefile for the supported processors.
CGEN uses Guile so Guile must be installed.
-CGEN has been tested with Guile 1.4.1, 1.6.8, and 1.8.5.
+CGEN has been tested with Guile 3.0.7.
Support for older versions of Guile will be removed in time.
Source Layout
diff --git a/cos.scm b/cos.scm
index 0210b20..1ba4c54 100644
--- a/cos.scm
+++ b/cos.scm
@@ -1263,11 +1263,4 @@
\f
;; Misc. internal utilities.
-;; We need a fast vector copy operation.
-;; If `vector-copy' doesn't exist (which is assumed to be the fast one),
-;; provide a simple version.
-
-(if (defined? 'vector-copy)
- (define /object-vector-copy vector-copy)
- (define (/object-vector-copy v) (list->vector (vector->list v)))
-)
+(define /object-vector-copy vector-copy)
diff --git a/guile.scm b/guile.scm
index 85c37d4..9d7c64c 100644
--- a/guile.scm
+++ b/guile.scm
@@ -3,56 +3,14 @@
; This file is part of CGEN.
; See file COPYING.CGEN for details.
-(define *guile-major-version* (string->number (major-version)))
-(define *guile-minor-version* (string->number (minor-version)))
+(define (eval1 expr)
+ (eval expr (current-module)))
-; eval takes a module argument in 1.6 and later
+(define load primitive-load-path)
-(if (or (> *guile-major-version* 1)
- (>= *guile-minor-version* 6))
- (define (eval1 expr)
- (eval expr (current-module)))
- (define (eval1 expr)
- (eval expr))
-)
+(define %stat stat)
-; symbol-bound? is deprecated in 1.6
-
-(if (or (> *guile-major-version* 1)
- (>= *guile-minor-version* 6))
- (define (symbol-bound? table s)
- (if table
- (error "must pass #f for symbol-bound? first arg"))
- ; FIXME: Not sure this is 100% correct.
- (module-defined? (current-module) s))
-)
-
-(if (symbol-bound? #f 'load-from-path)
- (begin
- (define (load file)
- (begin
- ;(load-from-path file)
- (primitive-load-path file)
- ))
- )
-)
-
-(if (not (symbol-bound? #f '%stat))
- (begin
- (define %stat stat)
- )
-)
-
-(if (symbol-bound? #f 'debug-enable)
- (debug-enable 'backtrace)
-)
-
-; Guile 1.3 has reverse!, Guile 1.2 has list-reverse!.
-; CGEN uses reverse!
-(if (and (not (symbol-bound? #f 'reverse!))
- (symbol-bound? #f 'list-reverse!))
- (define reverse! list-reverse!)
-)
+(debug-enable 'backtrace)
(define (debug-write . objs)
(map (lambda (o)
@@ -60,28 +18,11 @@
objs)
(newline (current-error-port)))
-;; Guile 1.8 no longer has "." in %load-path so relative path loads
-;; no longer work.
-
-(if (or (> *guile-major-version* 1)
- (>= *guile-minor-version* 8))
- (set! %load-path (append %load-path (list ".")))
-)
+(add-to-load-path ".")
\f
;;; Enabling and disabling debugging features of the host Scheme.
-;;; For the initial load proces, turn everything on. We'll disable it
-;;; before we start doing the heavy computation.
-(if (memq 'debug-extensions *features*)
- (begin
- (debug-enable 'backtrace)
- (debug-enable 'debug)
- (debug-enable 'backwards)
- (debug-set! depth 2000)
- (debug-set! maxdepth 2000)
- (debug-set! stack 100000)
- (debug-set! frames 10)))
(read-enable 'positions)
;;; Call THUNK, with debugging enabled if FLAG is true, or disabled if
--
2.41.0
next prev parent reply other threads:[~2023-08-19 19:24 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-19 17:41 [RFC 00/14] Port to Guile 3.0 Tom Tromey
2023-08-19 17:42 ` [RFC 01/14] Add a .gitignore Tom Tromey
2023-08-20 8:04 ` Jose E. Marchesi
2023-08-19 17:42 ` [RFC 02/14] Remove some 'fastcall' code Tom Tromey
2023-08-20 8:13 ` Jose E. Marchesi
2023-08-22 16:52 ` Tom Tromey
2023-08-19 17:42 ` [RFC 03/14] Remove bound-symbol? Tom Tromey
2023-08-20 8:14 ` Jose E. Marchesi
2023-08-19 17:42 ` [RFC 04/14] Remove =? and >=? aliases Tom Tromey
2023-08-20 8:15 ` Jose E. Marchesi
2023-08-19 17:42 ` [RFC 05/14] Fix bug in insn.scm Tom Tromey
2023-08-20 8:15 ` Jose E. Marchesi
2023-08-19 17:42 ` Tom Tromey [this message]
2023-08-19 17:42 ` [RFC 07/14] Use define-macro in rtl.scm Tom Tromey
2023-08-19 17:42 ` [RFC 08/14] Remove let bindings of macros Tom Tromey
2023-08-20 8:33 ` Jose E. Marchesi
2023-08-19 17:42 ` [RFC 09/14] Remove define-in-define Tom Tromey
2023-08-19 17:42 ` [RFC 10/14] Hack cos.scm to work with new Guile Tom Tromey
2023-08-19 17:42 ` [RFC 11/14] Invalid code in rtx-traverse.scm Tom Tromey
2023-08-20 8:42 ` Jose E. Marchesi
2023-08-19 17:42 ` [RFC 12/14] Nuke cgen-call-with-debugging and cgen-debugging-stack-start Tom Tromey
2023-08-19 17:42 ` [RFC 13/14] Load macros before uses Tom Tromey
2023-08-19 17:42 ` [RFC 14/14] Remove pprint.scm and cos-pprint.scm Tom Tromey
2023-08-20 8:03 ` [RFC 00/14] Port to Guile 3.0 Jose E. Marchesi
2023-08-20 17:26 ` Frank Ch. Eigler
2023-08-20 19:52 ` Tom Tromey
2023-08-21 1:38 ` Frank Ch. Eigler
2023-08-21 13:06 ` Julian Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230819174900.866436-7-tom@tromey.com \
--to=tom@tromey.com \
--cc=cgen@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).