From 081f14a169d36243f97263acb41fb108af243619 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 8 Feb 2018 13:00:53 -0500 Subject: Allow using RegisterPrimop to define constants. This enables plugins to add new constants, as well as new primops. --- src/libexpr/primops.hh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libexpr/primops.hh') diff --git a/src/libexpr/primops.hh b/src/libexpr/primops.hh index 39d23b04a5ce..31bf3f84f6c7 100644 --- a/src/libexpr/primops.hh +++ b/src/libexpr/primops.hh @@ -9,6 +9,9 @@ struct RegisterPrimOp { typedef std::vector> PrimOps; static PrimOps * primOps; + /* You can register a constant by passing an arity of 0. fun + will get called during EvalState initialization, so there + may be primops not yet added and builtins is not yet sorted. */ RegisterPrimOp(std::string name, size_t arity, PrimOpFun fun); }; -- cgit 1.4.1