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

Improved string representation of Notion objects in the REPL #123

Merged
merged 1 commit into from
Jun 21, 2019

Conversation

wilhelmy
Copy link
Collaborator

This way, objects have a nice string representation in the REPL, which
in theory should make things easier when experimenting interactively.

Using the new notionflux:

lua> ioncore.current()
WClientWin: 0x1df7228
lua> ioncore.current():screen_of()
WScreen: 0x1db5c98
lua> ioncore.current():rootwin_of()
WRootWin: 0x1db5e38

In places where the type information matters other than for visual
representation, it is still shown as "userdata".

lua> type(ioncore.current())
"userdata"

This way, objects have a nice string representation in the REPL, which
in theory should make things easier when experimenting interactively.

Using the new notionflux:

lua> ioncore.current()
WClientWin: 0x1df7228
lua> ioncore.current():screen_of()
WScreen: 0x1db5c98
lua> ioncore.current():rootwin_of()
WRootWin: 0x1db5e38

In places where the type information matters other than for visual
representation, it is still shown as "userdata".

lua> type(ioncore.current())
"userdata"
Copy link
Owner

@raboof raboof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

@raboof raboof merged commit 77584a4 into raboof:master Jun 21, 2019
@raboof raboof changed the title libextl: __tostring method for notion objects as interactive sugar Improved string representation of Notion objects in the REPL Jun 21, 2019
@raboof raboof added the development issues that don't impact end users directly label Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development issues that don't impact end users directly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants