1
;; A practical implementation for the Scheme programming language
10
;; Copyright (c) 1992-2004 Manuel Serrano
12
;; Bug descriptions, use reports, comments or suggestions are
13
;; welcome. Send them to
14
;; bigloo@sophia.inria.fr
15
;; http://www.inria.fr/mimosa/fp/Bigloo
17
;; This program is free software; you can redistribute it and/or modify
18
;; it under the terms of the GNU General Public License as published by
19
;; the Free Software Foundation; either version 2 of the License, or
20
;; (at your option) any later version. More precisely,
22
;; - The compiler and the tools are distributed under the terms of the
23
;; GNU General Public License.
25
;; - The Bigloo run-time system and the libraries are distributed under
26
;; the terms of the GNU Library General Public License. The source code
27
;; of the Bigloo runtime system is located in the ./runtime directory.
28
;; The source code of the FairThreads library is located in the
29
;; ./fthread directory.
31
;; This program is distributed in the hope that it will be useful,
32
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
33
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
;; GNU General Public License for more details.
36
;; You should have received a copy of the GNU General Public
37
;; License along with this program; if not, write to the Free
38
;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
39
;; MA 02111-1307, USA.
41
;*---------------------------------------------------------------------*/
42
;* serrano/prgm/project/bigloo/recette/letrec.scm */
44
;* Author : Manuel Serrano */
45
;* Creation : Tue Nov 17 19:18:37 1992 */
46
;* Last change : Fri Jul 6 09:38:02 2001 (serrano) */
48
;* On test `letrec' */
49
;*---------------------------------------------------------------------*/
53
;; 2005-08-18 kzk Copied from Bigloo 2.6e and adapted to SigScheme
55
(load "./test/unittest-bigloo.scm")
57
;*---------------------------------------------------------------------*/
59
;*---------------------------------------------------------------------*/
61
(letrec ((x (number->string y))
63
(string->symbol (string-append string x)))))
66
;*---------------------------------------------------------------------*/
68
;* ------------------------------------------------------------- */
69
;* un test qui plantait a la compilation */
70
;*---------------------------------------------------------------------*/
72
(letrec ((foo (lambda (x) (bar 0) (set! foo 8) 'done))
73
(bar (lambda (x) (if (= x 0)
78
;*---------------------------------------------------------------------*/
80
;*---------------------------------------------------------------------*/
82
(test "letrec" ((test1 1) "TOTO") 'TOTO1)
83
(test "letrec" (foo 10) 'done)
84
(test "delay" (procedure? (letrec ((foo (delay foo))) (force foo))) #t))