Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • $\begingroup$ @rcollyer is there any way to set a default value for any missing option? That would make this more elegant. Nevertheless I think this is the best way to deal with nested rules; getting a value for e.g. a -> b -> c -> d is pretty hairy otherwise. $\endgroup$ Commented Mar 17, 2012 at 13:19
  • $\begingroup$ The only way I'm a aware of is via SetOptions which isn't exactly what you want. $\endgroup$ Commented Mar 17, 2012 at 17:02
  • $\begingroup$ @rcollyer how would you do it via SetOptions? $\endgroup$ Commented Mar 17, 2012 at 17:07
  • $\begingroup$ Exactly, the problem. SetOptions requires a symbol to be associated with the options. In this case, it isn't clear what symbol you'd use. $\endgroup$ Commented Mar 17, 2012 at 18:05
  • 2
    $\begingroup$ @Mr.Wizard your solution is great but it seems to me default values work only for non-nested values. I have tested this by creating another set where "badge_counts"->"gold" value is missing and I am getting an error message Option name badge_counts ->gold not found in defaults for \ {{display_name ->Stones ,accept_rate ->80,account_id \ ->495497,badge_counts ->{bronze ->39,silver ->9}},{age \ ->Missing[],badge_counts ->{bronze ->Missing[NotAvailable ],gold \ ->Missing[NotAvailable ],silver ->Missing[NotAvailable ]}}}. >> $\endgroup$ Commented Jul 18, 2015 at 8:36