From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.help Subject: Re: How to specialize seq-concatenate and seq-into-sequence? Date: Fri, 4 Mar 2022 21:56:12 +0100 Message-ID: <4F58A846-36B5-4D52-88A1-9D6F63773679@gmail.com> References: <4E8CCFE1-514F-4636-A69E-B78562BBC702@gmail.com> <389E16F7-14BD-492B-93EE-9D542C374628@gmail.com> <871qzibg2a.fsf@web.de> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40790"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 04 21:57:35 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 1nQEzW-000AQ1-SU for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 04 Mar 2022 21:57:34 +0100 Original-Received: from localhost ([::1]:38898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQEzV-0000tR-EZ for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 04 Mar 2022 15:57:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQEyO-0000ss-IW for help-gnu-emacs@gnu.org; Fri, 04 Mar 2022 15:56:24 -0500 Original-Received: from [2a00:1450:4864:20::630] (port=46651 helo=mail-ej1-x630.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQEyM-0000hr-Lr for help-gnu-emacs@gnu.org; Fri, 04 Mar 2022 15:56:23 -0500 Original-Received: by mail-ej1-x630.google.com with SMTP id qx21so19818871ejb.13 for ; Fri, 04 Mar 2022 12:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Hk6U8VrBRdXjWfUaQDSzdn0KNvVJG4ye0nAyYYaCTpI=; b=iR5nTjDM+uZcYp20YRnGTw4UyKu+jnNyruGEgv0+9Fw8yuGMC9952E/W7HvZLL4ZdK N0HjW3EuTj6E9p89Y3aY7yatregqd9a8Ua54oOLD+GTtC6InCslF385VGqWjGOYiP+qW Q3znc6ke8H9p5PCw3Aa67oMYa2c4rF9/OR20fxPeO2UrejlCzPGeLXO4A8LtB0ULacJV oVccLj19VQTXpp4tFeVoRf9j7LAWclQNr1YoC/dx6+/0FxGstuB7G4bJEf85c1s2CQ/b MwHcLDuCtngT6eOgN2+njy8eKumoMYle4CVcP8YZw2oE24j4Ar8IShpSz2FTdAEFcBNc h1VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Hk6U8VrBRdXjWfUaQDSzdn0KNvVJG4ye0nAyYYaCTpI=; b=ryPIG/j1XW+rgpohmKmcS3HffjlSU8kqrgQ/lF+3YyV9j7Ou6txfq2D8GBmHX8AJLY 5DFuOaweCRuqzKAvPKCfP+gX3IKqJ7/0jsdWl6ywcoW/XymeSm1Jfb2OWCJsuPyGi9wg B4esSistcrNgyG3Gp8UvlrDYNz0Oa1ZDPNAw/LF+L9IDf65W1QQmCeQ2PLS9k6mS8pmW Gkr6Guxg+13o2AFKnG0I4V+j1fDLI6nLQu8aNzsC0n7vtzR5bWyL2uli9uVwtFr3wg4G AWP+PIui5xucB7XUxZDH8Cd+5+LOnXGU+q62mJMY/Gp8lnsc/j7wU9LnsFb4XRgiI2xZ w9TA== X-Gm-Message-State: AOAM530Bqvy+/xG3wXZAXYS6SNlTMQHcfrhQ6OnwQzFAoptMdYlmVOOW uNDOqlS+GPXUWwjUmQPKYOmjHIgnrPw= X-Google-Smtp-Source: ABdhPJy8ay5x0glby73UgZsR63XKCL9UyKGo+MVJx29x93vlThm+xq5RUC0LnINQq0I/9KSnFX5oFQ== X-Received: by 2002:a17:906:1e91:b0:6ae:99d9:93b1 with SMTP id e17-20020a1709061e9100b006ae99d993b1mr481911ejj.111.1646427374735; Fri, 04 Mar 2022 12:56:14 -0800 (PST) Original-Received: from smtpclient.apple ([2a02:2455:2a4:dc00:b076:b55f:1e3f:3aa7]) by smtp.gmail.com with ESMTPSA id gv9-20020a170906f10900b006d7128b2e6fsm2124478ejb.162.2022.03.04.12.56.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Mar 2022 12:56:14 -0800 (PST) In-Reply-To: <871qzibg2a.fsf@web.de> X-Mailer: Apple Mail (2.3693.60.0.1.1) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::630 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=p.stephani2@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Xref: news.gmane.io gmane.emacs.help:136364 Archived-At: > Am 04.03.2022 um 03:35 schrieb Michael Heerdegen = : >=20 > Philipp Stephani writes: >=20 >>> Define `it`. >>> The dispatch is expected to be on the `type` argument (using an >>> `eql` specializer). >>>=20 >>=20 >> Doesn't that contradict the docstring? >=20 > I'm also a bit confused. How would you concatenate a list and a = stream > to a list? Or how would you implement it? I guess the idea is that `seq-concatenate' can only be specialized for = new *result* types, not for new *argument* types. That is, if you have = a new sequence-like type `my-sequence', you can specialize it like so: (cl-defmethod ((_type (eql my-sequence)) &rest sequences) (my-sequence-concatenate (mapcar #'convert-to-my-sequence sequences))) where `my-sequence-concatenate' and `convert-to-my-sequence' are = functions specific to the new sequence type. It's not possible to = convert a `my-sequence' to a list this way; for that you'd need to = specialize `seq-into' or `seq-into-sequence' instead.=