Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Implementation of union-type-descriptor #113

Answered by ayonam
KavinduZoysa asked this question in Ideas
Discussion options

You must be logged in to vote

@KavinduZoysa @manuranga I'm not sure I got this right. Our current method of boxing has the following format:

+-----------------+
| Current TypeStr |
+-----------------+
| Original TypeStr |
+-----------------+
| Data |
+-----------------+

Now, for the Union, say (int | string), I would envisage it as follows:

+-----------------+
| Current TypeStr |
+-----------------+
| Original TypeStr |
+-----------------+
| Integer Value |
+-----------------+
| String Object |
+-----------------+

Now, an assignment operation of an integer to this union will come with a structure like the first one above with the 'Data' being an integer and the Current TypeStr showing an Integer Type as per our name m…

Replies: 3 comments 22 replies

Comment options

You must be logged in to vote
7 replies
@manuranga
Comment options

@KavinduZoysa
Comment options

@manuranga
Comment options

@KavinduZoysa
Comment options

@manuranga
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
15 replies
@ayonam
Comment options

@KavinduZoysa
Comment options

@KavinduZoysa
Comment options

@ramakotareddy
Comment options

@KavinduZoysa
Comment options

Answer selected by KavinduZoysa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
5 participants