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:
- to be able to assign a name to a listed argument, and
- 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:
- Created 10 years ago
- Comments:36 (33 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
vsactual
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.sorry for accidentally closing this issue … reopened it again…