unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mikael Djurfeldt <djurfeldt@nada.kth.se>
Cc: djurfeldt@nada.kth.se
Subject: Re: parallel with no exprs
Date: Thu, 12 Jun 2003 11:27:46 +0200	[thread overview]
Message-ID: <xy7of13y7al.fsf@nada.kth.se> (raw)
In-Reply-To: <87k7bskqlp.fsf@zip.com.au> (Kevin Ryde's message of "Thu, 12 Jun 2003 11:54:26 +1000")

Kevin Ryde <user42@zip.com.au> writes:

> Mikael Djurfeldt <mdj@kvast.blakulla.net> 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 :-).

:-)


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2003-06-12  9:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-08 22:07 parallel with no exprs Kevin Ryde
2003-06-09  8:35 ` Mikael Djurfeldt
2003-06-12  1:54   ` Kevin Ryde
2003-06-12  9:27     ` Mikael Djurfeldt [this message]
2003-06-13 23:48       ` Kevin Ryde
2003-06-16 18:45         ` Mikael Djurfeldt
2003-06-19  1:40           ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xy7of13y7al.fsf@nada.kth.se \
    --to=djurfeldt@nada.kth.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).