Next: 2.3.2 リストの評価
Up: 2.3 eval
Previous: 2.3 eval
リストでなければシンボルの値を取り出します.
#define getvalue(x) ((x)->n_vdata[0])
/* xlgetvalue - get the value of a symbol (with check) */
LVAL xlgetvalue(sym)
LVAL sym;
{
LVAL val;
/* look for the value of the symbol */
while ((val = xlxgetvalue(sym)) == s_unbound)
xlunbound(sym);
/* return the value */
return (val);
}
/* xlxgetvalue - get the value of a symbol */
LVAL xlxgetvalue(sym)
LVAL sym;
{
register LVAL fp,ep;
LVAL val;
/* check the environment list */
for (fp = xlenv; fp; fp = cdr(fp))
/* check for an instance variable */
if ((ep = car(fp)) && objectp(car(ep))) {
if (xlobgetvalue(ep,sym,&val))
return (val);
}
/* check an environment stack frame */
else {
for (; ep; ep = cdr(ep))
if (sym == car(car(ep)))
return (cdr(car(ep)));
}
/* return the global value */
return (getvalue(sym));
}
generated through LaTeX2HTML. M.Inaba 平成18年5月6日