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

Enforcing void value paradigm #82

Open
phorward opened this issue Oct 24, 2022 · 1 comment
Open

Enforcing void value paradigm #82

phorward opened this issue Oct 24, 2022 · 1 comment
Assignees
Labels

Comments

@phorward
Copy link
Member

Similar to JavaScript, Tokay has two atomics to define an empty value.

  • void is intended to define a value which isn't there
  • null is a defined empty value

This concept is currently not enforced in Tokay. Here's an example:

  • dict_pop (dict.pop() function #75) does it right, and returns a default (defaults to void) in case a value doesn't exist
  • list_pop (e9e63f5) does it wrong, and throws an error when trying to pop something off an empty list

There are several more, related methods currently available. General rules relating void:

  • void shall be returned when it doesn't exist
  • when something is set to void, it shall be removed, emptied or similar
@phorward
Copy link
Member Author

#80 entirely enforces this paradigm, setting an item to void removes it, a non-existing item produces void.

@phorward phorward changed the title Enforce use of void values in object methods Enforcing void value paradigm Oct 26, 2022
@phorward phorward moved this to Todo in Tokay v0.6 Dec 26, 2022
@phorward phorward removed this from Tokay v0.6 Dec 26, 2022
@phorward phorward added this to the Tokay v0.6 milestone Dec 26, 2022
@phorward phorward removed this from the Tokay v0.6 milestone Jan 13, 2023
@phorward phorward removed the tokay label Oct 8, 2023
phorward added a commit that referenced this issue Oct 27, 2023
This is another enforcement of the `void`-paradigm #82
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