guile-devel
[Top][All Lists]
Advanced

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

Re: parallel with no exprs


From: Mikael Djurfeldt
Subject: Re: parallel with no exprs
Date: Thu, 12 Jun 2003 11:27:46 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> Mikael Djurfeldt <address@hidden> writes:
>>
>>      (use-modules (ice-9 threads))
>>      (call-with-values
>>          (lambda ()
>>               (display "hello\n")
>>            (parallel))
>>        (lambda ()
>>          (display "hi\n")))
>
> I get
>
>       hello
>       ERROR: Wrong number of arguments to #<procedure #f ()>

Oops.  The second lambda should have (x) as formal parameters.
But this error is independent from the problem we are discussing.
(parallel) correctly expands to (begin).  In our implementation,
(begin) evaluates to #<unspecified> which is 1 value, so the second
lambda must take 1 argument.

> I'd seen (parallel) expanding to (begin), which was what made me think
> it was the (begin) that might not be right, since the following gives
> the same error.
>
>       (call-with-values
>           (lambda ()
>             (display "hi\n")
>             (begin))
>         (lambda ()
>           (display "bye\n")))
>
>> (lambda () (parallel)) correctly yields an error
>> message since that is a lambda with no expressions in the body.
>
> Ah, somehow I missed that (lambda () (begin)) is itself an empty body.
> Bit subtle that, since of course it doesn't look empty :-).

:-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]