From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel Subject: Re: parallel with no exprs Date: Mon, 09 Jun 2003 10:35:50 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87y90cfcjy.fsf@zip.com.au> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1055147878 18977 80.91.224.249 (9 Jun 2003 08:37:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 9 Jun 2003 08:37:58 +0000 (UTC) Cc: djurfeldt@nada.kth.se Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jun 09 10:37:57 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19PIA8-0004vi-00 for ; Mon, 09 Jun 2003 10:37:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19PIAY-0000M1-AC for guile-devel@m.gmane.org; Mon, 09 Jun 2003 04:38:22 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19PI9b-0008CG-Qp for guile-devel@gnu.org; Mon, 09 Jun 2003 04:37:23 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19PI9N-00080F-D4 for guile-devel@gnu.org; Mon, 09 Jun 2003 04:37:10 -0400 Original-Received: from kvast.blakulla.net ([213.212.20.77]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19PI89-0007SE-MY for guile-devel@gnu.org; Mon, 09 Jun 2003 04:35:53 -0400 Original-Received: from mdj by kvast.blakulla.net with local (Exim 3.36 #1 (Debian)) id 19PI86-0003vo-00; Mon, 09 Jun 2003 10:35:50 +0200 Original-To: guile-devel@gnu.org In-Reply-To: <87y90cfcjy.fsf@zip.com.au> (Kevin Ryde's message of "Mon, 09 Jun 2003 08:07:45 +1000") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2514 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2514 Kevin Ryde writes: > I tried using parallel with no expressions, > > (use-modules (ice-9 threads)) > (call-with-values > (lambda () > (parallel)) > (lambda () > (display "hi\n"))) > > but got > > ERROR: In procedure lambda: > ERROR: bad body > > Is parallel allowed to be called with no expressions? It'd be pretty > silly to write that deliberately, but perhaps it could arise from a > simple-minded macro expansion or something. > > * threads.scm (parallel): For no forms, use `(values)' not `(begin)'. > > * tests/threads.test: New file, exercising "parallel". > > > --- threads.scm.~1.21.~ 2003-04-28 07:51:19.000000000 +1000 > +++ threads.scm 2003-06-08 14:31:57.000000000 +1000 > @@ -182,7 +182,7 @@ > %thread-handler))) > > (define-macro (parallel . forms) > - (cond ((null? forms) '(begin)) > + (cond ((null? forms) '(values)) > ((null? (cdr forms)) (car forms)) > (else > (let ((vars (map (lambda (f) Please don't apply this patch. The original code is correct. The error instead lies in the use of parallel. You'll find that for example (use-modules (ice-9 threads)) (call-with-values (lambda () (display "hello\n") (parallel)) (lambda () (display "hi\n"))) will be accepted. (lambda () (parallel)) correctly yields an error message since that is a lambda with no expressions in the body. Best regards, Mikael _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel