For Programmers: Free Programming Magazines  


Home > Archive > Scheme > February 2005 > Looking for good implementation of srfi 40?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Looking for good implementation of srfi 40?
Daniel Yoo

2005-02-27, 3:59 am

Hi everyone,

I've been trying to get SRFI-40 working in PLT Scheme, but have run
into the same kinds of problems that Alexander Thiel ran into with the
reference implementation:

http://srfi.schemers.org/srfi-40/srfi-40.html

Alexander reported that the implementation of promises was broken:

http://srfi.schemers.org/srfi-40/po...e/msg00008.html

and I'm seeing the same error message from the simple test using
mzscheme -M errortrace:

;;;;;;
> (require "srfi-40.ss") ;; my copy-and-paste of the implementation
> (stream-car (stream-cons 1 (cons-stream 2 stream-null)))

car: expects argument of type <pair>; given lazy
/Users/dyoo/Desktop/srfi-40.ss:53:12: (car content)
/Users/dyoo/Desktop/srfi-40.ss:53:6: (let-values (((x) (car content))) (if (memv x (quote (....))) (begin (cdr content)) (if (memv ......
/Users/dyoo/Desktop/srfi-40.ss:81:23: (null? (stream-low-level-force (stream-promise obj)))
/Users/dyoo/Desktop/srfi-40.ss:89:4: (if (stream-null? strm) (begin (stream-error "attempt to take stream-car of null stream")) (begin...
;;;;;;


The reference implementation still looks like it is using a flawed
version of a promise. I've been looking at the implementation in
Chicken:

http://www.call-with-current-contin...gs/srfi-40.html

which looks better. But I'm surprised that the reference
implementation of SRFI-40 doesn't seem to work out-of-the-box.

I have to assume for the moment that I'm probably misunderstanding
something, since I can't believe this hasn't been fixed in months.
Any help in understanding the situation would be greatly appreciated!
Michael Sperber

2005-02-27, 9:00 am


You may want to post this to SRFI 40 mailing list :-)

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
andreuri2000@yahoo.com

2005-02-27, 4:00 pm

Daniel Yoo wrote:

> I've been trying to get SRFI-40 working in PLT Scheme, but have run
> into the same kinds of problems that Alexander Thiel ran into with

the
> reference implementation:
>
> http://srfi.schemers.org/srfi-40/srfi-40.html


Hello Daniel,

I posted an implementation which I believe to be correct
to the SRFI-40 post-finalization discussion list. To get it
working in PLT, just import SRFIs 1 and 9 as follows:

(require (lib "9.ss" "srfi")
(lib "list.ss" "srfi" "1"))

Good luck
Andre van Tonder

David Van Horn

2005-02-27, 4:00 pm

Daniel Yoo wrote:
> Hi everyone,
>
> I've been trying to get SRFI-40 working in PLT Scheme, but have run
> into the same kinds of problems that Alexander Thiel ran into with

the
> reference implementation:
>
> http://srfi.schemers.org/srfi-40/srfi-40.html
>
> Alexander reported that the implementation of promises was broken:
>
> http://srfi.schemers.org/srfi-40/po...e/msg00008.html


Hello Daniel,

Thanks for the note; these problems have now been fixed in the
reference implementation.

David

Daniel Yoo

2005-02-27, 8:59 pm

David Van Horn <dvanhorn@cs.uvm.edu> wrote:
: Daniel Yoo wrote:
:> Hi everyone,
:>
:> I've been trying to get SRFI-40 working in PLT Scheme, but have run
:> into the same kinds of problems that Alexander Thiel ran into with
: the
:> reference implementation:
:>
:> http://srfi.schemers.org/srfi-40/srfi-40.html
:>
:> Alexander reported that the implementation of promises was broken:
:>
:> http://srfi.schemers.org/srfi-40/po...e/msg00008.html

: Hello Daniel,

: Thanks for the note; these problems have now been fixed in the
: reference implementation.

Hi David,

Excellent! Thank you very much.

There's still a small typo in the implementation; the reference to
stream-low-level-lazy in the stream-delay syntax needs to be corrected
to srfi-40:delay.
David Van Horn

2005-02-28, 4:00 pm

Daniel Yoo wrote:
> There's still a small typo in the implementation; the reference to
> stream-low-level-lazy in the stream-delay syntax needs to be

corrected
> to srfi-40:delay.


I believe it should be srfi-40:lazy, but yes it needed to be changed,
and has been.

Thanks,
David

Daniel Yoo

2005-02-28, 4:00 pm

David Van Horn <dvanhorn@cs.uvm.edu> wrote:
: Daniel Yoo wrote:
:> There's still a small typo in the implementation; the reference to
:> stream-low-level-lazy in the stream-delay syntax needs to be
: corrected
:> to srfi-40:delay.

: I believe it should be srfi-40:lazy, but yes it needed to be changed,
: and has been.


Hi David,

I've been making lots of typos too, it seems. *grin*

Thank you for the correction; the reference implementation is working
beautifully now.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com