Open njordhov opened 3 years ago
Private functions could go even further, like supporting symbols as arguments (such as function names and var names) and variadic parameters, bringing new native functions almost up to par with the syntax of current native functions.
The type of parameters can be inferred for functions that are only called from within a contract. Declaring the type of these function parameters can thus be made optional.
Optional typing opens for user implemented functions that overloads parameter types, like those in the native library. For example, it enables defining functions covering all sequence types, without regard for length or entry type, solving the problem reported in #39.
It makes more native-like functions entirely expressible in Clarity. This can benefit the future evolution of the Clarity language per #32 by allowing functions implemented in Clarity to have equal functionality as native ones, then re-implemented natively without requiring a hard fork.
It also allows gradual typing, with type declarations added as the contract are developed. This makes for a smoother developer experience, where the initial version of a function can focus on implementing desired functionality rather than require explicit typing.