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

More support for reflection / introspection #65

Open
catb0t opened this issue Nov 11, 2018 · 1 comment
Open

More support for reflection / introspection #65

catb0t opened this issue Nov 11, 2018 · 1 comment
Labels

Comments

@catb0t
Copy link
Contributor

catb0t commented Nov 11, 2018

Getting the list of candidate function-or-methods a name might refer to (and for Sidef FOMs, their argument list?), reading a Block's inner/surrounding comments, similar things.

and some of the other kinds of reflection like implemented in Python's inspect, like the current line number or the line number where a variable / overload was defined.

@catb0t catb0t added the feature label Nov 11, 2018
@catb0t
Copy link
Contributor Author

catb0t commented Nov 12, 2018

also, it would be cool to have a method .code or something on Block and function-likes:

{ var a = 1; a += 2 }          # {|_| #`(__BLOCK__|94390607501168) ... }
{ var a = 1; a += 2 }.code     # {|_| var a = 1; a += 2 ... }

the {|_| #`(__BLOCK__|94390607501168) ... } form is good for debugging, but it doesn't allow the user to uniquely identify that block among any other in a program, because we don't know the refaddr in the source code.

For "Blocks" or callables with no Sidef source code, it could be {|_| #`([native code]) } (a sneaky reference to Chrome's JS console doing ƒ toString() { [native code] when showing the definition of a C++ function)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant