Skip to content

Implement dict to receive Object as key, not only String #118

Open
@HyeockJinKim

Description

@HyeockJinKim

type StringDict map[string]Object

Change the dict to receive a hashable object as a key, not just a string.
I will change it so that the object can be looked up through the hash value of the object.

Store the object in the slice and use the map to find the index of the stored object through the hash value.

make([]Object, 0, len(default_size))  // slice to store object  (index -> Object)
type Dict map[HashIndex]int // map to store index of slice  (Hash -> index)

Is it ok to implement dict this way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions