MCPcopy Index your code
hub / github.com/clojure/clojure / TheVarExpr

Class TheVarExpr

src/jvm/clojure/lang/Compiler.java:682–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680}
681
682public static class TheVarExpr implements Expr{
683 public final Var var;
684
685 public TheVarExpr(Var var){
686 this.var = var;
687 }
688
689 public Object eval() {
690 return var;
691 }
692
693 public void emit(C context, ObjExpr objx, GeneratorAdapter gen){
694 objx.emitVar(gen, var);
695 if(context == C.STATEMENT)
696 gen.pop();
697 }
698
699 public boolean hasJavaClass(){
700 return true;
701 }
702
703 public Class getJavaClass() {
704 return Var.class;
705 }
706
707 static class Parser implements IParser{
708 public Expr parse(C context, Object form) {
709 Symbol sym = (Symbol) RT.second(form);
710 Var v = lookupVar(sym, false);
711 if(v != null)
712 return new TheVarExpr(v);
713 throw Util.runtimeException("Unable to resolve var: " + sym + " in this context");
714 }
715 }
716}
717
718public static class KeywordExpr extends LiteralExpr{
719 public final Keyword k;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected