arturo
arturo copied to clipboard
[VM/lib] Introduce typeset data type?
[VM/lib] Introduce typeset data type?
It would be ideal to have a :typeset
data type which would serve as an umbrella-set for different types, and used mainly in function signatures: primarily, the built-in ones, and of course the user-defined ones. But we have to figure out how this could work in a viable way...
The code below is just an attempt of "unfolding" typesets, by force-embedding them into each function's list of accepted types. But this may be messy for documentation generation.
https://github.com/arturo-lang/arturo/blob/ce734e7a32c73173910cdf8f533f56be21febe3b/src/vm/lib.nim#L60
let compact {.compileTime.} = false
# TODO(VM/lib) Introduce typeset data type?
# It would be ideal to have a `:typeset` data type which would serve as an umbrella-set for different types, and used mainly in function signatures: primarily, the built-in ones, and of course the user-defined ones. But we have to figure out how this could work in a viable way...
# The code below is just an attempt of "unfolding" typesets, by force-embedding them into each function's list of accepted types. But this may be messy for documentation generation.
# labels: vm, language, values, enhancement, open discussion
# template expandTypesets*(args: untyped): untyped =
# when (static args.len)==1 and args!=NoArgs:
# #echo($(args))
c2cbabe06269f9393269cc04262d89f6a892672d