Esempio n. 1
0
static Object* SymbolEval(Context* ctx) {
  Object* o = StackPop(ctx->stack);
  if(!SymbolP(o)) {
    abort(); // TODO: error
  }
  Symbol* s = ObjectGetDataPtr(o);
  return EnvironmentGet(ctx, s);
}
Esempio n. 2
0
static FObject CompileTransformer(FObject obj, FObject env)
{
    if (PairP(obj) == 0 || (IdentifierP(First(obj)) == 0 && SymbolP(First(obj)) == 0))
        return(NoValueObject);

    FObject op = EnvironmentGet(env, First(obj));
    if (op == SyntaxRulesSyntax)
        return(CompileSyntaxRules(MakeSyntacticEnv(env), obj));

    return(NoValueObject);
}
Esempio n. 3
0
static FObject ResolvedGet(FObject env, FObject symid)
{
    FAssert(IdentifierP(symid) || SymbolP(symid));

    if (IdentifierP(symid))
    {
        while (IdentifierP(AsIdentifier(symid)->Wrapped))
        {
            env = AsSyntacticEnv(AsIdentifier(symid)->SyntacticEnv)->GlobalBindings;
            symid = AsIdentifier(symid)->Wrapped;
        }
    }

    FAssert(EnvironmentP(env));

    return(EnvironmentGet(env, symid));
}