question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cross-references within named argument lists

See original GitHub issue

[@gavinking] A feature I have always planned on, that we’ve recently begin to discuss, including in #3850, 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:

  • to be able to assign a local name to an “anonymous” argument,
  • to be able to freely declare something in the body of a named argument list that is not an argument (depends on #3604), and/or
  • to be able to refer to later arguments by name.

[Migrated from ceylon/ceylon-spec#749]

Issue Analytics

  • State:open
  • Created 10 years ago
  • Comments:36 (33 by maintainers)

github_iconTop GitHub Comments

2reactions
quintessecommented, Jun 29, 2016

Personally I like proposal 2 better. Even though proposal 1 is perhaps more “expressive” or “powerful” I think it will make it easier to write complex code that’s hard to understand. With proposal 1 you’d have to understand more about the intricacies of value vs actual vs the already somewhat complex-ish rules of named arguments (using ; as a separator instead of , except for any iterable arguments at the end, etc). I think proposal 2 needs less “special knowledge” making things easier to read in general.

0reactions
luolongcommented, Jul 1, 2016

sorry for accidentally closing this issue … reopened it again…

Read more comments on GitHub >

github_iconTop Results From Across the Web

c++ - Cross references when using template parameters
I have functions in Array returning a Value object, not a reference or a pointer, so i don't have the choice. – Virus721....
Read more >
4.7 Cross-referencing within documents | R Markdown ...
Cross -referencing is a useful way of directing your readers through your document, and can be automatically done within R Markdown.
Read more >
Reference \ref[...]{...} with an argument does not work with ...
Using enumitem 's label and ref options. label specifies how things will print in the list, while ref denotes the referencing style.
Read more >
Cross-reference of parameters - BMC Documentation
Parameter list members. These are UBBPARM members with a naming convention of PRDxASnn. · Started task EXEC or PROC statements · START command....
Read more >
5.5 Cross-Referencing - Dickimaw Books
The argument <string> should be a unique textual label. ... [Referring to things by their name]It's not just chapters and sections that you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found