@@ -68,7 +68,7 @@ public class LispReader{
6868 macros [';' ] = new CommentReader ();
6969 macros ['\'' ] = new WrappingReader (QUOTE );
7070 macros ['@' ] = new WrappingReader (DEREF );//new DerefReader();
71- macros ['^' ] = new WrappingReader (META );
71+ macros ['^' ] = new DeprecatedWrappingReader (META , "^" );
7272 macros ['`' ] = new SyntaxQuoteReader ();
7373 macros ['~' ] = new UnquoteReader ();
7474 macros ['(' ] = new ListReader ();
@@ -491,6 +491,26 @@ public Object invoke(Object reader, Object quote) throws Exception{
491491
492492}
493493
494+ public static class DeprecatedWrappingReader extends AFn {
495+ final Symbol sym ;
496+ final String macro ;
497+
498+ public DeprecatedWrappingReader (Symbol sym , String macro ){
499+ this .sym = sym ;
500+ this .macro = macro ;
501+ }
502+
503+ public Object invoke (Object reader , Object quote ) throws Exception {
504+ System .out .println ("WARNING: reader macro " + macro +
505+ " is deprecated; use " + sym .getName () +
506+ " instead" );
507+ PushbackReader r = (PushbackReader ) reader ;
508+ Object o = read (r , true , null , true );
509+ return RT .list (sym , o );
510+ }
511+
512+ }
513+
494514public static class VarReader extends AFn {
495515 public Object invoke (Object reader , Object quote ) throws Exception {
496516 PushbackReader r = (PushbackReader ) reader ;
0 commit comments