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

[Lang Enhancement Proposal] Implement PblDict_T type #65

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

[Lang Enhancement Proposal] Implement PblDict_T type #65

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

Luna-Klatzer commented Nov 12, 2021

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 new type PblDict_T with the following signature:

struct PblDictPair_T {
  PblString_T* identifier;
  PblAny_T* val;
};

struct PblDict_T {
  PblKeyValuePair_T* items_arr;
};

This type will be a simple array where each item is a PblKeyValuePair_T, which represents a pair of a key (string) and value (any) that may be iterated through and searched through by the function:

PblKeyValuePair_T* PblGetDictItemByKey(PblDict_T* dict, PblString_T* string)

The Para-C corresponding identifier may be:

  • PblDict_T: dict (alias - though the normal identifier PblDict_T may also be used)
  • PblKeyValuePair_T: PblKeyValuePair_T (C identifiers are going to be the same in Para-C)

Is your request related to a problem? Please describe.

The implementation of a dictionary should allow for the proper implementation of the global type dictionary, which will keep track of all types to allow for dynamic casting and conversion using the PblAny_T type.

Describe alternatives you've considered

None.

Additional context

For this implementation to properly work, the PblAny_T must be finished first, which will allow for the Dictionary to allow any value to be passed.

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