From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: GNU Guile 2.9.9 Released [beta] Date: Tue, 14 Jan 2020 22:48:58 +0100 Message-ID: References: <87zherlphs.fsf@pobox.com> <875zhdhh5m.fsf@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="176811"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Guile User , guile-devel To: Andy Wingo Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Jan 14 22:49:29 2020 Return-path: Envelope-to: guile-user@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 1irU41-000jT9-CC for guile-user@m.gmane-mx.org; Tue, 14 Jan 2020 22:49:29 +0100 Original-Received: from localhost ([::1]:46404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irU40-0007i5-48 for guile-user@m.gmane-mx.org; Tue, 14 Jan 2020 16:49:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56693) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irU3k-0007gk-Sd for guile-user@gnu.org; Tue, 14 Jan 2020 16:49:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irU3j-0005qF-C7 for guile-user@gnu.org; Tue, 14 Jan 2020 16:49:12 -0500 Original-Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:36955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irU3j-0005pC-3X; Tue, 14 Jan 2020 16:49:11 -0500 Original-Received: by mail-wm1-x342.google.com with SMTP id f129so15515031wmf.2; Tue, 14 Jan 2020 13:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ab2cDbHvRYBimMHTrMISTM/C+OG4OkhC2RWYJ+M/2UM=; b=qZjrfgN86/A7jof7i+ThZ4o2XAPKdEVnBIs7OmGBgsOq14S9JuKwH8M5hir7j6jLIH YX7pJJOtq1wQTl5Lsklktee9YYxcw9rlO7qqFlsyxsZOmHH2m//FDbCnQIrttripwTa6 EiN+tpo1d9lLItNtQtQNq3gSnv8m4gMPnOPC3Ss4+BDbTGKY5CdDpMepuyr/Lq9ZvLUe 5G+vY9bmZivCyjPAEkA9F2YumpqMSflHRcY7NIwB99YP5P6Jy5xuB2XV2SYI2xUD+1gx EBEIycmenycxI+/+YCwSWRzz7fPKJPlOlFzoJZg0/0i8E6JQonFKaTCF9my+WJpcYdyn eKoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ab2cDbHvRYBimMHTrMISTM/C+OG4OkhC2RWYJ+M/2UM=; b=U6xVyOZtmGVgg7TUPgaRE0v5mLkUVgbtZRqpYw3LhUoUpgS8cvXyuNE5dh8O0oiAz+ 7siGR5XSwEbByRFmfjIV8cUnTxvwjpxAjeRgszTN2CPtsaQUY0fv29uYTThp6cs2NPhQ ZXqePKYN9yuZGaJJsq7IqVWCXrKBls4/f0bnVNQZdQKtZZ1xISL6qWGcf0vUcB7rQdcO BB4rryKWLwRqkoQWtaClWDMlpjjEIQqwYfIbHoHiGyflS2cipLZi9wD3uiKqnj9jmxLv v/8YL7B9D9OjPvucftO9PofdYSvTu33nxn5SPBO/3SqAH7SkmnlZfgYUseSxNxYtTDnx +ovg== X-Gm-Message-State: APjAAAU+8Nq4+6OY56GSsDAWh4ItZrrh5BMa6VR3BYRArqQs/lTUgbep VdVbChHnR3QAXMV2IUoNxVwTJ6VIuZ24//6Q8S0= X-Google-Smtp-Source: APXvYqxF2iLha6IAdVHbbfkz/2/6wEam/9KlUCkBgSFU4UjYcpfh1v5D/aoG5mZ1GMWn/gkaa/2jBHQVU76h2ItFVfc= X-Received: by 2002:a1c:7d93:: with SMTP id y141mr30521194wmc.111.1579038549922; Tue, 14 Jan 2020 13:49:09 -0800 (PST) In-Reply-To: <875zhdhh5m.fsf@pobox.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:16058 gmane.lisp.guile.devel:20280 Archived-At: I have a fix for this by pushing the method idiom to another module. So it is not a burning issue. Strange that I did not dee this error before in the 2.x series ever. Isn't it so that for procedures define in a (let () ...) the case you are mentioning happened before but I was on the impression that no inlining was done for defines on different places in the module before I also have a request to be able to silence warning of unbound variables that is not so for e.g. a python implementation. Previously I modded message.scm and compile.scm so that I can add symbols that will not issue a warning when compiling. It consists of (define %dont-warn-list (make-fluid '())) ;; Exported (define %add-to-warn-list (lambda (sym) (fluid-set! (M %dont-warn-list) (cons sym (fluid-ref (M %dont-warn-list)))))) And inside the warning emitter one checks for matches in the don't warn list and mute if it matches. For this to work we need also change the compiler as in compile.scm (see the %dont-warn-list line ... (define-set-C compile-file (lambda* (file #:key (output-file #f) (from ((C default-language) file)) (to 'bytecode) (env ((C default-environment) from)) (opts '()) (canonicalization 'relative)) (with-fluids (((C %in-compile ) #t ) ((C %in-file ) file ) ((@@ (system base message) %dont-warn-list) '() ) ((C %file-port-name-canonicalization) canonicalization ) ((C %current-file% ) file)) It would also be fabulous to direct the compiler depeneding on extensions of the file which is also something I have to make the python environment nicer. On Tue, Jan 14, 2020 at 10:17 PM Andy Wingo wrote: > 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 >