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 :globals command in REPLs #21

Open
zxul767 opened this issue Nov 17, 2022 · 0 comments
Open

add :globals command in REPLs #21

zxul767 opened this issue Nov 17, 2022 · 0 comments
Labels
enhancement New feature or request p2

Comments

@zxul767
Copy link
Owner

zxul767 commented Nov 17, 2022

the :globals command should print a list of all the globals in the current session, organized by type:

CoffeeMaker   <class>
maker         <CoffeeMaker instance>

start         <function>
counter1      <closure>
counter2      <closure>

count         <primitive:number>
program       <primitive:string>
flag          <primitive:bool>

for clox, even though we always wrap functions in closures, by inspecting the upvalues array we can tell if a function is an actual closure.

@zxul767 zxul767 added the enhancement New feature or request label Nov 17, 2022
@zxul767 zxul767 added the p2 label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p2
Projects
None yet
Development

No branches or pull requests

1 participant