Changes the closure for an existing procedure. This function also updates the created_at time as if it is a new procedure.
This function generates a change and requires a call to commit() if commit history is enabled for the scope.
mod_procedure(name, closure)
| Argument | Type | Description |
|---|---|---|
name |
str (required) | Name of the procedure to modify. |
closure |
closure (required) | Closure which will be attached to the procedure. |
The value nil. A lookup_err() is raised if the procedure does not exist.
Create and modify a procedure
add_one:
// Create a new procedure `add_one`
new_procedure('add_one', |x| {
x + 1;
});
// Modify the procedure to add a doc string
mod_procedure('add_one', |x| {
"Adds one to a given value";
x + 1;
});
Return value in JSON format
null