unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: Guile User <guile-user@gnu.org>, guile-devel <guile-devel@gnu.org>
Subject: Re: GNU Guile 2.9.9 Released [beta]
Date: Tue, 14 Jan 2020 22:48:58 +0100	[thread overview]
Message-ID: <CAGua6m29Xij9v64LOV1rZ=m4H-EYZ+Q7ERvArFL+5tqb5wvhug@mail.gmail.com> (raw)
In-Reply-To: <875zhdhh5m.fsf@pobox.com>

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 <wingo@pobox.com> wrote:

> On Tue 14 Jan 2020 21:13, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> 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
>


  reply	other threads:[~2020-01-14 21:48 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  8:39 GNU Guile 2.9.9 Released [beta] Andy Wingo
2020-01-13  8:44 ` Andy Wingo
2020-01-13 17:26 ` John Cowan
2020-01-13 23:09   ` bug#39118: " John Cowan
2020-01-20 16:35   ` bug#39118: Segfault while building on 64-bit Cygwin Ludovic Courtès
2020-01-20 16:38     ` John Cowan
2020-01-20 17:22       ` bug#39118: " Mike Gran via Bug reports for GUILE, GNU's Ubiquitous Extension Language
2020-02-06 10:53         ` Andy Wingo
2020-02-07  4:56           ` Charles Stanhope
2020-02-14 17:46             ` Charles Stanhope
2020-02-15 17:58               ` Marco Atzeri
2020-02-16 23:23               ` Mike Gran
2020-02-16 23:24                 ` John Cowan
2020-02-17  1:08                 ` Charles Stanhope
2020-02-17 19:27                   ` Charles Stanhope
2020-02-17 21:05                     ` Andy Wingo
2020-01-21  9:01       ` Ludovic Courtès
2020-01-21 18:40         ` bug#39118: " szgyg
2020-01-21 21:53           ` John Cowan
2020-01-21 21:37         ` John Cowan
2020-01-23 20:35           ` Ludovic Courtès
2020-01-24 14:36             ` John Cowan
2020-01-25 13:51               ` Ludovic Courtès
2020-01-25 15:54                 ` John Cowan
2020-01-31 14:23                   ` bug#39118: " John Cowan
2020-02-03 22:11                     ` szgyg
2020-02-05 21:11                       ` John Cowan
2020-02-05 22:42                         ` szgyg
2020-01-13 21:32 ` GNU Guile 2.9.9 Released [beta] Stefan Israelsson Tampe
2020-01-13 21:33   ` Stefan Israelsson Tampe
2020-01-14  9:57   ` Stefan Israelsson Tampe
2020-01-14 11:16   ` Andy Wingo
     [not found]     ` <CAGua6m3+mL-1mq0iot1+xvkgkC-_jnhX03uGpOxQkwk0iv12Vw@mail.gmail.com>
2020-01-14 11:43       ` Fwd: " Stefan Israelsson Tampe
2020-01-14 12:18     ` Mikael Djurfeldt
2020-01-14 13:25       ` Stefan Israelsson Tampe
2020-01-14 14:32       ` Andy Wingo
2020-01-14 14:47         ` Stefan Israelsson Tampe
2020-01-14 16:15           ` Andy Wingo
2020-01-14 16:36             ` Stefan Israelsson Tampe
2020-01-14 17:56               ` Stefan Israelsson Tampe
2020-01-14 16:03         ` Mikael Djurfeldt
     [not found]           ` <CAGua6m2cm2iFTf6EB4MuDR4qNDJ1kt1EjwRCBgLKS+qxncxp+w@mail.gmail.com>
2020-01-14 16:36             ` Fwd: " Stefan Israelsson Tampe
2020-01-14 16:47               ` Mikael Djurfeldt
2020-01-14 17:21                 ` Taylan Kammer
2020-01-14 17:27                 ` Stefan Israelsson Tampe
2020-01-14 20:54           ` Andy Wingo
2020-01-14 20:13 ` Stefan Israelsson Tampe
2020-01-14 21:17   ` Andy Wingo
2020-01-14 21:48     ` Stefan Israelsson Tampe [this message]
2020-01-15 19:58       ` Andy Wingo
  -- strict thread matches above, loose matches on Subject: below --
2020-01-14 14:39 dsmich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGua6m29Xij9v64LOV1rZ=m4H-EYZ+Q7ERvArFL+5tqb5wvhug@mail.gmail.com' \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).