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

new approach to types #6

Closed
somucheffort opened this issue Apr 19, 2023 · 2 comments
Closed

new approach to types #6

somucheffort opened this issue Apr 19, 2023 · 2 comments
Labels
refactor Refactoring main code

Comments

@somucheffort
Copy link
Owner

rust enums have not possibility to make custom traits, e.g. i would not add array.map to a boolean.

i think of one approach is creating file for every type and writing all functions for that type.

@somucheffort somucheffort added the enhancement New feature or request label Apr 19, 2023
@somucheffort somucheffort added the refactor Refactoring main code label May 19, 2023
@somucheffort somucheffort removed the enhancement New feature or request label Jun 23, 2023
@somucheffort
Copy link
Owner Author

somucheffort commented Jul 11, 2023

i wont make files, instead one file for every type with different traits:

  • Value (default)
    this trait would give raw value of an object or str/num/bool conversions
  • Destructable
    trait only for objects and arrays
  • Iterable
    idk how would user add iterator for a custom object, but this trait will be on string and array
  • FieldAccessable
    trait that would give access to read/write a field
    some fields could be in read-only mode, object would have possibility to lock it's fields, etc.

@somucheffort
Copy link
Owner Author

closed. see #10

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

No branches or pull requests

1 participant