Skip to main content
added 1 character in body
Source Link
ntalbs
  • 29.6k
  • 8
  • 72
  • 86

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure:

(fn [n] #(reduce * (repeat n %)))

(fn [n] #(reduce * (repeat n %))) 

which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed clojure.lang.LispReader$FnReader.invoke (LispReader.java:628) CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) 

Why this cant be passed on repl but on 4clojure?

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure:

(fn [n] #(reduce * (repeat n %)))

which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed clojure.lang.LispReader$FnReader.invoke (LispReader.java:628) CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) 

Why this cant be passed on repl but on 4clojure?

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure:

(fn [n] #(reduce * (repeat n %))) 

which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed clojure.lang.LispReader$FnReader.invoke (LispReader.java:628) CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) 

Why this cant be passed on repl but on 4clojure?

code formatting
Source Link
Leonid Shevtsov
  • 14.3k
  • 9
  • 56
  • 86

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure:   

(fn [n] #(reduce * (repeat n %))) 

which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed
clojure.lang.LispReader$FnReader.invoke (LispReader.java:628)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

IllegalStateException Nested #()s are not allowed clojure.lang.LispReader$FnReader.invoke (LispReader.java:628) CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) 

Why this cant be passed on repl but on 4clojure?

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure:  (fn [n] #(reduce * (repeat n %))) which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed
clojure.lang.LispReader$FnReader.invoke (LispReader.java:628)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

Why this cant be passed on repl but on 4clojure?

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure: 

(fn [n] #(reduce * (repeat n %))) 

which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed clojure.lang.LispReader$FnReader.invoke (LispReader.java:628) CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) 

Why this cant be passed on repl but on 4clojure?

added 46 characters in body
Source Link
user4813927
user4813927

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure: (fn [n] #(reduce * (repeat n %))) which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed clojure
clojure.lang.LispReader$FnReader.invoke (LispReader.java:628) CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

Why this cant be passed on repl but on 4clojure?

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure: (fn [n] #(reduce * (repeat n %))) which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed clojure.lang.LispReader$FnReader.invoke (LispReader.java:628) CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)

Why this cant be passed on repl but on 4clojure?

Are nested anonymous function legal or not? I wrote the following for the problem #107 of 4clojure: (fn [n] #(reduce * (repeat n %))) which passed all the 3 tests, however when i try it with the test 3 in repl i get an IllegalStateException saying that nested #()s are not allowed:

IllegalStateException Nested #()s are not allowed
clojure.lang.LispReader$FnReader.invoke (LispReader.java:628)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:1:44)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )

clojure.lang.Util.runtimeException (Util.java:221)

Why this cant be passed on repl but on 4clojure?

Source Link
user4813927
user4813927
Loading