# HG changeset patch # User jwe # Date 811494778 0 # Node ID d90d88618a9e7d394ce15727ba2106d8bf68187c # Parent 045e70a15a8f5a57014bd9018759815b63782e2d [project @ 1995-09-19 07:12:58 by jwe] diff -r 045e70a15a8f -r d90d88618a9e src/defun.h --- a/src/defun.h Tue Sep 19 07:09:50 1995 +0000 +++ b/src/defun.h Tue Sep 19 07:12:58 1995 +0000 @@ -59,8 +59,8 @@ // // doc is the simple help text for this variable. -#define DEFVAR(name, sname, defn, inst_as_fcn, protect, \ - eternal, sv_fcn, doc) \ +#define DEFVAR_INT(name, sname, defn, inst_as_fcn, protect, \ + sv_fcn, doc) \ do \ { \ builtin_variable sname = \ @@ -69,7 +69,7 @@ new tree_constant (defn), \ inst_as_fcn, \ protect, \ - eternal, \ + (sv_fcn ? 1 : 0), \ sv_fcn, \ doc, \ }; \ @@ -77,6 +77,18 @@ } \ while (0) +#define DEFVAR(name, sname, defn, inst_as_fcn, sv_fcn, doc) \ + DEFVAR_INT (name, sname, defn, inst_as_fcn, 0, sv_fcn, doc) + +// Define a builtin-constant, and a corresponding variable that can be +// redefined. This is just the same as DEFVAR, except that it defines +// `name' as a variable, and `__name__' as a constant that cannot be +// redefined. + +#define DEFCONST(name, sname, defn, inst_as_fcn, sv_fcn, doc) \ + DEFVAR_INT (name, sname, defn, inst_as_fcn, 0, sv_fcn, doc); \ + DEFVAR_INT ("__" ## name ## "__", sname, defn, 0, 1, sv_fcn, doc) + // Define a builtin function. // // name is the name of the function, as a string. @@ -94,7 +106,7 @@ // accept. XXX FIXME XXX -- is this really used now? // // nargout_max is the maximum number of outputs this function can -// produce. XXX FIXME XXX -- is this really used now? +// produce. XXX FIXME XXX -- is this really used now? // // doc is the simple help text for the function.