Re: Documentation strings, declarations, markup, metadata
Lassi Kortela 27 May 2024 17:01 UTC
> I disagree with the characterization that this is "not general enough to
> warrant a # character". I think a general documentation comment syntax
> warrants a # character more than a specific #markup language would.
Respectfully,
You are coupling two orthogonal concerns into one syntax:
1. Lexical structure (i.e. another syntax for free-form text).
2. Purpose (i.e. metadata; specifically documentation).
Coupling orthogonal concepts is the fastest way to crowd out limited
syntactic space. From experience, I oppose any proposal which does that.
Furthermore, I suspect documentation is not special enough kind of data
to deserve its own character under #. (From the Zen of Python: "Special
cases are not special enough to break the rules.")
The use case of attaching documentation to any datum is not convincing.
It does not sound useful enough to warrant a one-character shorthand
under #. The use case for a general mechanism to attach any kind of
metadata to any datum is more convincing, and this is what Clojure
offers with a one-character shorthand. (I'm neutral on that feature;
don't have enough experience to be for or against.)
Since you don't offer a standard way for programmers to indicate what
markup language is used for a documentation fragment, we are passing the
buck on this important practical problem. (Putting a magic substring
near the start of a documentation string, or giving flags to tools, are
not reasonable ways to solve the problem. That's what we have now.)
A distinction should be made between # followed by a punctuation
character, which is a very crowded namespace, and # followed by a word,
which is not crowded. I guess #doc"foo" for documentation would be
appropriate, but I haven't worked through the implications.