buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.23k stars 34 forks source link

Object generics #82

Closed giann closed 1 year ago

giann commented 2 years ago
object Population<T> {
    [T] population,

    fun count() > num {
        return this.population.len();
    }
}

Population<str> myPopulation = Population<str>{
    population = [str, "joe", "john", "burt"],
};

myPopulation.count() == 3;