From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hans Aberg Newsgroups: gmane.lisp.guile.bugs Subject: Values extension Date: Fri, 21 Jan 2011 18:13:26 +0100 Message-ID: <1D08F103-57D9-449E-A801-5935EA32F149@telia.com> References: <87fwsnzju6.fsf@gnu.org> <140431E4-7361-4F1B-A0E4-199E1272E67A@telia.com> <87mxmve0kh.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1295631584 7088 80.91.229.12 (21 Jan 2011 17:39:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 Jan 2011 17:39:44 +0000 (UTC) Cc: bug-guile@gnu.org To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jan 21 18:39:38 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PgKxQ-0007IY-76 for guile-bugs@m.gmane.org; Fri, 21 Jan 2011 18:39:32 +0100 Original-Received: from localhost ([127.0.0.1]:40978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgKxP-0005OL-8R for guile-bugs@m.gmane.org; Fri, 21 Jan 2011 12:39:31 -0500 Original-Received: from [140.186.70.92] (port=59987 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgKYQ-0007i3-U0 for bug-guile@gnu.org; Fri, 21 Jan 2011 12:13:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgKYN-00021J-EP for bug-guile@gnu.org; Fri, 21 Jan 2011 12:13:41 -0500 Original-Received: from smtp-out21.han.skanova.net ([195.67.226.208]:57800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgKYN-0001z8-3g; Fri, 21 Jan 2011 12:13:39 -0500 Original-Received: from h131n2-fre-d2.ias.bredband.telia.com (78.72.157.131) by smtp-out21.han.skanova.net (8.5.133) (authenticated as u26619196) id 4D07517100C693D7; Fri, 21 Jan 2011 18:13:27 +0100 In-Reply-To: <87mxmve0kh.fsf@gnu.org> X-Mailer: Apple Mail (2.936) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5002 Archived-At: On 20 Jan 2011, at 22:18, Ludovic Court=E8s wrote: >> It is discussed here, along with some other ideas. >> >> = https://groups.google.com/group/comp.lang.scheme/browse_thread/thread/b72d= 987aa6626cd2/e2f7cfa55fb51d55?hl=3Den > > Interesting thread. It is possible to extend Scheme values as to infix tuples usage: Think of Scheme (f x_1 ... x_k) as equivalent to f(x_1 ... x_k), and =20 add the reduction of tuples singletons (x) =3D x. Then (f (values =20 x_1 ... x_k)) is the same as f((x_1 ... x_k)) =3D f(x_1 ... x_k), that =20= is (f x_1 ... x_k). However, if more than one of the x_i in is a non-=20 singleton, it is an iterated tuple which cannot be reduced on its =20 topmost level. In addition, I extended so that if f =3D (f_1, ..., f_n), then f(x) is =20= defined to (f_1(x), ..., f_n(x)). For values, ((values f_1 ... f_n) =20 x_1 ... x_k) computes to (values (f_1 x_1 ... x_k) ... (f_n x_1 ... =20 x_k)). With this syntax, one can write (atan ((values sin cos) x)). Also, functions that return no value might just as well return =20 (values) instead of an internal unspecified value. It will then be as =20= in C/C++. This syntax is not at all complicated to use.