-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added help() shell function #150
Conversation
`help()` displays help info for each data type
How this will work with user defined objects? |
Didn't think of that. I think users can define a custom |
Can we dynamically generate the help from object? Example:
Output
Here in this example, |
Is there a way to get all the methods and what they return dynamically? |
Not exists till now? |
So when defining a method in a class, it can also store that info somewhere, that might also help making the |
Yeah, you can create like that. |
What do you think @angelcaru ? |
I'm currently working on it, here is the result so far
How can I check what the function returns if this is a dynamic typed language? Maybe we can put something else there, like a description for the method? |
Showing description in return? |
how should the descriptions be written? Maybe a local variable in each function like:
|
Maybe a built-in function? Like:
Because I don't see how you would get the value for a |
Oh... right |
I think we can do it like Python. In the first line, if we have a string, then set it to description else put empty. |
I think I got it working, here
Output
|
This will be like |
it will be just |
That seems inconvenient. What if the constructor has arguments? |
Yeah... I will try to get it working to accept both instances and classes |
It should also work on standalone functions. Right now it only works on classes |
So, something like this?
|
A new thing. If I want to get the output from
|
Little spacing will make this look pretty.
|
Previous output was nice. |
Is this good?
|
Add spacing in also property. Example:
|
It is running the method or class to get its inner string!! This is now expected. |
? |
Check this. It is running the Test class to get it's inner descriptions.
|
No it's not? It's running the Test class to create the class. That's how it works |
The descriptions get collected during the parsing. After the LBRACE, when it encounters a string, it sets it as it's description, then continues the parsing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine as an initial implementation. We will work on it, if we found any issue later on.
Thank you for your contribution. 🥇
help()
displays help info for each data typePart of #8