Argument-specific docstrings or comments

Instead of a docstring-only solution, wouldn’t it be better to have a more general solution to attach arbitrary attributes (potentially more than one) to any language element?

Ideally, the mechanism would be the same for variables, functions, function arguments etc.

These attributes could then be used by an external typechecker to implement e.g. refinement types, as recently discussed here Would it make sense for Julia to adopt refinement types?.

1 Like