How to add short inline documentation to a function?

I don’t think there is similar functionality in Julia.

Also, for single line, you may not need the triple quotes (unless you want to use unescaped quotes), so

"stuff" f(x) = 1

would work fine, too.

Finally, if you still don’t like prepending docstrings, you can write a macro

@docafter f(x) = 1 "stuff"

but personally I would just stick with what’s supported.

3 Likes