unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* build-lexical-var vs. -Wunused-variable
@ 2012-02-17 11:00 Ludovic Courtès
  2012-02-19 21:08 ` Andy Wingo
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2012-02-17 11:00 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 100 bytes --]

Hello,

Commit f9685f437312ea790981373ddc375b2a26ba9c4f changes
‘build-lexical-var’ like this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 166 bytes --]

     (define-syntax-rule (build-lexical-var src id)
-      (gensym (string-append (symbol->string id) " ")))
+      (gensym (string-append (symbol->string id) "-")))

[-- Attachment #3: Type: text/plain, Size: 284 bytes --]


This breaks a heuristic used in the ‘unused-variable’ pass, which is
that identifiers containing white space are likely introduced by a macro
and can be ignored in unused-variable reports (see ‘gensym?’ in
‘tree-il/analyze.scm’).

OK to change it back?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: build-lexical-var vs. -Wunused-variable
  2012-02-17 11:00 build-lexical-var vs. -Wunused-variable Ludovic Courtès
@ 2012-02-19 21:08 ` Andy Wingo
  2012-02-23  3:36   ` Mark H Weaver
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2012-02-19 21:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-devel

On Fri 17 Feb 2012 12:00, ludo@gnu.org (Ludovic Courtès) writes:

> Commit f9685f437312ea790981373ddc375b2a26ba9c4f changes
> ‘build-lexical-var’ like this:
>
>      (define-syntax-rule (build-lexical-var src id)
> -      (gensym (string-append (symbol->string id) " ")))
> +      (gensym (string-append (symbol->string id) "-")))
>
> This breaks a heuristic used in the ‘unused-variable’ pass, which is
> that identifiers containing white space are likely introduced by a macro
> and can be ignored in unused-variable reports (see ‘gensym?’ in
> ‘tree-il/analyze.scm’).
>
> OK to change it back?

How about we use `$' instead?  I understand that's how Chez does it.
I'd really rather something that is printable without the #{#} syntax.

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: build-lexical-var vs. -Wunused-variable
  2012-02-19 21:08 ` Andy Wingo
@ 2012-02-23  3:36   ` Mark H Weaver
  2012-03-01 18:26     ` Ludovic Courtès
  2013-01-16 10:40     ` Andy Wingo
  0 siblings, 2 replies; 8+ messages in thread
From: Mark H Weaver @ 2012-02-23  3:36 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Ludovic Courtès, guile-devel

Andy Wingo <wingo@pobox.com> writes:
> On Fri 17 Feb 2012 12:00, ludo@gnu.org (Ludovic Courtès) writes:
>
>> Commit f9685f437312ea790981373ddc375b2a26ba9c4f changes
>> ‘build-lexical-var’ like this:
>>
>>      (define-syntax-rule (build-lexical-var src id)
>> -      (gensym (string-append (symbol->string id) " ")))
>> +      (gensym (string-append (symbol->string id) "-")))
>>
>> This breaks a heuristic used in the ‘unused-variable’ pass, which is
>> that identifiers containing white space are likely introduced by a macro
>> and can be ignored in unused-variable reports (see ‘gensym?’ in
>> ‘tree-il/analyze.scm’).
>>
>> OK to change it back?
>
> How about we use `$' instead?  I understand that's how Chez does it.
> I'd really rather something that is printable without the #{#} syntax.

Now that we have a (pending) patch to avoid printing gensyms to
psyntax-pp.scm, does that change your opinion on this?  I tend to agree
with Ludovic here.  In general, any character that doesn't require the
#{}# syntax is likely to be used by some programs in their identifier
names.  It would be a shame if we disabled unused-variable warnings for
variables whose name contains a '$', or any other standard identifier
character for that matter.

     Thanks,
       Mark



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: build-lexical-var vs. -Wunused-variable
  2012-02-23  3:36   ` Mark H Weaver
@ 2012-03-01 18:26     ` Ludovic Courtès
  2013-01-16 10:40     ` Andy Wingo
  1 sibling, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2012-03-01 18:26 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Andy Wingo, guile-devel

