From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: GNU Guile 2.9.9 Released [beta] Date: Tue, 14 Jan 2020 22:17:25 +0100 Message-ID: <875zhdhh5m.fsf@pobox.com> References: <87zherlphs.fsf@pobox.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="36879"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Guile User , guile-devel To: Stefan Israelsson Tampe Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Jan 14 22:18:07 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1irTZf-0009Ho-0J for guile-devel@m.gmane-mx.org; Tue, 14 Jan 2020 22:18:07 +0100 Original-Received: from localhost ([::1]:46122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irTZd-0001OG-3s for guile-devel@m.gmane-mx.org; Tue, 14 Jan 2020 16:18:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43849) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irTZF-0001Jc-Sd for guile-devel@gnu.org; Tue, 14 Jan 2020 16:17:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irTZE-0007K3-Oy for guile-devel@gnu.org; Tue, 14 Jan 2020 16:17:41 -0500 Original-Received: from fanzine.igalia.com ([178.60.130.6]:34289) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irTZE-0007Em-7P; Tue, 14 Jan 2020 16:17:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=kiiLIj/v+j2RGRnrGHPsaRcX7kWNNCZQMclwjAiglLY=; b=NjQKldXVlrBMLflD70EzD3JMB7CI+BrVeG8wEryG9m8m3zkOWNerC1Kni+9k2Nz8M+4ZZr8i1NA+9xDK7zMsGer2psARi7WT/kNWoJ09FSDsO50WhzmDan/l6Th7C01/F/a5Rgf3Wd+4xlp5lHpHBUGBsxCfKW/4Ttk4CfnUwXxhegX7AROzQz1hFBtjQB2VTjAuYf/06YQ1a30JudPAmZO9GLXBFCkrQS37eUxbRKOcaAuiWsLVPBcR9QiTPlqEqA9F+cM0Y1N3vqV3kiDy+WYM2XxxeWRN/4c/Em8Hjz5+dsS0Ci8AkBRdaYz4dzOZS7vXU36vKWGi0uaenqwIsg==; Original-Received: from [88.123.12.110] (helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1irTZ9-0000dU-Sm; Tue, 14 Jan 2020 22:17:36 +0100 In-Reply-To: (Stefan Israelsson Tampe's message of "Tue, 14 Jan 2020 21:13:42 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 178.60.130.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20279 gmane.lisp.guile.user:16057 Archived-At: On Tue 14 Jan 2020 21:13, Stefan Israelsson Tampe writes: > Okey, here is another case that fails with the patch that prevents identity misses for toplevels e.g we need similar fixes for anonymous functions. > > (define-module (b) > #:export (q)) > > (define h (make-hash-table)) > (define (method f) > (hash-set! h f 1) > f) > (define q (method (lambda x x))) > > (pk (hash-ref h q)) > > This fails with (#f) > > I solved this in my code by placing the method function in another module. Interestingly, this case is not really related to the declarative bindings optimization, letrectification, or other things. It's the same as: (let ((h (make-hash-table))) (define (method f) (hash-set! h f 1) f) (let* ((q (let ((f (lambda x x))) (method f)))) (pk (hash-ref h q)))) I.e. no top-level bindings are needed. This prints #f in releases as old as 2.0.14 and probably older :) It optimizes as: (let* ((h (make-hash-table)) (q (begin (hash-set! h (lambda x x) 1) (lambda x x)))) (pk (hash-ref h q))) So, not a recent change. Of course we can discuss whether it's the right thing or not! Andy