From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Defining an array in a let clause. Date: Mon, 5 Dec 2022 15:12:15 -0300 Message-ID: References: <83v8mq80yv.fsf@gnu.org> <0BvSrutcSlaWe-zepacwPMNYoc90vk5DENM9W5Rf0v8_aMa-ZzPF_UYBwZn6Hxr3GAIu23ivbaCXeZG5Yzzc-VHmsBIhADepPmwkqdxRcuQ=@protonmail.com> <83k0359aj2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39132"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 19:13:19 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2Fxu-0009yo-U3 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 19:13:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2FxA-00035T-Dm; Mon, 05 Dec 2022 13:12:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2Fx8-00033o-Mq for help-gnu-emacs@gnu.org; Mon, 05 Dec 2022 13:12:30 -0500 Original-Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2Fx6-00058P-WF for help-gnu-emacs@gnu.org; Mon, 05 Dec 2022 13:12:30 -0500 Original-Received: by mail-io1-xd32.google.com with SMTP id z144so3816278iof.3 for ; Mon, 05 Dec 2022 10:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ix1D9hiXj5xa7y4U2Vy+zsKbNsuaj7WtBIVCjNhRn18=; b=NIVqvgdLiMJBkO0GwEYEK2ahUD6lQ89IjYu/D/MuG1v8SGQkofxM84F5lEM+goFQUn owiWYYrvpx7Vt8oJi96tEusCm8LsKKYZeSJ8PVq6Vz6Ews88U+XORRzL1c6/sJ7fB8dj yo6VD6YByAQqaSBz1+5LQ+obGHNVfRPNQMgKi9eXRRYHZ7qlLoiPwHGJKRZxTJL6Bqos dVkqqw1td2CoTP1satnd1rqd6/uI0Yo1reCr0s/ZhTAADwk5CDVMAZfK7pbB/AKP2U65 Yej1DecghDUOxm8ASs9rVlOAcNlRi100nzgX9/bhhJBfzE0bbOwqxUewoRGnS8HDp5KM Ktdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ix1D9hiXj5xa7y4U2Vy+zsKbNsuaj7WtBIVCjNhRn18=; b=x4j9Ct2KKDNT5IGrS91c5ak3zbQchL1w8OspfaYHBrxHfHPlyPTeRPKz5tbtEowocY V1K9AlpuTzhIUBfYnw5L1wf2HTt1kAxHJg+GbGia0Di045yPQn//Os3Gy+Vm2myP/Z0/ BKXo02YVtj+Cx77FvswBR3eLhcQOHD3dIvS9PLPSCk0UVoWd4FUcaLyKpYKrIdy/TqM6 mYvmZDesI6zDlkhvsvxkSZHiKsv1GQnbOzH5B6iho2LQAnTJzfdHSBakB10vVtTyMok+ /Lk0fg+BqccpeLImiiZRyoLGY+fv8uQNvcUoiCIXOQiqmw86co6tkyhR9TMeuDHB5Sx4 DhYg== X-Gm-Message-State: ANoB5plxoliPl90QV35twm/+kv36KndzUBjfzsLt3o1CLJv4wTlwG98N wgWl7dyoFQ+fuq4ZmgZ015laBB+RIuXCdfZsq9AnyaQh29k= X-Google-Smtp-Source: AA0mqf5hneNkBAIoBWwgNzy4O76+9Ca86zqp8A9MGPO/Pg1M/z3Y6fh8dV80qGBr0smnnqw+mTt2HMaXUNiFl+vf4CQ= X-Received: by 2002:a02:93ab:0:b0:363:738a:bb7c with SMTP id z40-20020a0293ab000000b00363738abb7cmr29759509jah.227.1670263947415; Mon, 05 Dec 2022 10:12:27 -0800 (PST) In-Reply-To: <83k0359aj2.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::d32; envelope-from=eduardoochs@gmail.com; helo=mail-io1-xd32.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141403 Archived-At: On Mon, 5 Dec 2022 at 11:44, Eli Zaretskii wrote: > > > Date: Mon, 05 Dec 2022 13:56:53 +0000 > > From: Heime > > Cc: help-gnu-emacs@gnu.org > > > > ------- Original Message ------- > > On Monday, December 5th, 2022 at 12:54 PM, Eli Zaretskii wrote: > > > > > > > > Date: Mon, 05 Dec 2022 11:40:44 +0000 > > > > From: Heime heimeborgia@protonmail.com > > > > > > > > How can I set up an array of five elements in a let clause. > > > > > > > > (let ( (ss (nth 0 (decode-time))) ; seconds > > > > (mm (nth 1 (decode-time))) ; minutes > > > > (hh (nth 2 (decode-time))) ; hours > > > > (us (nth 2 (current-time))) ; microsecond > > > > (ps (nth 3 (current-time))) ; picosecond > > > > (lc (make-array '(5))) ) > > > > > > > > > There are no arrays in Emacs. Do you mean vector? if so use the function > > > 'vector' to construct a vector. If, OTOH, you want a list, use the function > > > 'list' instead. > > > > Correct, a vector with five elements. > > Then the function 'vector' is what you need to use here. Try this: (cl-destructuring-bind (ss mm hh &rest rest) (decode-time) (cl-destructuring-bind (_ _ us ps &rest rest) (current-time) (vector ss mm hh us ps))) I don't know cl-lib well... I guess that there are better ways to do that, and I hope that other people would come up and show what are these better ways... =) Cheers, Edrx http://angg.twu.net/eepitch.html