Skip to content

Commit

Permalink
Revert "Fix CLJ-1330: make top-level named functions classnames don't…
Browse files Browse the repository at this point in the history
… clash with def'ed function classnames"

This reverts commit f149260.
  • Loading branch information
stuarthalloway committed Nov 14, 2014
1 parent ae0c767 commit 8e4c432
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions src/jvm/clojure/lang/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -3844,28 +3844,17 @@ static Expr parse(C context, ISeq form, String name) {
// fn.superName = (String) RT.get(RT.meta(form.first()), Keyword.intern(null, "super-name"));
}
//fn.thisName = name;

String basename = (enclosingMethod != null ?
enclosingMethod.objx.name
: (munge(currentNS().name.name))) + "$";

Symbol nm = null;

if(RT.second(form) instanceof Symbol) {
nm = (Symbol) RT.second(form);
if (name == null)
name = nm.name + "__" + RT.nextID();
else
name += "__" + nm.name + "__" + RT.nextID();
} else {
if(name == null)
name = "fn__" + RT.nextID();
else if (enclosingMethod != null)
name += "__" + RT.nextID();
}

String simpleName = munge(name).replace(".", "_DOT_");

String basename = enclosingMethod != null ?
(enclosingMethod.objx.name + "$")
: //"clojure.fns." +
(munge(currentNS().name.name) + "$");
if(RT.second(form) instanceof Symbol)
name = ((Symbol) RT.second(form)).name;
String simpleName = name != null ?
(munge(name).replace(".", "_DOT_")
+ (enclosingMethod != null ? "__" + RT.nextID() : ""))
: ("fn"
+ "__" + RT.nextID());
fn.name = basename + simpleName;
fn.internalName = fn.name.replace('.', '/');
fn.objtype = Type.getObjectType(fn.internalName);
Expand All @@ -3884,8 +3873,9 @@ VAR_CALLSITES, emptyVarCallSites(),
));

//arglist might be preceded by symbol naming this fn
if(nm != null)
if(RT.second(form) instanceof Symbol)
{
Symbol nm = (Symbol) RT.second(form);
fn.thisName = nm.name;
fn.isStatic = false; //RT.booleanCast(RT.get(nm.meta(), staticKey));
form = RT.cons(FN, RT.next(RT.next(form)));
Expand Down

0 comments on commit 8e4c432

Please sign in to comment.