Language Design | ZeroLimits Docs

submited by
Style Pass
2025-01-20 19:00:04

Import statements import the whole module and assign it to a variable. Specific things from the module cannot be imported, such as JavaScript's import { function } from pkg or Python's from pkg import function. Wildcard imports like Python's from pkg import * are also not allowed.

This is beneficial because different modules can export functions with the same name, and it'll always be clear where each function came from, at the cost of typing slightly more.

These behave the same as normal comments since it's only the // and /* */ that matter, all the other / and * are optional. However, the LSP will only recognise /// and /** */ as doc comments.

Functions can be overloaded with different implementations of the same function. This is usually helpful when you want to have multiple parameter types, for example. However, because the language is strictly typed, each overload must have its own implementation.

However, overloads can only differ by their parameters. So if you'd like to create two functions that take the same input and return different outputs, they must have different names.

Leave a Comment