Better function argument verification #1810
Labels
benchmark
Benchmarks and optimizations
enhancement
New feature or request
execution
Issues related to the executor (src/vm/exec.nim)
vm
Issues related to the Virtual Machine implementation
Right now, we are verify function arguments by effectively embedding an
ensure
call. (more or less what I describe here: https://discord.com/channels/765519132186640445/829324913097048065/1309436123017117707)The actual implementation is here: https://discord.com/channels/765519132186640445/829324913097048065/1309437688696537138
Given that we now (and for quite some time) store all this information in a Function value's
.info
field (see: https://github.com/arturo-lang/arturo/blob/master/src/vm/values/types.nim#L209-L213), we could use that to check the parameters, before execution... e.g. here: https://github.com/arturo-lang/arturo/blob/master/src/vm/exec.nim#L342The text was updated successfully, but these errors were encountered: