From: Kevin Ryde <user42@zip.com.au>
Subject: poe.scm perfect-funcq bit rot
Date: Sun, 21 Sep 2003 09:22:34 +1000 [thread overview]
Message-ID: <87d6dvyrid.fsf@zip.com.au> (raw)
I was silly enough to try poe.scm,
(use-modules (ice-9 poe))
(define p (perfect-funcq 123 noop))
(p 'x)
and got
In procedure caar in expression (caar alist):
Wrong type argument in position 1: ()
ABORT: (wrong-type-arg)
This is in funcq-assoc, and I think that function looks fairly
doubtful as it stands.
It seems to be assuming '() is false, which might be some bit-rot, and
I also can't see how it works its way down the given alist, it looks
like the and-map loop will only examine the first entry.
Perhaps (below),
* poe.scm (funcq-assoc): Rewrite, don't assume '() is false, actually
traverse the given alist.
This quietly drops the "let ((it ..." business, which I assume serves
no purpose.
This would probably be for 1.6 too, though it's all undocumented so
doesn't really rate.
;; return true if lists X and Y are the same length and each element is `eq?'
(define (eq?-list x y)
(if (null? x)
(null? y)
(and (not (null? y))
(eq? (car x) (car y))
(eq?-list (cdr x) (cdr y)))))
(define (funcq-assoc arg-list alist)
(if (null? alist)
#f
(if (eq?-list arg-list (caar alist))
(car alist)
(funcq-assoc arg-list (cdr alist)))))
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next reply other threads:[~2003-09-20 23:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-20 23:22 Kevin Ryde [this message]
2003-10-07 15:53 ` poe.scm perfect-funcq bit rot Marius Vollmer
2003-10-08 23:03 ` Kevin Ryde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d6dvyrid.fsf@zip.com.au \
--to=user42@zip.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).