From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Fast R6RS div/mod; improved extensibility of numerics Date: Mon, 31 Jan 2011 21:16:03 +0100 Message-ID: References: <87lj221hn7.fsf@yeeloong.netris.org> <87vd15x9fu.fsf@yeeloong.netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1296504717 13595 80.91.229.12 (31 Jan 2011 20:11:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2011 20:11:57 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 31 21:11:51 2011 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 1Pk06C-0000v7-Ln for guile-devel@m.gmane.org; Mon, 31 Jan 2011 21:11:51 +0100 Original-Received: from localhost ([127.0.0.1]:60980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pk05x-0007Lj-29 for guile-devel@m.gmane.org; Mon, 31 Jan 2011 15:11:29 -0500 Original-Received: from [140.186.70.92] (port=60758 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pk05d-0006L1-FT for guile-devel@gnu.org; Mon, 31 Jan 2011 15:11:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pk05Y-0007NS-Jt for guile-devel@gnu.org; Mon, 31 Jan 2011 15:11:05 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:55062 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pk05Y-0007NO-Hu for guile-devel@gnu.org; Mon, 31 Jan 2011 15:11:04 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 04BAD3BA9; Mon, 31 Jan 2011 15:11:57 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=UBKnIjOVw6DKHOyEQcuPwJINEnU=; b=FElFL1 Z6d95+IvGMxRlA7wHyErrSV/STOz6p1hb6vsz6U6eNs/s2XRFJHxPg6pmBIFdRD4 QaWNlSTZfM7R++UsAtsT81ju5egL2N5PnJ5dFsRSmldEoBE9LstxQ4NgI/UwiONJ ePGa2u320V3eGR6mqNP2PgdIdJwUYCbI2xhMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=p0m2iNmDVwlUmKl4LqJmauwyjOKp/TgR jJUOp/bi96WIGF2RbHsMJ8cBjmvogju1gnRTA5oWhTDGk0voj4a0bAmGN/S3Bi+O 4Y9sCw+5yS4jfyESNPF6QKZIio95JSQoGPSu9najp6aCG03ekSRzsNZIvyE0ioUo 5vDEGghrG/k= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id E668E3BA5; Mon, 31 Jan 2011 15:11:55 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 1248D3BA2; Mon, 31 Jan 2011 15:11:53 -0500 (EST) In-Reply-To: <87vd15x9fu.fsf@yeeloong.netris.org> (Mark H. Weaver's message of "Mon, 31 Jan 2011 12:35:49 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 59E771A4-2D76-11E0-A6BF-F13235C70CBC-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 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:11457 Archived-At: On Mon 31 Jan 2011 18:35, Mark H Weaver writes: > Andy Wingo writes: >>> The last patch might be slightly controversial. Although it does not >>> make `integer-expt' a generic function, nonetheless it can now >>> exponentiate _any_ scheme object that can be multiplied using `*'. >> >> To me this is fine, in principle; but I wonder about causing `(expt #t >> 0)' to produce 1. It seems that in any case the range of the output >> should be continuous -- i.e. if (expt 1) produces a matrix, >> and (expt n) for n > 1 makes a matrix, then (expt >> 0) should also produce a matrix. Or no? > > When using generic arithmetic operators, there's no way to return > objects of the correct type in all corner cases like this. I did apply it, but it made the test cases start to fail, because numbers.test is loaded after ecmascript.test, and: scheme@(guile-user)> ,L ecmascript Happy hacking with ECMAScript! To switch back, type `,L scheme'. ecmascript@(guile-user)> true * true; $1 = 1 ecmascript@(guile-user)> ,L scheme Happy hacking with Scheme! To switch back, type `,L ecmascript'. scheme@(guile-user)> (* #t #t) $2 = 1 I think that's the thing, anyway. It just sounds really squirrelly. Could you not extend `expt' or `integer-expt' instead? Andy -- http://wingolog.org/