From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Fri, 17 Nov 2023 15:45:06 +0100 Message-ID: References: <320999cc-6c83-2315-0044-cc0403400af3@gutov.dev> <9ab5d2bd-a648-cae0-a4a7-ae86be10af0f@gutov.dev> <87r0kuqxbf.fsf@gmail.com> <54e115a2-fc36-3056-a030-0dbf32416ddb@gutov.dev> <43f290b0-4119-597b-c89a-0fb4c7db1665@gutov.dev> <1e7fe1ef-af7d-3222-7b9e-b569b3c97ccf@gutov.dev> <22e4cb4d-a8f3-1530-881d-b8c59c5d969b@gutov.dev> <339b58d6-5a44-8393-c2cd-4c935147dde3@gutov.dev> <877cmhrcsf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19749"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Dmitry Gutov , Eli Zaretskii , michael_heerdegen@web.de, emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 17 15:46:11 2023 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 1r406k-00050z-PM for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Nov 2023 15:46:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r405x-0002Qo-3I; Fri, 17 Nov 2023 09:45:21 -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 1r405u-0002QQ-12 for emacs-devel@gnu.org; Fri, 17 Nov 2023 09:45:18 -0500 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r405m-00068J-F0; Fri, 17 Nov 2023 09:45:17 -0500 Original-Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-408382da7f0so17080025e9.0; Fri, 17 Nov 2023 06:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700232308; x=1700837108; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WhA1JoTHcoalNFq3//O6uuemOrGt1IzDHhKAJIRmqzA=; b=iJdd/1TLNwXY7dfB+aDqD0FnU3KSXWiUeTNJek/6EwlBt5X1Tdy3+GVZSzmgJVvnQo 8prMfhrZ3Er8dgNUps7iO7JQTPjMV24l+gDMnfFx/TKPrgG5lMcLcFFSbBL3+6Gq+U3e V2NV5ZIB5Z9mDUdUs/w7XK8lwWGluvmC/JEWWxKZS+hjBHe8o1+lmXMiIRuIsltGw5gk cOCp2qNXP0jQbrTKtrE0makfGp+YDta9XRLXhQB5skhRAFda1NAEPGHA5NpFuXGZD4Hs tWDjf+MUmr4kF14TEZWprOhBc3UIHiQd7ZMCPKMGqvzL9fespuVwfONx4qUIHlIXNKyF hh+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700232308; x=1700837108; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WhA1JoTHcoalNFq3//O6uuemOrGt1IzDHhKAJIRmqzA=; b=VYxTH5M5QrB33euzvLzlXLrfexZk7jHRlXPh683csm+eithqPAzGQuKIwpbHb2fZPZ Pa6XtAL3f0peq2y6z/us81be4xf2a0hRLSPD9wwU0VHADnEYee3cvcOidu381IFH31Iw Q9Z7f6dcwLBMA2SBcJhIRZBjuMhgvQICaQ7uJv9CwnzENNh7rHeg9hcT5PEiTsTlhap1 e5g4r5XTfr0m/BH12X9AOLp+pw3ad2jBcurGIz9llPaS5hEmN1+cMC2IqjoYX3pAhW24 9oGnlt1khGYP7Iiy+2FMaWjIQi+sFvMDSqWDugFVVdUrsypG6R8IKTr3L9MkovAm0BHO RwlA== X-Gm-Message-State: AOJu0YyvWUEVII01NytGSMRwgGEGFds4xkkJ7ciJbYGUUftO5SfYc95M J/gSRdreu0NbGjGPAzQIrIA5g5Yjh38= X-Google-Smtp-Source: AGHT+IG0WkDRidDsM1fjosrHcwHsFbgPe0ow3cMap/zsFhcG5Xsti8lwhKkCROK8GWCK0XVw3MF3rg== X-Received: by 2002:a05:600c:2904:b0:409:5a92:4711 with SMTP id i4-20020a05600c290400b004095a924711mr4762844wmd.34.1700232307652; Fri, 17 Nov 2023 06:45:07 -0800 (PST) Original-Received: from Pro.fritz.box (p4fe3a2be.dip0.t-ipconnect.de. [79.227.162.190]) by smtp.gmail.com with ESMTPSA id k21-20020a05600c1c9500b0040a487758dcsm3004350wms.6.2023.11.17.06.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 06:45:07 -0800 (PST) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llmann?= =?utf-8?Q?=22's?= message of "Thu, 16 Nov 2023 21:09:50 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x32c.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, T_SCC_BODY_TEXT_LINE=-0.01 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:312870 Archived-At: Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > > A bit strange is that cl--generic-next-function seems to be called > recursively in the process, which I think could create another such > hash-table. Or I'm reading that simply wrong, as I mentioned I just > wanted to see if cl-generic is so different, so I didn't spend much time > on this. Perhaps someone could verify if I'm reading this wrong? Start in cl--generic-get-dispatcher again: (funcall cl--generic-compiler `(lambda (generic dispatches-left methods) (let ((method-cache (make-hash-table :test #'eql))) (lambda (,@fixedargs &rest args) (let ,bindings (apply (with-memoization (gethash ,tag-exp method-cache) (cl--generic-cache-miss generic ',dispatch-arg dispatches-left methods ,(if (cdr typescodes) `(append ,@typescodes) (car typescodes)))) ,@fixedargs args))))))))) The hash table is the cache, and so on, as before. We have a cache miss, so -> cl--generic-cache-miss -> cl--generic-make-next-function -> cl--generic-get-dispatcher, and we procuce a function like the above, with a a method-cache of its own? I suspect that I'm taking a wrong turn here, somewhere.