unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Alan Grover <awgrover@mail.msen.com>
Subject: Is ice-9/poe.scm broken?
Date: Mon, 08 Aug 2005 11:52:10 -0400	[thread overview]
Message-ID: <42F77FAA.5020001@mail.msen.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 956 bytes --]

When I tried to use poe to cache some functions, I got a run-time error.
When I examined poe.scm to understand what I did wrong, I found code
that doesn't make sense under guile. Can anyone confirm that poe is
outdated, or I have a completely wrong idea of how to use it?

guile: 1.6.4

Here's how I tried to use it:

	(use-modules (ice-9 poe))
	(define (some-fn a) (list 'did-something a)) ; trivial function
	(define cached-fn (pure-funcq some-fn))

	(some-fn 'an-arg)
	(cached-fn 'an-arg) ; first time through (dies in here)
	(cached-fn 'an-arg) ; second time through

In poe.scm, it seems to be using the old idiom of '() being treated as
false:

	(or (and (and (not key) (not entry))
	... (eq? (car key) (car entry))

Which I think is supposed to be
	(or (and (and (not (pair? key)) (not (pair? entry)))
	... (eq? (car key) (car entry))

I re-wrote enough of poe.scm to get some things working.

-- 
Alan Grover
awgrover@mail.msen.com
+1.734.476.0969

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

             reply	other threads:[~2005-08-08 15:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-08 15:52 Alan Grover [this message]
2005-08-10  1:56 ` Is ice-9/poe.scm broken? Kevin Ryde
2005-08-10 22:33   ` Marius Vollmer
2005-08-13  0:46     ` Kevin Ryde
2005-08-13 10:50       ` Marius Vollmer
  -- strict thread matches above, loose matches on Subject: below --
2005-08-08 21:53 Thien-Thi Nguyen

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=42F77FAA.5020001@mail.msen.com \
    --to=awgrover@mail.msen.com \
    /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).