3 ms·
This comment is misleading &| misinformed. Sum types are built-in [1] for formal parameters. `nil` is only for `ref|ptr` types. In much code you can just use
by cb321 3y ago
This comment is misleading &| misinformed.
Sum types are built-in [1] for formal parameters. `nil` is only for `ref|ptr` types. In much code you can just use stack allocated value types and there is neither GC concern nor nil concern, but there is also a mode to help: https://nim-lang.github.io/Nim/manual_experimental_strictnotnil.html https://nim-lang.github.io/Nim/manual_experimental_strictnot...
Nim has an easy-ish to use Lisp-like syntax macro system where you just receive & process an AST. So, to do the rest you can make libraries adding the feature without relying upon upstream compiler: such as https://github.com/beef331/sumtypes https://github.com/beef331/sumtypes for variables with sum types or pattern matching libs like https://andreaferretti.github.io/patty/ https://andreaferretti.github.io/patty/ | https://github.com/alehander92/gara https://github.com/alehander92/gara.