mirror of
https://github.com/tweag/nickel.git
synced 2024-09-17 14:37:30 +03:00
18ee89b644
* Add immediate/delayed notion to the manual * Split custom contracts in immediate and delayed part This commit explicitly split the custom contract representation and constructors into an immediate part, similar to a validator, and a delayed part, which is a partial identity. The stdlib and primops are adapted as well (`%contract/custom%` now takes two arguments, the two parts, and `%contract/from_xxx%` operators aren't used anymore as they are subsumed by `%contract/custom%`). * Rework prepare_contract to be more low-level and use null comparison * Make `%contract/get_xxx%` panic on a Type In the long run, we want that `%contract/get_immediate%` and `%contract/get_delayed%` works as well on types, by calling to the right function from the internals module. However, this requires deeper changes, and is left for future work. Since those primops have just been introduced, there's no reason they'd be used already in the wild, so for now, we make the implemention panic if we try to apply them to a Type. * Update stdlib doc, manual and examples Update various documentation to reflect the new custom contract constructor with an immediate and a delayed part. * Update config-gcc example with new custom contract builder * Fix tests * Implement review suggestions Co-authored-by: jneem <joeneeman@gmail.com> * Review suggestion: use concrete example for delayed checks * Review suggestion: deduplicate custom contracts in-code doc * Update Topiary input to avoid CI error (gitsavannah) --------- Co-authored-by: jneem <joeneeman@gmail.com> |
||
---|---|---|
.. | ||
internals.ncl | ||
std.ncl |