Skip to content

Data objects #422

Description

@shiffman

@benfry and I were just talking about the data classes from Processing like IntDict, FloatDict, StringList etc in JS and we came to a conclusion that it would be nice to implement some of these for p5. I am thinking:

  • NumberList
  • StringList
  • NumberDict
  • StringDict

Obviously without types in JavaScript there can just be a Dict and List, however, I think it would be nice to separate out Numbers and Strings. For example, there are enough API differences and reference-wise it would be confusing for it to be all in one. If you want a more advanced list or dictionary with multiple data types in JS then you would implement it yourself with native JS arrays and/or objects. But these would be simple ways to do quick operations on lists and dictionaries with basic data types. This aligns with Processing: IntDict for simple dictionary, HashMap from Java for more advanced.

@therewasaguy am I correct that these have not been started yet? I am very happy to take on working on these (likely after the ITP semester) and thought it might be nice to start the discussion here.

Thoughts?

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions