mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-05-01 13:27:10 +02:00
Add "const" function, which is the inverse of "nonconst"
This commit is contained in:
@@ -568,6 +568,10 @@ eval_builtin(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
/* All went well; copy the result destructively */
|
||||
(*ans) = info.retval;
|
||||
|
||||
/* Special case of const cunction */
|
||||
if (!strcmp(f->name, "const")) {
|
||||
*nonconst = 0;
|
||||
}
|
||||
/* Don't allow retval to be destroyed! */
|
||||
info.retval.type = ERR_TYPE;
|
||||
}
|
||||
|
||||
@@ -258,6 +258,7 @@ BuiltinFunc Func[] = {
|
||||
{ "choose", 2, NO_MAX, 1, NULL, FChoose }, /*NEW-STYLE*/
|
||||
{ "coerce", 2, 2, 1, FCoerce, NULL },
|
||||
{ "columns", 0, 1, 0, FColumns, NULL },
|
||||
{ "const", 1, 1, 1, FNonconst, NULL },
|
||||
{ "current", 0, 0, 0, FCurrent, NULL },
|
||||
{ "date", 3, 3, 1, FDate, NULL },
|
||||
{ "datepart", 1, 1, 1, FDatepart, NULL },
|
||||
|
||||
Reference in New Issue
Block a user