Skip to content

Commit

Permalink
force instance member interpretation of (.method ClassName), e.g. (.g…
Browse files Browse the repository at this point in the history
…etMethods String) works
  • Loading branch information
richhickey committed Dec 13, 2008
1 parent 6f913b4 commit f951752
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/jvm/clojure/lang/Compiler.java
Expand Up @@ -66,6 +66,7 @@ public class Compiler implements Opcodes{
static final Symbol LIST = Symbol.create("clojure.core", "list");
static final Symbol HASHMAP = Symbol.create("clojure.core", "hash-map");
static final Symbol VECTOR = Symbol.create("clojure.core", "vector");
static final Symbol IDENTITY = Symbol.create("clojure.core", "identity");

static final Symbol _AMP_ = Symbol.create("&");
static final Symbol ISEQ = Symbol.create("clojure.lang.ISeq");
Expand Down Expand Up @@ -4041,7 +4042,12 @@ public static Object macroexpand1(Object x) throws Exception{
throw new IllegalArgumentException(
"Malformed member expression, expecting (.member target ...)");
Symbol meth = Symbol.intern(sname.substring(1));
return RT.listStar(DOT, RT.second(form), meth, form.rest().rest());
Object target = RT.second(form);
if(HostExpr.maybeClass(target,false) != null)
{
target = RT.list(IDENTITY, target);
}
return RT.listStar(DOT, target, meth, form.rest().rest());
}
else if(namesStaticMember(sym))
{
Expand Down

0 comments on commit f951752

Please sign in to comment.