Petite Chez Scheme Version 9.5
Copyright 1984-2017 Cisco Systems, Inc.

> (define a '(3 6))
> (let ([end1 (car a)]
	  [end2 (cadr a))
	(and (< end1 0) (> end2 0))))
Exception in read: bracketed list terminated by parenthesis
> Exception: variable end1 is not bound
> (let ([end1 (car a)]
      [end2 (cadr a)])
      (and (< end1 0) (> end2 0)))
#f
> (cons 1 2)
(1 . 2)
> (cons 1 '())
(1)
> (cons 1 (cons 2 x))
Exception: variable x is not bound
> (define x '())
> (cons 1 (cons 2 x))
(1 2)
> (define impr (cons 1 (cons 2 3)))
> impr
(1 2 . 3)
> (pair? impr)
#t
> (list? impr)
#f
> (positive?'a)
Exception in positive?: a is not a real number
> (positive? 'a)
Exception in positive?: a is not a real number
> (define fact2
  (lambda (n)
    (if (negative? n)
	"error"
	(fact-acc n 1))))
> (define fact-acc
  (lambda (n acc)
    (if (zero? n)
	acc
	(fact-acc (- n 1)
		  (* n acc)))))
> (fact2 5)
120
> (fact2 -6)
"error"
> (trace fact-acc)
(fact-acc)
> (fact2 5)
|(fact-acc 5 1)
|(fact-acc 4 5)
|(fact-acc 3 20)
|(fact-acc 2 60)
|(fact-acc 1 120)
|(fact-acc 0 120)
|120
120
> (define make-adder
  (lambda (n)
    (lambda (m)
      (+ m n))))
> (define add5 (make-adder 5))
> add5
#<procedure>
> (add5 4)
9
> (add5 3)
8
> ((make-adder 5) 6)
11
> (((lambda (n)
    (lambda (m)
      (+ m n)))
  5)
 3)
8
>