MCPcopy Index your code
hub / github.com/clojure/clojure / invoke

Method invoke

src/jvm/clojure/lang/LispReader.java:870–910  ·  view source on GitHub ↗
(Object reader, Object lparen, Object opts, Object pendingForms)

Source from the content-addressed store, hash-verified

868
869public 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
913static Symbol registerArg(int n){

Callers

nothing calls this directly

Calls 14

pushThreadBindingsMethod · 0.95
mapMethod · 0.95
rseqMethod · 0.95
firstMethod · 0.95
valAtMethod · 0.95
consMethod · 0.95
listMethod · 0.95
popThreadBindingsMethod · 0.95
ensurePendingMethod · 0.80
gargMethod · 0.80
derefMethod · 0.65
unreadMethod · 0.45

Tested by

no test coverage detected