Hello!

Mark H Weaver <mhw@netris.org> skribis:

> Andy Wingo <wingo@pobox.com> writes:
>> On Fri 17 Feb 2012 12:00, ludo@gnu.org (Ludovic Courtès) writes:
>>
>>> Commit f9685f437312ea790981373ddc375b2a26ba9c4f changes
>>> ‘build-lexical-var’ like this:
>>>
>>>      (define-syntax-rule (build-lexical-var src id)
>>> -      (gensym (string-append (symbol->string id) " ")))
>>> +      (gensym (string-append (symbol->string id) "-")))
>>>
>>> This breaks a heuristic used in the ‘unused-variable’ pass, which is
>>> that identifiers containing white space are likely introduced by a macro
>>> and can be ignored in unused-variable reports (see ‘gensym?’ in
>>> ‘tree-il/analyze.scm’).
>>>
>>> OK to change it back?
>>
>> How about we use `$' instead?  I understand that's how Chez does it.
>> I'd really rather something that is printable without the #{#} syntax.
>
> Now that we have a (pending) patch to avoid printing gensyms to
> psyntax-pp.scm, does that change your opinion on this?  I tend to agree
> with Ludovic here.  In general, any character that doesn't require the
> #{}# syntax is likely to be used by some programs in their identifier
> names.  It would be a shame if we disabled unused-variable warnings for
> variables whose name contains a '$', or any other standard identifier
> character for that matter.

Any news on this?  I’d agree with Mark, but no strong opinion here.

Thanks,
Ludo’.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: build-lexical-var vs. -Wunused-variable
  2012-02-23  3:36   ` Mark H Weaver
  2012-03-01 18:26     ` Ludovic Courtès
@ 2013-01-16 10:40     ` Andy Wingo
  2013-01-16 12:17       ` Ludovic Courtès
  1 sibling, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2013-01-16 10:40 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Ludovic Courtès, guile-devel

Hi,

On Thu 23 Feb 2012 04:36, Mark H Weaver <mhw@netris.org> writes:

> Andy Wingo <wingo@pobox.com> writes:
>> On Fri 17 Feb 2012 12:00, ludo@gnu.org (Ludovic Courtès) writes:
>>
>>> Commit f9685f437312ea790981373ddc375b2a26ba9c4f changes
>>> ‘build-lexical-var’ like this:
>>>
>>>      (define-syntax-rule (build-lexical-var src id)
>>> -      (gensym (string-append (symbol->string id) " ")))
>>> +      (gensym (string-append (symbol->string id) "-")))
>>>
>>> This breaks a heuristic used in the ‘unused-variable’ pass, which is
>>> that identifiers containing white space are likely introduced by a macro
>>> and can be ignored in unused-variable reports (see ‘gensym?’ in
>>> ‘tree-il/analyze.scm’).
>>>
>>> OK to change it back?
>>
>> How about we use `$' instead?  I understand that's how Chez does it.
>> I'd really rather something that is printable without the #{#} syntax.
>
> Now that we have a (pending) patch to avoid printing gensyms to
> psyntax-pp.scm, does that change your opinion on this?  I tend to agree
> with Ludovic here.  In general, any character that doesn't require the
> #{}# syntax is likely to be used by some programs in their identifier
> names.  It would be a shame if we disabled unused-variable warnings for
> variables whose name contains a '$', or any other standard identifier
> character for that matter.

