mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 04:15:36 +02:00
Move copy-tree to (ice-9 copy-tree); deprecate main binding
* doc/ref/api-data.texi (List Constructors): * doc/ref/api-utility.texi (Copying): Update docs to mention module. * libguile.h: Remove trees.h inclusion. * libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Remove trees.c, trees.h, and related files. * libguile/init.c (scm_i_init_guile): Remove trees.h and the scm_init_trees call. * libguile/trees.c: * libguile/trees.h: Remove. * module/Makefile.am (SOURCES): Add ice-9/copy-tree.scm. * module/ice-9/copy-tree.scm: New file. * module/ice-9/deprecated.scm (copy-tree*): Export as copy-tree, proxying to (ice-9 copy-tree). * module/system/repl/common.scm: * module/web/client.scm: * test-suite/tests/elisp.test: * test-suite/tests/srfi-1.test: * module/oop/goops/save.scm: Use (ice-9 copy-tree). * test-suite/Makefile.am (SCM_TESTS): Add copy-tree.test. * test-suite/tests/copy-tree.test: New file; test pulled from eval.test. * libguile/deprecated.h: * libguile/deprecated.c (scm_copy_tree): Deprecate.
This commit is contained in:
parent
433b701a23
commit
e9c5a1719b
20 changed files with 174 additions and 290 deletions
33
test-suite/tests/copy-tree.test
Normal file
33
test-suite/tests/copy-tree.test
Normal file
|
@ -0,0 +1,33 @@
|
|||
;;;; Copyright (C) 2000-2001,2003-2015,2017,2019,2020
|
||||
;;;; Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
;;;; License as published by the Free Software Foundation; either
|
||||
;;;; version 3 of the License, or (at your option) any later version.
|
||||
;;;;
|
||||
;;;; This library is distributed in the hope that it will be useful,
|
||||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;;;; Lesser General Public License for more details.
|
||||
;;;;
|
||||
;;;; You should have received a copy of the GNU Lesser General Public
|
||||
;;;; License along with this library; if not, write to the Free Software
|
||||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
(define-module (test-suite test-copy-tree)
|
||||
:use-module (test-suite lib)
|
||||
:use-module (ice-9 copy-tree))
|
||||
|
||||
(with-test-prefix "copy-tree"
|
||||
(pass-if "(#t . #(#t))"
|
||||
(let* ((foo (cons #t (vector #t)))
|
||||
(bar (copy-tree foo)))
|
||||
(vector-set! (cdr foo) 0 #f)
|
||||
(equal? bar '(#t . #(#t)))))
|
||||
|
||||
(pass-if-exception "circular lists in forms"
|
||||
'(wrong-type-arg . "")
|
||||
(let ((foo (list #f)))
|
||||
(set-cdr! foo foo)
|
||||
(copy-tree foo))))
|
|
@ -1,5 +1,5 @@
|
|||
;;;; elisp.test --- tests guile's elisp support -*- scheme -*-
|
||||
;;;; Copyright (C) 2002, 2003, 2006, 2009, 2010 Free Software Foundation, Inc.
|
||||
;;;; Copyright (C) 2002, 2003, 2006, 2009, 2010, 2020 Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -16,6 +16,7 @@
|
|||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
(define-module (test-suite test-elisp)
|
||||
#:use-module (ice-9 copy-tree)
|
||||
#:use-module (test-suite lib)
|
||||
#:use-module (system base compile)
|
||||
#:use-module (ice-9 weak-vector))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;;; eval.test --- tests guile's evaluator -*- scheme -*-
|
||||
;;;; Copyright (C) 2000-2001,2003-2015,2017,2019
|
||||
;;;; Copyright (C) 2000-2001,2003-2015,2017,2019,2020
|
||||
;;;; Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
|
@ -50,21 +50,6 @@
|
|||
;;;
|
||||
|
||||
(with-test-prefix "memoization"
|
||||
|
||||
(with-test-prefix "copy-tree"
|
||||
|
||||
(pass-if "(#t . #(#t))"
|
||||
(let* ((foo (cons #t (vector #t)))
|
||||
(bar (copy-tree foo)))
|
||||
(vector-set! (cdr foo) 0 #f)
|
||||
(equal? bar '(#t . #(#t)))))
|
||||
|
||||
(pass-if-exception "circular lists in forms"
|
||||
exception:wrong-type-arg
|
||||
(let ((foo (list #f)))
|
||||
(set-cdr! foo foo)
|
||||
(copy-tree foo))))
|
||||
|
||||
(pass-if "transparency"
|
||||
(let ((x '(begin 1)))
|
||||
(eval x (current-module))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;;; srfi-1.test --- Test suite for Guile's SRFI-1 functions. -*- scheme -*-
|
||||
;;;;
|
||||
;;;; Copyright 2003-2006, 2008-2011, 2014 Free Software Foundation, Inc.
|
||||
;;;; Copyright 2003-2006, 2008-2011, 2014, 2020 Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -18,6 +18,7 @@
|
|||
|
||||
(define-module (test-srfi-1)
|
||||
#:use-module (test-suite lib)
|
||||
#:use-module (ice-9 copy-tree)
|
||||
#:use-module (srfi srfi-1))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue