*shrugs shoulders* I pretty much am horrible at API design. For a non-performance-critical API, keyword arguments would be the recommended approach. The old-school Julia pre-kwarg dispatch pyramid (with n-argument forms dispatching to the n+1 argument form with a default n+1th argument) will perform better but is often pretty hard to use and a pain in the butt to write. An option type with kwarg constructor might be the best compromise (since you only pay the kwarg penalty once to construct the option structure) but I have no idea whether that's been done and/or has caught on.
On Saturday, June 6, 2015 at 12:02:36 AM UTC-5, Scott Jones wrote: > > Well, not sure if it is a bug, just a difference in Markdown variants > (that’s the big problem with Markdown, IMO, there are a number of slightly > different > versions), or something that just wasn’t implemented yet. > > Although, your comment, made clear something to me… although originally > the check_string function was a wrapper around C code, and so had a > very C-style interface, I was pushed by the Julian community to do a pure > Julia implementation, so there’s no reason to be bound by C API. > > What would you recommend, as a more Julia interface, where you have a set > of options (in this case, all boolean flags)? > (I wonder if one of the more Julian ways might even be more efficient, if > it allowed the compiler to generate a more specific version of the function) > > Thanks, > Scott > > > Ah, that wasn't clear. Might just be another enhancement request for the > Markdown parser, then? > > On Friday, June 5, 2015 at 12:28:53 PM UTC-5, Scott Jones wrote: >> >> I was not asking about that, but rather that Julia's Markdown handling >> doesn't seem to be handling sublists as the Markdown examples I've seen... >> which I showed in the doc string... >> >> Sent from my iPhone >> >> On Jun 5, 2015, at 5:02 PM, Patrick O'Leary <[email protected]> >> wrote: >> >> Since this is a very C-style interface, perhaps `man 2 open` which uses >> that style of option flag will get you somewhere? >> >> On Friday, June 5, 2015 at 7:47:49 AM UTC-5, Scott Jones wrote: >>> >>> I've been trying to write documentation for my Julia functions in a way >>> that others will find acceptable, >>> but will still be useful to me. >>> I have a keyword argument, options, that has several different possible >>> values or'ed in. >>> I would like to describe that, but it doesn't come out nicely: >>> >>> @doc doc"""Silly function >>> >>> long description >>> ### Input Arguments: >>> 1. abc Description of argument >>> 2. def Description of argument >>> >>> ### Keyword Argument: >>> * options >>> >>> **option1 Description of option 1 >>> **option2 Description of option 2 >>> >>> ### Returns: >>> * A UTF32String >>> >>> ### Throws: >>> * ArgumentError >>> """ -> foo >>> >>> >>> >
