buzz-language / buzz

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

Deep List/Map as default values #131

Open giann opened 1 year ago

giann commented 1 year ago

List and maps provided as default function argument or default object property value are cloned at runtime. We don't allow list/map containing themselves list and maps. We could allow it by doing a deep clone rather than a shallow one. It could be costly if user provides a very deep default value but we could argue that this is unlikely.