In Emacs:

- Emacs Lisp (Elisp) macros can use a `declare` form to attach
metadata, including indentation info:

    https://www.gnu.org/software/emacs/manual/html_node/elisp/Declare-Form.html

- Other (external) Lisp language modes have a convention that there's
an Elisp {lisp,scheme,racket}-indent-function that does indentation,
and, it looks for a property list, where the key is the name of a
macro and the value is usually a number. Users can at least tweak this
in their Emacs init file. For example for racket-mode:

  
https://github.com/greghendershott/racket-mode/blob/master/Reference.md#racket-indent-line

For Racket:

- I like the idea of collections being able to provide indentation
info for special forms.

- I'd like the info to be easily accessible to both DrRacket and other
tools (including but not limited to racket-mode :)).

- Off the top of my head, it doesn't seem very Rackety to give
functions a runtime blob of metadata.

- Probably a more Rackety way to do this would be in a submodule. Much
like doc, indentation info feels like something that's not about run
time (or even compile time).  Doc is about "doc time", and indentation
is about "edit time" (or "tool time").

Also, like doc, there's an xref database aspect to this -- given a
namespace and a symbol foo, you want to quickly lookup the indentation
for the correct foo.  In fact, maybe "doc time" vs. "edit time" is a
distinction without a difference. Maybe the answer is to allow docs to
be more structured -- such as, instead of a blob of HTML, here's the
"blue box" part, here's the remaining part, here's the (optional, new)
indentation value, and so on.  [It could still be a blob of HTML, I
guess -- just one tagged more finely ala so-called "semantic HTML".]

Sorry that turned into a longer ramble than I expected.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to