maxrt101 / ff

Scripting language
MIT License
4 stars 0 forks source link

Generics #24

Open maxrt101 opened 2 years ago

maxrt101 commented 2 years ago

Example:

fn read[T](): T -> { ... }

class Map[K, V] {}

T will be checked in compile-time. No additional runtime checks will be performed. T may be saved in function call, or class instantiation, for runtime checking.

Create std::map<std::string, std::string> m_genericTypes; in Compiler::Variable. Create std::vector<std::string> genericTypes; in Function, NativeFunction and in Class (when its ready)