@@ -1419,7 +1419,7 @@ private static object MacroexpandSeq1(ISeq form)
14191419 if ( sym != null )
14201420 {
14211421 string sname = sym . Name ;
1422- // (.substring s 2 5) => (. x substring 2 5)
1422+ // (.substring s 2 5) => (. s substring 2 5)
14231423 // ns == null ensures that Class/.instanceMethod isn't expanded to . form
14241424 if ( sname [ 0 ] == '.' && sym . Namespace == null )
14251425 {
@@ -1432,22 +1432,23 @@ private static object MacroexpandSeq1(ISeq form)
14321432 // We need to make sure source information gets transferred
14331433 return MaybeTransferSourceInfo ( PreserveTag ( form , RT . listStar ( DotSym , target , method , form . next ( ) . next ( ) ) ) , form ) ;
14341434 }
1435- //else if (NamesStaticMember(sym))
1436- //{
1437- // Symbol target = Symbol.intern(sym.Namespace);
1438- // Type t = HostExpr.MaybeType(target, false);
1439- // if (t != null)
1440- // {
1441- // Symbol method = Symbol.intern(sym.Name);
1442- // // We need to make sure source information gets transferred
1443- // return MaybeTransferSourceInfo(PreserveTag(form, RT.listStar(Compiler.DotSym, target, method, form.next())), form);
1444- // }
1445- //}
14461435 else
14471436 {
1448- // (x .substring 2 5) => (. x substring 2 5)
1437+ // (s .substring 2 5) => (. s substring 2 5)
14491438 // also (package.class.name ... ) (. package.class name ... )
1439+
1440+ // The comment above is in the JVM code. It appears to no longer be valid.
1441+ // Because the code following the next line is also commented out in the JVM code.
14501442 int index = sname . LastIndexOf ( '.' ) ;
1443+ //if (idx > 0 && idx < sname.length() - 1)
1444+ //{
1445+ // symbol target = symbol.intern(sname.substring(0, idx));
1446+ // symbol meth = symbol.intern(sname.substring(idx + 1));
1447+ // return rt.liststar(dot, target, meth, form.rest());
1448+ //}
1449+ //(stringbuilder. "foo") => (new stringbuilder "foo")
1450+ //else
1451+
14511452 if ( index == sname . Length - 1 )
14521453 // We need to make sure source information gets transferred
14531454 return MaybeTransferSourceInfo ( RT . listStar ( Compiler . NewSym , Symbol . intern ( sname . Substring ( 0 , index ) ) , form . next ( ) ) , form ) ;
0 commit comments