From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Short functions Date: Mon, 06 Jan 2025 18:02:43 +0100 Message-ID: <87a5c37u4s.fsf@daniel-mendler.de> References: <173617561349.1583674.17727386803499537943@vcs3.savannah.gnu.org> <20250106150015.2A1DD1043A07@vcs3.savannah.gnu.org> <87cygz7wl8.fsf@daniel-mendler.de> Reply-To: Daniel Mendler Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4191"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 06 18:03:35 2025 Return-path: Envelope-to: ged-emacs-devel@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 1tUqVp-0000uT-RU for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jan 2025 18:03:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUqVG-0002DV-K0; Mon, 06 Jan 2025 12:02:58 -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 1tUqV9-0001xI-MF for emacs-devel@gnu.org; Mon, 06 Jan 2025 12:02:53 -0500 Original-Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUqV7-0000k9-NY for emacs-devel@gnu.org; Mon, 06 Jan 2025 12:02:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1NvUYLro0voIom6T6V6RtwqUAxFkRUUpwj4FzndtnUg=; b=va3ZaNNknzz5zu6aKT4mhRVcGl yszsoVdb7mVVlfoc8Mc32JBaPhMRapFLNu8JLgElcoRcyW+RG2Lbu9+RDEM1AK7lHlH8kxJqC+y+h TwZoYe0nU5wt2R7uFGb8G4tsj3jk0qGLJ+RjV/g6IDizxU9OGWISUe2OdPflJOVde3gk=; In-Reply-To: (Stefan Monnier's message of "Mon, 06 Jan 2025 11:52:12 -0500") Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327743 Archived-At: Stefan Monnier writes: >> There is also a lack in some combinators (flip, curry, uncurry, ...) >> which are occasionally useful. Also papply and rpapply, since >> apply-partially lacks conciseness and sometimes one wants apply the >> arguments to the right. Same with cl-constantly. >> >> (papply #'f x) >> (apply-partially #'f x) >> (lambda (y) (f x y)) >> (lambda (y z) (f x y z)) >> >> (lambda (_) x) >> (constantly x) >> (lambda (_ _) x) >> (cl-constantly x) > > I think you're arguing for something like `llama`s ## or to expand #' > to allow things like: Actually I like the explicitly named combinators (constantly, identity, papply, etc). Nevertheless some Llama-style syntax would be nice to have in Elisp. It doesn't have to reuse the #' syntax. > I'm interested to add new meanings to `function` (aka #') but mostly for > things like: > > #'(setf foo) > #'(peg foo) > > to refer to the setters or the peg-matchers of a given name. It could > also be used for Good idea. Daniel