From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: parallel with no exprs Date: Mon, 09 Jun 2003 08:07:45 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87y90cfcjy.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1055110015 3242 80.91.224.249 (8 Jun 2003 22:06:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 8 Jun 2003 22:06:55 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jun 09 00:06:53 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 19P8JR-0000q1-00 for ; Mon, 09 Jun 2003 00:06:53 +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 19P8L8-0003wk-LL for guile-devel@m.gmane.org; Sun, 08 Jun 2003 18:08:38 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19P8Km-0003p9-30 for guile-devel@gnu.org; Sun, 08 Jun 2003 18:08:16 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19P8KY-0003SP-Oy for guile-devel@gnu.org; Sun, 08 Jun 2003 18:08:03 -0400 Original-Received: from snoopy.pacific.net.au ([61.8.0.36]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19P8KW-0003Gk-ES for guile-devel@gnu.org; Sun, 08 Jun 2003 18:08:00 -0400 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) h58M7wYd011414 for ; Mon, 9 Jun 2003 08:07:58 +1000 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h58M7wQg016470 for ; Mon, 9 Jun 2003 08:07:58 +1000 (EST) Original-Received: from localhost (ppp18.dyn228.pacific.net.au [203.143.228.18]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h58M7uYZ007878 for ; Mon, 9 Jun 2003 08:07:56 +1000 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19P8KH-0000QF-00; Mon, 09 Jun 2003 08:07:45 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (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:2513 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2513 --=-=-= 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". --=-=-= Content-Disposition: attachment; filename=threads.scm.parallel-empty.diff --- 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) --=-=-= Content-Disposition: attachment; filename=threads.test ;;;; threads.test --- Tests for Guile threading. -*- scheme -*- ;;;; ;;;; Copyright 2003 Free Software Foundation, Inc. ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2, or (at your option) ;;;; any later version. ;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this software; see the file COPYING. If not, write to ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, ;;;; Boston, MA 02111-1307 USA (use-modules (ice-9 threads) (test-suite lib)) (with-test-prefix "parallel" (pass-if "0" (call-with-values (lambda () (parallel)) (lambda () #t))) (pass-if "1" (call-with-values (lambda () (parallel 1)) (lambda (x) (equal? x 1)))) (pass-if "1 2" (call-with-values (lambda () (parallel 1 2)) (lambda (x y) (and (equal? x 1) (equal? y 2))))) (pass-if "1 2 3" (call-with-values (lambda () (parallel 1 2 3)) (lambda (x y z) (and (equal? x 1) (equal? y 2) (equal? z 3)))))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--