unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Is ice-9/poe.scm broken?
@ 2005-08-08 15:52 Alan Grover
  2005-08-10  1:56 ` Kevin Ryde
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Grover @ 2005-08-08 15:52 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Is ice-9/poe.scm broken?
@ 2005-08-08 21:53 Thien-Thi Nguyen
  0 siblings, 0 replies; 6+ messages in thread
From: Thien-Thi Nguyen @ 2005-08-08 21:53 UTC (permalink / raw)
  Cc: guile-user

   From: Alan Grover <awgrover@mail.msen.com>
   Date: Mon, 08 Aug 2005 11:52:10 -0400

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

i likewise had to munge poe.scm for Guile 1.4.x.  see:

  http://www.glug.org/people/ttn/software/guile/
  http://www.glug.org/docbits/guile/1.4.x/Memoization.html

thi


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-08-13 10:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-08 15:52 Is ice-9/poe.scm broken? Alan Grover
2005-08-10  1:56 ` 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

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).