Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command to peek at otherwise inaccessible context #978

Open
joeldrapper opened this issue Jul 1, 2024 · 0 comments
Open

Add a command to peek at otherwise inaccessible context #978

joeldrapper opened this issue Jul 1, 2024 · 0 comments

Comments

@joeldrapper
Copy link

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?

@joeldrapper joeldrapper changed the title Add a command to peek at otherwise inaccessible variables Add a command to peek at otherwise inaccessible context Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant