Skip to content

Commit

Permalink
Use qualified filenames in var metadata [issue 50], patch from mb
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Apr 12, 2009
1 parent 31b821a commit e05a1ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/jvm/clojure/lang/Compiler.java
Expand Up @@ -362,7 +362,9 @@ else if(!(RT.second(form) instanceof Symbol))
throw new Exception("Can't create defs outside of current ns");
}
IPersistentMap mm = sym.meta();
mm = (IPersistentMap) RT.assoc(mm, RT.LINE_KEY, LINE.deref()).assoc(RT.FILE_KEY, SOURCE.deref());
Object source_path = SOURCE_PATH.get();
source_path = source_path == null ? "NO_SOURCE_FILE" : source_path;
mm = (IPersistentMap) RT.assoc(mm, RT.LINE_KEY, LINE.get()).assoc(RT.FILE_KEY, source_path);
Expr meta = analyze(context == C.EVAL ? context : C.EXPRESSION, mm);
return new DefExpr((String) SOURCE.deref(), (Integer) LINE.deref(),
v, analyze(context == C.EVAL ? context : C.EXPRESSION, RT.third(form), v.sym.name),
Expand Down

0 comments on commit e05a1ad

Please sign in to comment.