Skip to content

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Oct 18, 2025

Change the @doc macro implementation to return the result of the original expression instead of the Docs.Binding object. This allows using the documented definition in an assignment or other expression context.

For example, documenting a function now returns the function itself:

result = begin
    "docstring"
    function f end
end

Add special handling for global declarations to return nothing instead of failing with a syntax error, since x = begin; global x; end is not valid Julia syntax.

🤖 Generated with help from Claude Code

Change the @doc macro implementation to return the result of the
original expression instead of the binding. This allows using the
documented definition in an assignment or other expression context.

For example, documenting a function now returns the function itself:
```julia
result = begin
    "docstring"
    function f end
end
```

Add special handling for `global` declarations to return nothing
instead of failing with a syntax error, since `x = begin; global x; end`
is not valid Julia syntax.

🤖 Generated with help from Claude Code
@vtjnash vtjnash added the docsystem The documentation building system label Oct 18, 2025
@vtjnash vtjnash changed the title Docs: Make @doc macro return the value of documented expression Docs: Make `@doc macro return the value of documented expression Oct 18, 2025
@vtjnash vtjnash changed the title Docs: Make `@doc macro return the value of documented expression Docs: Make @doc macro return the value of documented expression Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsystem The documentation building system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant