-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initial draft for args: ['foo', 'done()', 'more[]']
and `implementa…
#2
base: master
Are you sure you want to change the base?
Conversation
…tionType: 'classic'
…oks like when defined w/ `args`, and demonstrate variadic usage
…parsing compact node-machine defs
// args: [ | ||
// ['foo', 'bar', 'baz'], // << indicating order, and which inputs can be satisfied via serial usage (not all of them must be, necessarily -- imagine serial CLI arguments (`sails new foo`) vs. CLI options (`sails new foo --without='grunt'`) ) | ||
// ['foo', 'baz'], // << indicating structual optional-ness of serial args (both of these usages existing indicates that either usage is acceptable) | ||
// ['foo', 'bar', 'baz', 'blazes[]'], // << n-ary/variadic functions that support bundling of extra serial arguments as an array, then passing that array in for a particular input (but note that this is the LAST serial argument, and also that it is only acceptable if it lists at least one more argument than every other serial usage that has been declared. This is just to avoid ambiguity / unnecessary runtime performance degredation for extra data-type checking.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be changed to jive with the native spread operator now
// ['foo', 'bar', 'baz'], // << indicating order, and which inputs can be satisfied via serial usage (not all of them must be, necessarily -- imagine serial CLI arguments (`sails new foo`) vs. CLI options (`sails new foo --without='grunt'`) ) | ||
// ['foo', 'baz'], // << indicating structual optional-ness of serial args (both of these usages existing indicates that either usage is acceptable) | ||
// ['foo', 'bar', 'baz', 'blazes[]'], // << n-ary/variadic functions that support bundling of extra serial arguments as an array, then passing that array in for a particular input (but note that this is the LAST serial argument, and also that it is only acceptable if it lists at least one more argument than every other serial usage that has been declared. This is just to avoid ambiguity / unnecessary runtime performance degredation for extra data-type checking.) | ||
// ['done()'], // << this special, parentheses-trailed syntax indicates that this serial argument is actually a replacement for `exits` (note that this is not recommended with variadic usage, since the callback should always be the last argument, and variadic usage would force the callback to come first. The name before the parentheses does not actually matter.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this isn't as important anymore, now that await is widely used (and thanks to the extensive updates in parley)
…tionType: 'classic'