Andrey Tatarinov wrote:
afair you told yourself that

var = <statement> where:
    <suite>

translates to:

def unique_name():
    <suite>
    return <statement>
var = unique_name()

in this case class gets unique_name() function? is it that bad?

No, I wasn't thinking clearly and saw problems that weren't there.

However, you're right that the semantic definition should include unbinding the unique name after the statement finishes. E.g. for assignments:

  def unique_name():
      <suite>
      return <expr>
  <target> = unique_name()
  del unique_name

anyway I'd prefer to change semantics deeper. adding new statement-only scope and adding our suite-definitions there.

A new scope essentially *is* a nested function :)

My main purpose with the nested function equivalent is just to make the intended semantics clear - whether an implementation actually _does_ things that way is immaterial.

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to