Is this still a change we should make?

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: build-lexical-var vs. -Wunused-variable
  2013-01-16 10:40     ` Andy Wingo
@ 2013-01-16 12:17       ` Ludovic Courtès
  2013-01-16 12:27         ` Andy Wingo
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2013-01-16 12:17 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Mark H Weaver, guile-devel

Hi,

Andy Wingo <wingo@pobox.com> skribis:

> On Thu 23 Feb 2012 04:36, Mark H Weaver <mhw@netris.org> writes:
>
>> Andy Wingo <wingo@pobox.com> writes:
>>> On Fri 17 Feb 2012 12:00, ludo@gnu.org (Ludovic Courtès) writes:
>>>
>>>> Commit f9685f437312ea790981373ddc375b2a26ba9c4f changes
>>>> ‘build-lexical-var’ like this:
>>>>
>>>>      (define-syntax-rule (build-lexical-var src id)
>>>> -      (gensym (string-append (symbol->string id) " ")))
>>>> +      (gensym (string-append (symbol->string id) "-")))
>>>>
>>>> This breaks a heuristic used in the ‘unused-variable’ pass, which is
>>>> that identifiers containing white space are likely introduced by a macro
>>>> and can be ignored in unused-variable reports (see ‘gensym?’ in
>>>> ‘tree-il/analyze.scm’).
>>>>
>>>> OK to change it back?
>>>
>>> How about we use `$' instead?  I understand that's how Chez does it.
>>> I'd really rather something that is printable without the #{#} syntax.
>>
>> Now that we have a (pending) patch to avoid printing gensyms to
>> psyntax-pp.scm, does that change your opinion on this?  I tend to agree
>> with Ludovic here.  In general, any character that doesn't require the
>> #{}# syntax is likely to be used by some programs in their identifier
>> names.  It would be a shame if we disabled unused-variable warnings for
>> variables whose name contains a '$', or any other standard identifier
>> character for that matter.
>
> Is this still a change we should make?

After re-reading the above, I think I’d prefer reintroducing white space
rather than using ‘$’.

What did you have in mind?

Thanks for reminding us of all these issues.  :-)

Ludo’.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: build-lexical-var vs. -Wunused-variable
  2013-01-16 12:17       ` Ludovic Courtès
@ 2013-01-16 12:27         ` Andy Wingo
  2013-01-16 14:25           ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2013-01-16 12:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Mark H Weaver, guile-devel

On Wed 16 Jan 2013 13:17, ludo@gnu.org (Ludovic Courtès) writes:

> After re-reading the above, I think I’d prefer reintroducing white space
> rather than using ‘$’.

Fine with me, it doesn't matter to me very much :)  I just wondered if
you were still using the unused-lexical analysis, given that this worked
against it.  Or perhaps it doesn't matter so much given that the
analysis runs before optimization, and psyntax-pp.scm isn't pevaled any
more?  Anyway, just picking up loose ends.  It will be less painful
when/if we switch to ||-style printing.

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: build-lexical-var vs. -Wunused-variable
  2013-01-16 12:27         ` Andy Wingo
@ 2013-01-16 14:25           ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2013-01-16 14:25 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Mark H Weaver, guile-devel

Andy Wingo <wingo@pobox.com> skribis:

> On Wed 16 Jan 2013 13:17, ludo@gnu.org (Ludovic Courtès) writes:
>
>> After re-reading the above, I think I’d prefer reintroducing white space
>> rather than using ‘$’.
>
> Fine with me, it doesn't matter to me very much :)  I just wondered if
> you were still using the unused-lexical analysis, given that this worked
> against it.

I use it in some places, yes.  That said, it’s meant to be generally
useful, otherwise it’d be called ludo-analysis or something.  ;-)

> Or perhaps it doesn't matter so much given that the analysis runs
> before optimization, and psyntax-pp.scm isn't pevaled any more?

Oh, it’s not pevaled?  I think I forgot about that.

Thanks,
Ludo’.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-16 14:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17 11:00 build-lexical-var vs. -Wunused-variable Ludovic Courtès
2012-02-19 21:08 ` Andy Wingo
2012-02-23  3:36   ` Mark H Weaver
2012-03-01 18:26     ` Ludovic Courtès
2013-01-16 10:40     ` Andy Wingo
2013-01-16 12:17       ` Ludovic Courtès
2013-01-16 12:27         ` Andy Wingo
2013-01-16 14:25           ` Ludovic Courtès

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).