Menu

#24 "def bind object..." causes inappropriate mangle

closed-duplicate
3
2007-01-29
2005-05-29
No

The forward declaration expression "def name" expands to

(def [name, name__Resolver] := PromiseMaker()
name__Resolver)

The pattern "bind name" currently expands to

temp ? (name__Resolver resolve(temp); true)

This is fine except when used to define an object name:

? def foo
# value: <Open Resolver>

? def bind foo() {}
# value: <foo_1>

Why does the foo function print as "<foo_1>" rather
than "<foo>"? The expansion of the object expression
picks up the behavior name of the object (to be used to
form a fully qualified name, which will be used to
support upgrade) from the name of the variable being
defined. In this case, the variable is the temporary
variable resulting from the expansion of bind.

To fix this cleanly, we need separate rules in the
parser for an occurrence of a bind pattern as an object
definition name, so that the object definition
expansion can keep the source name, while still
expanding the bind pattern as above.

Discussion

  • Mark Samuel Miller

    • assigned_to: nobody --> caplet
     
  • Mark Samuel Miller

    • status: open --> closed-duplicate
     

Log in to post a comment.