[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

This page is part of the web mail archives of SRFI 31 from before July 7th, 2015. The new archives for SRFI 31 contain all messages, not just those from before July 7th, 2015.

*To*: <Mirko.Luedde@xxxxxxxxxxxx>*Subject*: SRFI 31*From*: Ashley Yakeley <ashley@xxxxxxxxxxxx>*Date*: Tue, 5 Nov 2002 00:35:10 -0800*Cc*: <srfi-31@xxxxxxxxxxxxxxxxx>*Delivered-to*: srfi-31@xxxxxxxxxxxxxxxxx

As an alternative to your 'rec', there's the fixed-point-finding function 'call-with-result' that I implemented in my Scheme interpreter HScheme. call-with-result calls a function, passing to it the result that the function will return. For instance: (define factorial (call-with-result (lambda (fact) (lambda (x) (if (equal? x 0) 1 (* x (fact (- x 1)))) ) ))) (define stream1 (call-with-result (lambda (s) (cons 1 s) ))) It's a little time-travel trick. You can try it out here: <http://hscheme.sourceforge.net/examples.html> Unfortunately call-with-result seems to be incompatible with CPS (and apparently therefore with call-with-current-continuation), so the resulting Scheme isn't R5RS. HScheme comes in both flavours, but is not yet R5RS-complete for other reasons. -- Ashley Yakeley, Seattle WA

- Prev by Date:
**SRFI-31 (rec): name; overjustification; formal specification** - Previous by thread:
**SRFI-31 (rec): name; overjustification; formal specification** - Index(es):