From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: Is there a way to convert a keyboard macro to a string? Date: Wed, 26 Jul 2017 13:51:23 -0700 Message-ID: References: <87a83r4t43.fsf@jane> <86mv7rt9y2.fsf@zoho.com> <20170726202253.GA16445@tuxteam.de> <86a83rszt1.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1501102347 2624 195.159.176.226 (26 Jul 2017 20:52:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Jul 2017 20:52:27 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 26 22:52:23 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daTI3-0000H0-GJ for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Jul 2017 22:52:19 +0200 Original-Received: from localhost ([::1]:39944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daTI8-0004os-Uf for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Jul 2017 16:52:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daTHX-0004oc-H4 for help-gnu-emacs@gnu.org; Wed, 26 Jul 2017 16:51:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daTHW-0007PP-Mr for help-gnu-emacs@gnu.org; Wed, 26 Jul 2017 16:51:47 -0400 Original-Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:35666) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1daTHW-0007O0-IR for help-gnu-emacs@gnu.org; Wed, 26 Jul 2017 16:51:46 -0400 Original-Received: by mail-qk0-x22b.google.com with SMTP id d145so86422580qkc.2 for ; Wed, 26 Jul 2017 13:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ni63Bmgblhuq7jOa3VeKLlKj5ZU08b7e6zMix5c+nRw=; b=pUiWprZXsciC21xNMI3gxKwJ1ibYYO78rVQlDJ9mV5s2WrKZwOTJa0Q89PNSKnEIy6 VQFmgDo5euSP850YDhRUpz0ZOWdiIiazR4RxzCUqEO5M7r7FK4wgE4QF0Rrz+Sk2dV5x nTGPQMFiCtBXK6J1LCw9UbyA/N2ZoP1lvdfuGM1o1n4mqB8fOJnxBhEv/M1xQ3IZCDov pIdZz/qXqhUA1/ISbm8rFe8fpfSQoEQDsRU0X4+tYCKw/8VliV6/I0wjHOtypupmrGA9 tWnQpS3TJ+u/R+ZhNovS4PitB/gEGtSGOM7OhQQUf7feQAtSmCsssgLh+ljBesi9D1J0 sZig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ni63Bmgblhuq7jOa3VeKLlKj5ZU08b7e6zMix5c+nRw=; b=W5l744ryNecT3oj4d5Oj97c2NfwKMDp2qmCphM1eNfuREsYEYAYo1a5txVHNPpxrF9 Z1PdGtdihJwuHJj8IPyp5W1LlVFihEewB/lrcypB7BjUZCP7QsCTfDWcJnI4FhBHurmj NPG9kaD6vPkgvgb3qi+/IEHnG5i2Fu6K55a74sqUnBvh/GS+67aA2o+Uxd66zpzDCdex tKNGVD80pnqsWd7q7ess2HEme4XK2swdxLOXNU0B1VWJ0WIKVGaoUifpAKfcORwvG2Vl mbaAw8KCR08qWQ7+MiL7MNM3dUoTjhAfXaVtygPEdwZDMTz27W2C5ID/sBMGOWhjupH+ 344A== X-Gm-Message-State: AIVw110uuq8D2p5AXg8iOrqRHOsOFMRKdC+zaaxg54+geBVP3sZ+i/yG GB+s90Qtyr4yifwa0g7oPXfYYeGwQQinajo= X-Received: by 10.233.220.130 with SMTP id q124mr2983493qkf.284.1501102303726; Wed, 26 Jul 2017 13:51:43 -0700 (PDT) Original-Received: by 10.237.48.241 with HTTP; Wed, 26 Jul 2017 13:51:23 -0700 (PDT) In-Reply-To: <86a83rszt1.fsf@zoho.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22b X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113885 Archived-At: Emanuel Berg wrote: > Yes, constant access time instead of linear. > Different data structures. > > Temporal complexity... or perhaps spacial? > I don't remember. > > But *how* does this happen? This is off course simplified and just for illustration, but think of the respective structures like this: struct vector { Lisp_Value *elts; }; struct cons { Lisp_Value car, cdr; }; A call like (nth n seq) then boils down to something like: /* Vector - a single array access by index */ return vector->elts[n]; /* Cons */ while (n-- > 0) /* This loop is what makes it O(N) */ cons = cdr(cons); return car(cons); That's how it happens :) John