Email list hosting service & mailing list manager

Simpler implementation with R7RS parameters? Adam Nelson (27 Apr 2020 20:50 UTC)
(missing)
Re: Simpler implementation with R7RS parameters? Adam Nelson (04 Jun 2020 18:13 UTC)
Re: Simpler implementation with R7RS parameters? Marc Nieper-Wißkirchen (04 Jun 2020 18:16 UTC)
Re: Simpler implementation with R7RS parameters? Shiro Kawai (05 Jun 2020 01:05 UTC)
Re: Simpler implementation with R7RS parameters? Marc Nieper-Wißkirchen (05 Jun 2020 06:16 UTC)
Re: Simpler implementation with R7RS parameters? Shiro Kawai (05 Jun 2020 07:07 UTC)
Re: Simpler implementation with R7RS parameters? Marc Nieper-Wißkirchen (05 Jun 2020 07:37 UTC)
Re: Simpler implementation with R7RS parameters? Shiro Kawai (05 Jun 2020 09:14 UTC)
Re: Simpler implementation with R7RS parameters? Marc Nieper-Wißkirchen (28 Apr 2020 06:27 UTC)
Re: Simpler implementation with R7RS parameters? Marc Nieper-Wißkirchen (05 May 2020 14:56 UTC)

Re: Simpler implementation with R7RS parameters? Marc Nieper-Wißkirchen 05 Jun 2020 07:36 UTC

Am Fr., 5. Juni 2020 um 09:07 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:

> Ah, yes.  But if you say "yield is an identifier bound to syntax." as in the current srfi text, it does sound something special.

What would you propose? Do you think that there is some better wording?

>> (define-coroutine-generator f
>>   (yield (lambda () (yield 1))))
>>
>> (define-coroutine-generator g
>>   (yield
>>    (let ((x (f)))
>>      (if (proc? x) (x) x)))))
>>
>> (g) ;=> 1
>>
>> This won't work with dynamic scoping of `yield'. (One can probably
>> think of a much simpler example.)
>
>
> This yields 1 in my implementation (with replacing proc? with procedure?).
> Is it supposed to work differently?

Indeed, the example cannot show the difference. It was a bad one. Can
you try the following one?

(define-coroutine-generator f
  (yield (lambda () (yield 1))))

(define-coroutine-generator g
  (yield
   (+ 1 (let ((x (f)))
            (if (proc? x) (x) x)))))

(g) ;=> 2