Optional function arguments / cell annotations

Hi Kelley!

Cool, so:

  • Optional function arguments: yep! We originally included them in our function formatting, because we were essentially stringifying functions and being very liberal about what we showed, but the current formatting is much more conservative - it parses argument names and bails out if we see a =. The rationale there is that optional function arguments can have anything as a value - even a gigantic JavaScript expression - and we still need to figure out where to draw the line - which kinds of function arguments should be shown in the short version. Perhaps we can just say, literals get printed, everything else collapsed?
  • Annotations - we’d love something like python’s docstrings or clojure’s meta system to be a reality in JavaScript, and I’ve been tinkering with the idea. It’ll likely require a new spec and documentation ecosystem, but the payoffs - not only getting nice output in Observable but also getting inline documentation from 3rd party libraries - makes it something that we’re all pretty game to invest some time in.

-Tom