GNU bug report logs -
#65132
[PATCH] fix cond1 macro
Previous Next
Reported by: Ekaitz Zarraga <ekaitz <at> elenq.tech>
Date: Mon, 7 Aug 2023 18:28:01 UTC
Severity: normal
Tags: patch
Done: lloda <lloda <at> sarc.name>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65132 in the body.
You can then email your comments to 65132 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guile <at> gnu.org
:
bug#65132
; Package
guile
.
(Mon, 07 Aug 2023 18:28:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ekaitz Zarraga <ekaitz <at> elenq.tech>
:
New bug report received and forwarded. Copy sent to
bug-guile <at> gnu.org
.
(Mon, 07 Aug 2023 18:28:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From ab6e4980ea301b5d1e14a98464e5de3e726984f1 Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
Date: Mon, 7 Aug 2023 20:23:42 +0200
Subject: [PATCH] fix cond1 macro
* doc/ref/api-macros.texi (Macros): Fix doc1 macro example
---
doc/ref/api-macros.texi | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/ref/api-macros.texi b/doc/ref/api-macros.texi
index 7fdf578c7..f13ac0136 100644
--- a/doc/ref/api-macros.texi
+++ b/doc/ref/api-macros.texi
@@ -229,10 +229,10 @@ Literals are used to match specific datums in an expression, like the use of
((cond1 test => fun)
(let ((exp test))
(if exp (fun exp) #f)))
- ((cond1 test exp exp* ...)
- (if test (begin exp exp* ...)))
((cond1 else exp exp* ...)
- (begin exp exp* ...))))
+ (begin exp exp* ...))
+ ((cond1 test exp exp* ...)
+ (if test (begin exp exp* ...)))))
(define (square x) (* x x))
(cond1 10 => square)
--
2.41.0
Information forwarded
to
bug-guile <at> gnu.org
:
bug#65132
; Package
guile
.
(Mon, 07 Aug 2023 20:17:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 65132 <at> debbugs.gnu.org (full text, mbox):
Hi all,
Ekaitz Zarraga <ekaitz <at> elenq.tech> writes:
> From ab6e4980ea301b5d1e14a98464e5de3e726984f1 Mon Sep 17 00:00:00 2001
> From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
> Date: Mon, 7 Aug 2023 20:23:42 +0200
> Subject: [PATCH] fix cond1 macro
Just adding some context, as we talked about this on IRC.
If you take the docs example as is,
(define-syntax cond1
(syntax-rules (=> else)
((cond1 test => fun)
(let ((exp test))
(if exp (fun exp) #f)))
((cond1 test exp exp* ...)
(if test (begin exp exp* ...)))
((cond1 else exp exp* ...)
(begin exp exp* ...))))
and invoke it as
(cond1 else #t)
you get
Syntax error:
unknown location: else: bad use of 'else' syntactic keyword in
subform else of else
This is because ‘else’ matches the ‘(cond1 test exp exp* ...)’ pattern
and gets inserted as the test:
(if else (begin #t))
This patch puts the more specific ‘else’ pattern before the more general
‘test’ pattern so it has a chance to be matched.
-- Tim
Reply sent
to
lloda <lloda <at> sarc.name>
:
You have taken responsibility.
(Fri, 29 Sep 2023 17:04:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ekaitz Zarraga <ekaitz <at> elenq.tech>
:
bug acknowledged by developer.
(Fri, 29 Sep 2023 17:04:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 65132-done <at> debbugs.gnu.org (full text, mbox):
Patch applied in 1e3b5390e3c24e66013118e9751db4de5025a4a2.
Thanks,
Daniel
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 28 Oct 2023 11:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 193 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.