From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: [Request] seq-map and mapcar with arbitrary number of sequences Date: Sat, 10 Oct 2015 22:53:20 +0100 Message-ID: References: <87si5ifvvk.fsf@fencepost.gnu.org> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3ea42de51790521c71ff7 X-Trace: ger.gmane.org 1444514010 32397 80.91.229.3 (10 Oct 2015 21:53:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Oct 2015 21:53:30 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 10 23:53:27 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zl250-0006zY-G5 for ged-emacs-devel@m.gmane.org; Sat, 10 Oct 2015 23:53:26 +0200 Original-Received: from localhost ([::1]:46497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zl250-0002XF-1n for ged-emacs-devel@m.gmane.org; Sat, 10 Oct 2015 17:53:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zl24w-0002X9-T7 for emacs-devel@gnu.org; Sat, 10 Oct 2015 17:53:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zl24v-0005mw-FI for emacs-devel@gnu.org; Sat, 10 Oct 2015 17:53:22 -0400 Original-Received: from mail-lb0-x22e.google.com ([2a00:1450:4010:c04::22e]:35280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zl24v-0005mi-95 for emacs-devel@gnu.org; Sat, 10 Oct 2015 17:53:21 -0400 Original-Received: by lbwr8 with SMTP id r8so111085391lbw.2 for ; Sat, 10 Oct 2015 14:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=6WZv9jTVoiLeBYNjIS4RtIxllqVwj/64ByNsSBbhFVE=; b=w34nTsWHyZnvW4NlTUSL2WX5qIYpPCUhlDGQkAH1NX6h1KA908y+LG4PTcD5csyhUY +usfFa/WTUDqwlzLaKWH6jMfM/f2DesasUhplCxaD2D6+OXTVo5tjvbzvNczb+PSk4wo rHbcKK+sKdBBW0enwnN2ML/rp0duh7jKFuk5DWYF8/p7tvqutmG/lVtLo+1m+YsOlmsz iAr1PxRXl4Q6mq7YslBEQgQje1OEO+/jq8O/G3VavtLmBCGmEJUpO0HMvX6O3xkMMCMb rvCrZ33VBIpK6c+K/dr2fHGgsgJ0SIGNQ+QE3Cx8FRn9tPegLaI628JNmZJJA0xCXHzG ofdg== X-Received: by 10.112.63.135 with SMTP id g7mr9494201lbs.16.1444514000423; Sat, 10 Oct 2015 14:53:20 -0700 (PDT) Original-Received: by 10.25.27.78 with HTTP; Sat, 10 Oct 2015 14:53:20 -0700 (PDT) Original-Received: by 10.25.27.78 with HTTP; Sat, 10 Oct 2015 14:53:20 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: XfMcg63Mpwq-v2y9cTs19OV-vt4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:191179 Archived-At: --001a11c3ea42de51790521c71ff7 Content-Type: text/plain; charset=UTF-8 Yes. Supporting this on mapc and mapcar should not incur a performance cost on the single seq version. I figured the c code for these functions could just check if the &rest argument is nil, and then use the current (single seq) implementation. If this single conditional imposes a noticeable overhead we can optimise it out with a compiler macro too (I think). On 10 Oct 2015 9:10 pm, "John Wiegley" wrote: > >>>>> David Kastrup writes: > > > The byte compiler should be able to squash the difference, right? > > If you can demonstrate that to me, I'm sold. As long as the C code doesn't > change, and the increase in complexity vanishes at byte-compilation time, I > have no argument. > > John > > --001a11c3ea42de51790521c71ff7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Yes. Supporting this on mapc and mapcar should not incur a p= erformance cost on the single seq version. I figured the c code for these f= unctions could just check if the &rest argument is nil, and then use th= e current (single seq) implementation.

If this single conditional imposes a noticeable overhead we = can optimise it out with a compiler macro too (I think).

On 10 Oct 2015 9:10 pm, "John Wiegley"= <johnw@newartisans.com>= wrote:
>>>= >> David Kastrup <dak@gnu.org&g= t; writes:

> The byte compiler should be able to squash the difference, right?

If you can demonstrate that to me, I'm sold. As long as the C code does= n't
change, and the increase in complexity vanishes at byte-compilation time, I=
have no argument.

John

--001a11c3ea42de51790521c71ff7--