Skip to content

Add a command to peek at otherwise inaccessible context #978

@joeldrapper

Description

@joeldrapper

Sometimes we run into inaccessible context when debugging, such as anonymous arguments: *, **, &, ..., or arguments that conflict with Ruby keywords, such as class, end, if.

In these situations, it would be useful to be able to peek at the context. Maybe there’s a better name for this concept, but essentially it would be an IRB command that just returns *args, **kwargs, and &block.

def peek(*args, **kwargs, &block)
  { args:, kwargs:, block: }
end

This would support things like:

peek(*)
peek(**)
peek(&)
peek(...)
peek(class:, end:, if:)

Does this sound useful to anyone else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions