1
1
;;;; eval.test --- tests guile's evaluator -*- scheme -*-
2
;;;; Copyright (C) 2000, 2001, 2006, 2007 Free Software Foundation, Inc.
2
;;;; Copyright (C) 2000, 2001, 2006, 2007, 2009 Free Software Foundation, Inc.
4
4
;;;; This library is free software; you can redistribute it and/or
5
5
;;;; modify it under the terms of the GNU Lesser General Public
312
313
(%make-void-port "w"))
321
(define (stack->frames stack)
322
;; Return the list of frames comprising STACK.
324
(>= i (stack-length stack)))
330
(with-test-prefix "stacks"
331
(with-debugging-evaluator
333
(pass-if "stack involving a subr"
334
;; The subr involving the error must appear exactly once on the stack.
338
(lazy-catch 'wrong-type-arg
340
;; Trigger a `wrong-type-arg' exception.
341
(fluid-ref 'not-a-fluid))
343
(let* ((stack (make-stack #t))
344
(frames (stack->frames stack)))
346
(count (lambda (frame)
347
(and (frame-procedure? frame)
348
(eq? (frame-procedure frame)
354
(pass-if "stack involving a gsubr"
355
;; The gsubr involving the error must appear exactly once on the stack.
356
;; This is less obvious since gsubr application may require an
357
;; additional `SCM_APPLY ()' call, which should not be visible to the
362
(lazy-catch 'wrong-type-arg
364
;; Trigger a `wrong-type-arg' exception.
365
(hashq-ref 'wrong 'type 'arg))
367
(let* ((stack (make-stack #t))
368
(frames (stack->frames stack)))
370
(count (lambda (frame)
371
(and (frame-procedure? frame)
372
(eq? (frame-procedure frame)
316
379
;;; letrec init evaluation