Yes, your patch is indicating when you should use the same identity e.g. all uses of procedures in a higher order position such as an argument or a return value. But I looked at your patch, which looks good but I saw that for operator position you decrease the count. Why? Also you are free to use one version in argument / return position and another one in operator position the only limit is to use the same identity for on operator position. Finally don't you need to count usage of returning a variable as well? On Tue, Jan 14, 2020 at 3:34 PM Andy Wingo wrote: > On Tue 14 Jan 2020 13:18, Mikael Djurfeldt writes: > > > I probably don't have a clue about what you are talking about (or at > > least hope so), but this---the "eq change"---sounds scary to me. > > > > One of the *strengths* of Scheme is that procedures are first class > > citizens. As wonderfully show-cased in e.g. SICP this can be used to > > obtain expressive and concise programs, where procedures can occur > > many times as values outside operator position. > > > > I would certainly *not* want to trade in an important optimization > > step in those cases to obtain intuitive procedure equality. The risk > > is then that you would tend to avoid passing around procedures as > > values. > > Is this true? > > (eq? '() '()) > > What about this? > > (eq? '(a) '(a)) > > And yet, are datums not first-class values? What does being first-class > have to do with it? > > Does it matter whether it's eq? or eqv? > > What about: > > (eq? (lambda () 10) (lambda () 10)) > > What's the difference? > > What's the difference in the lambda calculus between "\x.f x" and "f"? > > What if in a partial evaluator, you see a `(eq? x y)`, and you notice > that `x' is bound to a lambda expression? Can you say anything about > the value of the expression? > > Does comparing procedures for equality mean anything at all? > https://cs-syd.eu/posts/2016-01-17-function-equality-in-haskell > > Anyway :) All that is a bit of trolling on my part. What I mean to say > is that instincts are tricky when it comes to object identity, equality, > equivalence, and especially all of those combined with procedures. The > R6RS (what can be more Schemely than a Scheme standard?) makes this > clear. > > All that said, with the recent patch, I believe that Guile 3.0's > behavior preserves your intuitions. Bug reports very welcome! > > Andy > >