From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.bugs Subject: (@ (rnrs base) log) optional second argument Date: Wed, 6 Apr 2011 02:11:23 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=0015176f1952d84fce04a035ab90 X-Trace: dough.gmane.org 1302052301 6420 80.91.229.12 (6 Apr 2011 01:11:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Apr 2011 01:11:41 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Apr 06 03:11:35 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 1Q7HHS-000890-0o for guile-bugs@m.gmane.org; Wed, 06 Apr 2011 03:11:34 +0200 Original-Received: from localhost ([127.0.0.1]:56061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7HHP-0000Si-3j for guile-bugs@m.gmane.org; Tue, 05 Apr 2011 21:11:31 -0400 Original-Received: from [140.186.70.92] (port=42690 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7HHJ-0000Sa-Uh for bug-guile@gnu.org; Tue, 05 Apr 2011 21:11:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7HHJ-0004dd-2a for bug-guile@gnu.org; Tue, 05 Apr 2011 21:11:25 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:58429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7HHI-0004cV-Tq for bug-guile@gnu.org; Tue, 05 Apr 2011 21:11:25 -0400 Original-Received: by iwg8 with SMTP id 8so1276083iwg.0 for ; Tue, 05 Apr 2011 18:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=hG6ercKqdwy9NyzR2H+XvW3jMlBCo3NNyXaobf3Z92U=; b=MU4iK5bZjFw8XjKVFXot2rjYBzYN3O9BmqBsO/4WPO13wnKRnLvfH1ZsR1MdEe2D81 82nxtjeJMS8jkAdwgUGLAglukhI9xA7hajDbuVB0TwpNo9TP7JQpJeNzEIqSCk83Iuy+ zUo+fhW08t5k+M7qMqBNuiSDuGjhRqSrsx5+E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=MPRamv+5ghqU3CsLeRtiB22uwVdeQrWwdv2uRBW2gaUrPprM3dC9+lH5LCOVnbNF5d Mj2+aPnZnE7IJ4KIsH6xrbX9v1wUOIKQwKeDoA0qbrJNKqYXmQ35Vpe7+YuEvzRBM+qE LZonS785vWXVyYle5wgSiwrohJ5ZW8DdQcviQ= Original-Received: by 10.231.47.130 with SMTP id n2mr338564ibf.152.1302052283633; Tue, 05 Apr 2011 18:11:23 -0700 (PDT) Original-Received: by 10.231.12.72 with HTTP; Tue, 5 Apr 2011 18:11:23 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.169 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:5429 Archived-At: --0015176f1952d84fce04a035ab90 Content-Type: text/plain; charset=ISO-8859-1 Hello guilers, Guile does not implement the optional second argument for log. I have attached a simple patch that implements it using the formula you learn in high school. I have left the behaviour for two special cases alone, as there is no clear right answer among the current R6RS implementations. If you have strong opinions on this behaviour, feel free to write something better. Regards, Ian --0015176f1952d84fce04a035ab90 Content-Type: application/octet-stream; name="0001-Added-optional-second-arg-to-R6RS-log-function.patch" Content-Disposition: attachment; filename="0001-Added-optional-second-arg-to-R6RS-log-function.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gm5kfvcm0 RnJvbSA3MzNkOGY2ODIyNmRiODJmYjFkZGEwYjQ5MmVkNGFiNzRiYTc3OWRkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBJYW4gUHJpY2UgPGlhbnByaWNlOTBAZ29vZ2xlbWFpbC5jb20+ CkRhdGU6IFdlZCwgNiBBcHIgMjAxMSAwMTo1MzozOCArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIEFk ZGVkIG9wdGlvbmFsIHNlY29uZCBhcmcgdG8gUjZSUyBsb2cgZnVuY3Rpb24KCiogbW9kdWxlL3Ju cnMvYmFzZS5zY20gKGxvZyk6IG5vdyB0YWtlcyBhIGJhc2UgYXJndW1lbnQsIHVzaW5nIHRoZQog IGNoYW5nZSBvZiBiYXNlIGZvcm11bGEgZm9yIGxvZ3MuCiogdGVzdC1zdWl0ZS90ZXN0cy9yNnJz LWJhc2UudGVzdCAoImxvZyAoMm5kIGFyZykiKTogQWRkIHRlc3QgY2FzZXMuCi0tLQogbW9kdWxl L3JucnMvYmFzZS5zY20gICAgICAgICAgICB8ICAgIDkgKysrKysrKysrCiB0ZXN0LXN1aXRlL3Rl c3RzL3I2cnMtYmFzZS50ZXN0IHwgICAxNiArKysrKysrKysrKysrKysrCiAyIGZpbGVzIGNoYW5n ZWQsIDI1IGluc2VydGlvbnMoKyksIDAgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbW9kdWxl L3JucnMvYmFzZS5zY20gYi9tb2R1bGUvcm5ycy9iYXNlLnNjbQppbmRleCAyZjVhMjE4Li5iZTI1 YjZlIDEwMDY0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