From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Newsgroups: gmane.lisp.guile.devel Subject: Re: Exposing more math functionality Date: Thu, 19 Aug 2010 15:37:05 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1282250240 28683 80.91.229.12 (19 Aug 2010 20:37:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 19 Aug 2010 20:37:20 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Aug 19 22:37:18 2010 Return-path: Envelope-to: guile-devel@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 1OmBrS-0007zf-47 for guile-devel@m.gmane.org; Thu, 19 Aug 2010 22:37:18 +0200 Original-Received: from localhost ([127.0.0.1]:37001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmBrR-0001DA-Cj for guile-devel@m.gmane.org; Thu, 19 Aug 2010 16:37:17 -0400 Original-Received: from [140.186.70.92] (port=55481 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmBrN-0001Cj-Hv for guile-devel@gnu.org; Thu, 19 Aug 2010 16:37:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OmBrM-0007ll-2H for guile-devel@gnu.org; Thu, 19 Aug 2010 16:37:13 -0400 Original-Received: from mail-qw0-f41.google.com ([209.85.216.41]:59619) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmBrM-0007lc-02 for guile-devel@gnu.org; Thu, 19 Aug 2010 16:37:12 -0400 Original-Received: by qwk4 with SMTP id 4so2296729qwk.0 for ; Thu, 19 Aug 2010 13:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9ZtooWrs5lp3yVeYHqFhdX20ZwuODgTJ0+ATV942fLM=; b=XtKDkvxPoT+4OaobPOT2lPMVJL0OotKL4/XQPovsC+zC71ufxyHVl8qtku085s1hBL EVj94o9ntvaMR/JrKnajUcm9UyF7x0soMVb7cHpAX6rzqImVL912NSNLkhBKggA8HZep 7LNvebxbIcKFbGj629t9vrq94mJ/Bh2RNICvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fOCwxMDVyxma68yG8bsVuuXFZ2SJC8A1hHxbEmirpogrYpYLCt869QnUzLRuWH9GH7 NYRUHtNhrhKT13LXVBT2H7M1RTCmDd3y3PC3h49PzekaimdBdFaDSFmtKMk9ZZS2TbJL 4QfAnZ/xN7TMmiGmJypfEK3Xju+C7CUdVKw4o= Original-Received: by 10.229.232.129 with SMTP id ju1mr338138qcb.128.1282250230270; Thu, 19 Aug 2010 13:37:10 -0700 (PDT) Original-Received: by 10.229.225.149 with HTTP; Thu, 19 Aug 2010 13:37:05 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10779 Archived-At: On Thu, Aug 19, 2010 at 11:04 AM, Andy Wingo wrote: > Heya, > > On Fri 23 Jul 2010 20:46, No Itisnt writes: > >> I'd like to patch Guile's math functionality to expose M_PI, modf, and >> probably other things as well. Before I started I thought I'd ask -- >> would such a patch be accepted? And is there any policy on where they >> should go? It seems a little crass to clutter up the (guile) namespace >> any more, but I don't see anywhere else those could go. > > Hum, I think the right thing is to talk about these one by one. > > For pi, I think I'd like to avoid adding it to the namespace, partly > because I can't think of a good name. M_PI is ugly :) You can always > define it as (define pi (* 4 (atan 1))) or something. > > Actually my schooling was in engineering, so I'd say (define pi 3). ;-) > > Regarding modf -- it seems that the R6RS extends the definition of > `modulo' (called `mod') to be defined over the real numbers. > > =A0(mod 10 3) =3D> 1 > =A0(mod 10 3.0) =3D> 1.0 > =A0(mod 10 3.1) =3D> 0.7 > > This appears to be a compatible extension of the R5RS' `modulo', so we > should just extend our definition. That way we can avoid adding another > symbol. > > Let me know if you're interested in doing this, otherwise I'll get > around to it eventually. But perhaps someone who is less fast-and-loose > with accuracy should do it ;-) > > Cheers, > > Andy > -- > http://wingolog.org/ I managed to phone it in on these, except for modf, so I don't have any need for them, although exposing pi might not be a bad idea anyway.