Skip to content

Implement SIGNATURES-like abbreviation for collection of methods #56

Closed as not planned

Description

@setempler

When I have several methods, for example:

"""
    $(SIGNATURES)

Print-fu.
"""
foo(x::Int) = print(x)
foo(x::Int, y::Int) = print(x + y)

I get

    foo(x)

Print-fu.

But I am looking for an implementation that yields

    foo(x)
    foo(x, y)

Print-fu.

Is this possible at all?

Activity

  1. mortenpi commented on Jul 1, 2018

    @mortenpi
    Member

    Sorry, I must have missed this originally.

    Docstrings are, in general, attached to a particular method, and hence $(SIGNATURES) should only contain that method I think. But perhaps we could have $(SIGNATURES) expand to all signatures when attached to a function declaration function foo end. So for your use case it would look something like:

    """
        $(SIGNATURES)
    
    Print-fu.
    """
    function foo end
    
    foo(x::Int) = print(x)
    foo(x::Int, y::Int) = print(x + y)

    I don't think I will have time to look into this myself any time soon though, but a PR would be most welcome if someone wants to take a stab at implementing it.

  2. MichaelHatherly commented on Oct 12, 2026

    @MichaelHatherly
    Member

    This looks mostly like METHODLIST, so I'm inclined to close this as covered elsewhere already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions