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

Simpler usage of named arguments #37

Closed
tpluscode opened this issue Feb 5, 2024 · 0 comments · Fixed by #40
Closed

Simpler usage of named arguments #37

tpluscode opened this issue Feb 5, 2024 · 0 comments · Fixed by #40

Comments

@tpluscode
Copy link
Contributor

I'd like to add a simpler way of defining named arguments. Currently, each named argument requires a blank node with name/value pairs

[
  code:arguments [
    code:name "foo" ; code:value "foo" ;
  ] , [
    code:name "bar" ; code:value "bar" ;
  ] , [
    code:name "baz" ; code:value "baz" ;
  ] ;
] .

This is verbose and makes complex scenarios harder. I propose to flatten to a single blank node which represents an object and have properties mapped to code

[
  code:arguments [
    arg:foo "foo" ;
    arg:bar "bar" ;
    arg:baz "baz" ;
  ] ;
] .

To be decided what arg prefix means. Could be a shorthand for https://code.described.at/argument/, where we extract the last segment and use is as code arg name.

This should allow deep object structures and mixing positional and named arguments

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

Successfully merging a pull request may close this issue.

1 participant