Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross-references within named argument lists #749

Open
gavinking opened this issue Aug 14, 2013 · 2 comments
Open

cross-references within named argument lists #749

gavinking opened this issue Aug 14, 2013 · 2 comments

Comments

@gavinking
Copy link
Member

A feature I have always planned on, that we've recently begin to discuss, including in #744, is the ability to cross reference arguments within a named argument list, for example:

Panel {
    value label = Label { size = Size(50,10); },
    value button = Button {
        label = "Click me";
        size = Size(50,10); 
        onClick() => label.text="Hello!"; 
    };
}

We need at least two things:

  1. to be able to assign a name to a listed argument, and
  2. to be able to refer to previous arguments by the parameter name or assigned name within the body of subsequent arguments.

We may or may not need the following:

@gavinking
Copy link
Member Author

  • to be able to refer to later arguments by name.

This is by far the most interesting problem here. It raises ordering problems, which we would need to resolve using either:

  • the approach we use for toplevels (lazy evaluation), or
  • the approach we use for class declaration sections (essentially, restricting them to nested declarations within the argument body).

@oehme
Copy link

oehme commented Oct 21, 2013

Referencing later arguments is the most interesting, too. It's hugely common in GUI frameworks where you want to create elements in their visual order, but wire up their listeners at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants