Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

[Lang Enhancement Proposal] Implement PblAny_T type #66

Open
1 task
Tracked by #65 ...
Luna-Klatzer opened this issue Nov 12, 2021 · 0 comments
Open
1 task
Tracked by #65 ...

[Lang Enhancement Proposal] Implement PblAny_T type #66

Luna-Klatzer opened this issue Nov 12, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request language Core language issue, change or idea

Comments

@Luna-Klatzer
Copy link
Member

Affected area by change:

  • Language Syntax: yes
  • Language Library (Parac Base Library): yes
  • Compiler: yes
  • Pre-Processor: no
  • Documentation: yes

Short Introduction and Summary
Implement the PblAny_T type to allow for new features such as dynamic casting, dynamic type conversion, run-type type checking, dictionaries and global type tracking to be implemented.

The PblAny_T is already partially implemented, but a base library for conversions and enhanced functionality needs to be provided to allow for proper usage without having issues while using it.

The signature of the type should be as follows:

struct PblAny_T {
  void* val;
  PblTypeMeta_T* type;
  PblSize_T* byte_size;
};

Is your request related to a problem? Please describe.

Currently, there is no way to properly implement certain features like dynamic casting and type tracking, without implementing the PblAny_T to allow for easier converting between different types.

This also includes the PblDict_T, which is proposed here #65

Describe alternatives you've considered

Possibly use advanced type checking and conversion, but with just a plain void* using additional compiler checks, to imitate the any type. This though seems to have no real benefit over this solution and complicate the issue.

Additional context

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request language Core language issue, change or idea
Projects
None yet
Development

No branches or pull requests

1 participant