(Object reader, Object lparen, Object opts, Object pendingForms)
| 868 | |
| 869 | public static class FnReader extends AFn{ |
| 870 | public Object invoke(Object reader, Object lparen, Object opts, Object pendingForms) { |
| 871 | PushbackReader r = (PushbackReader) reader; |
| 872 | if(ARG_ENV.deref() != null) |
| 873 | throw new IllegalStateException("Nested #()s are not allowed"); |
| 874 | try |
| 875 | { |
| 876 | Var.pushThreadBindings( |
| 877 | RT.map(ARG_ENV, PersistentTreeMap.EMPTY)); |
| 878 | unread(r, '('); |
| 879 | Object form = read(r, true, null, true, opts, ensurePending(pendingForms)); |
| 880 | |
| 881 | PersistentVector args = PersistentVector.EMPTY; |
| 882 | PersistentTreeMap argsyms = (PersistentTreeMap) ARG_ENV.deref(); |
| 883 | ISeq rargs = argsyms.rseq(); |
| 884 | if(rargs != null) |
| 885 | { |
| 886 | int higharg = (Integer) ((Map.Entry) rargs.first()).getKey(); |
| 887 | if(higharg > 0) |
| 888 | { |
| 889 | for(int i = 1; i <= higharg; ++i) |
| 890 | { |
| 891 | Object sym = argsyms.valAt(i); |
| 892 | if(sym == null) |
| 893 | sym = garg(i); |
| 894 | args = args.cons(sym); |
| 895 | } |
| 896 | } |
| 897 | Object restsym = argsyms.valAt(-1); |
| 898 | if(restsym != null) |
| 899 | { |
| 900 | args = args.cons(Compiler._AMP_); |
| 901 | args = args.cons(restsym); |
| 902 | } |
| 903 | } |
| 904 | return RT.list(Compiler.FN, args, form); |
| 905 | } |
| 906 | finally |
| 907 | { |
| 908 | Var.popThreadBindings(); |
| 909 | } |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | static Symbol registerArg(int n){ |
nothing calls this directly
no test coverage detected