Subject: bug#14537: closed (Re: bug#14537: defect in guile with syntax transformation)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 03 Jun 2013 22:41:02 +0000

Your bug report

#14537: defect in guile with syntax transformation

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
14537: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14537
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#14537: defect in guile with syntax transformation
From: [email-masked] (Ludovic Courtès)
To: "Dr. M. Luedde" <[email-masked]>
Cc: "[email-masked]" <[email-masked]>, "[email-masked]" <[email-masked]>
Date: Tue, 04 Jun 2013 00:38:44 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

"Dr. M. Luedde" <[email-masked]> skribis:

> alright, I compiled guile 2.0.6 on my cygwin system. 
>  
> Given the amount and content of the warnings, it came as a surprise to me that the compilation apparently was successul and the resulting guile did process my testcase without the previously exhibited errors.
>  
> I consider this defect report closed. 

OK, thanks!

I know my answer may have sounded a bit frustrating, but it’s been more
than two years since 2.0 was released.  It’s really a huge step forward
compared to Guile 1.8, and we hope people can appreciate it and find it
a good incentive to upgrade.

Ludo’.

Subject: defect in guile with syntax transformation
From: "Dr. M. Luedde" <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Sun, 2 Jun 2013 09:14:48 +0100 (BST)
List-Id: <debbugs-submit.debbugs.gnu.org>

;; I think the below code exhibits a defect with guile 1.8.7.
;;
;; The `defrec' syntax transformer (defined below) does not behave
;; correctly within an imbedding `let' expression.
;;
;; The system is CYGWIN_NT-6.1-WOW64 WDFN00305859A 1.7.18(0.263/5/3)
;; 2013-04-19 10:39 i686 Cygwin
;;
;; Guile runs in GNU bash, version 4.1.10(4)-release (i686-pc-cygwin)

;; enable `define-syntax' functionality
(use-modules (ice-9 syncase))
;; OK

(let ( (n 99) )
  (begin
    (define
      ev.OK? (lambda (x) (if (zero? x) #t
			     (od.OK? (- x 1)))))
    (define
      od.OK? (lambda (x) (if (zero? x) #f
			     (ev.OK? (- x 1))))))
  (od.OK? 99))
;; OK, evaluates to #t

(define-syntax defrec
  ;; TYPE: syntax transformer.
  ;;
  ;; REQUIRES: (defrec . X) requires that X := ((S_1 V_1) ... (S_N
  ;; V_N)). The S_I are mutually distinct symbols. The V_J may contain
  ;; references to the S_I. On evaluation of any V_J the value bound
  ;; to a referenced S_I must not be needed.
  ;;
  ;; RETURNS: The value of the expression (begin (define S_1 #f)
  ;; ... (define S_N #f) (set! S_1 V_1) ... (set! S_N V_N)).
  (syntax-rules ()
    ((_ (S V) ...)
     (begin (define S #f) ...
	    (set! S V) ...))))
;; OK

(defrec
  (ev.broken? (lambda (x) (if (zero? x) #t
			      (od.broken? (- x 1)))))
  (od.broken? (lambda (x) (if (zero? x) #f
			      (ev.broken? (- x 1))))))
(od.broken? 99)
;; OK, evaluates to #t

(let ( (n 99) )
  (defrec
    (ev.broken? (lambda (x) (if (zero? x) #t
				(od.broken? (- x 1)))))
    (od.broken? (lambda (x) (if (zero? x) #f
				(ev.broken? (- x 1))))))
  (od.broken? n))
;; Produces an error message: 
;; In standard input:
;;   14: 0* (let* ((n 99)) (defrec (ev.broken? #) (od.broken? #)) (od.broken? n))

;; standard input:14:1: In procedure memoization in expression (let* (#) (defrec # #) ...):
;; standard input:14:1: In file "standard input", line 14: Mixed definitions and expressions in (defrec (ev.broken? (lambda (x) (if (zero? x) #t (od.broken? (- x 1))))) (od.broken? (lambda (x) (if (zero? x) #f (ev.broken? (- x 1)))))).
;; Backtrace:
;; ABORT: (syntax-error)
--
Dr. M. Luedde, Rheinblick 26A, D-69226 Nussloch, Germany
+49-175-2779708, Skype: MirkoLuedde