Re: [cc65] bug or feature: unnamed labels across scopes

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2012-07-30 12:04:49
Hi!

On Sun, Jul 29, 2012 at 05:15:09PM +0200, Andre Fachat wrote:
> while investigating unnamed labels, I found that they are not bound by scope blocks.

Yes, that is correct.

> Is this intentional, or a bug?

It is intentional. Scopes organizes symbols, but unnamed labels are by
definition not symbols. And, unnamed labels are a mess when used with larger
pieces of code, but scopes are used mostly with larger sections of code. And
last, unnamed labels don't play very well with scopes. You can say foo::bar to
access a symbol bar in the scope foo, but how would you do that with scopes?

If you can come up with a good reason, why unnamed labels should adhere
scoping rules, then I will think about changing the semantics. I for my part
cannot think of any such reason.

However, it might be a good idea to mention it in the docs, just for
completeness sake.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Jul 30 12:05:03 2012

This archive was generated by hypermail 2.1.8 : 2012-07-30 12:05:08 CEST