Group Abstract Group Abstract

Message Boards Message Boards

1
|
5.4K Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Passing options to function as a list rather than individual arguments?

Anonymous User
Anonymous User
Posted 8 years ago
POSTED BY: Anonymous User
3 Replies

You're welcome.

Anonymous User
Anonymous User
Posted 8 years ago

Thank you.

POSTED BY: Anonymous User

That depends a bit on the implementation of these functions. If the option passing is implemented with OptionsPattern[] then providing lists of options should work fine. I think, before OptionsPattern[] was introduced (version 6.0), the usual way was to implement functions with optional arguments by using BlankNullSequence like f[arg1_,opt____]:=.... (Actually I don't know if this has ever been the "official" way of doing that but I have seen something like that in undocumented functions several times when I was spelunking.) So it depended a bit on the developers wether they processed the options with Flatten[List[opt]] or not. So, rather old functions that were coded before OptionsPattern[] was introduced and haven't been touched since then might get problems...

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard