nathell / skyscraper

Structural scraping for the rest of us.
410 stars 10 forks source link

Included examples no longer work #13

Closed thachmai closed 4 years ago

thachmai commented 6 years ago

When trying to execute the examples, I got this error

Exception in thread "main" java.lang.RuntimeException: Map literal must contain an eve
n number of forms, compiling:(/home/thach/dev/scrap/scrap.clj:41:1)                                                                      
        at clojure.lang.Compiler.load(Compiler.java:7526)                                                                                
        at clojure.lang.Compiler.loadFile(Compiler.java:7452)                                                                            
        at clojure.main$load_script.invokeStatic(main.clj:278)                                                                           
        at clojure.main$load_script.invoke(main.clj:271)                                                                                 
        at user$eval154.invokeStatic(form-init5477053886928775839.clj:1)                                                                 
        at user$eval154.invoke(form-init5477053886928775839.clj:1)                                                                       
        at clojure.lang.Compiler.eval(Compiler.java:7062)           
        at clojure.lang.Compiler.eval(Compiler.java:7052)                 
        at clojure.lang.Compiler.load(Compiler.java:7514)                   
        at clojure.lang.Compiler.loadFile(Compiler.java:7452)       
        at clojure.main$load_script.invokeStatic(main.clj:278)      
        at clojure.main$init_opt.invokeStatic(main.clj:280)         
        at clojure.main$init_opt.invoke(main.clj:280)               
        at clojure.main$initialize.invokeStatic(main.clj:311)       
        at clojure.main$null_opt.invokeStatic(main.clj:345)         
        at clojure.main$null_opt.invoke(main.clj:342)               
        at clojure.main$main.invokeStatic(main.clj:424)             
        at clojure.main$main.doInvoke(main.clj:387)                 
        at clojure.lang.RestFn.applyTo(RestFn.java:137)             
        at clojure.lang.Var.applyTo(Var.java:702)                   
        at clojure.main.main(main.java:37)                          
Caused by: java.lang.RuntimeException: Map literal must contain an even number of forms

I'm not yet experienced enough to spot what changes provoked the error but if possible I'll provide a PR to fix

tirkarthi commented 6 years ago

I think it's due to the fact one of the map literal has odd number of forms as from below :

➜  ~ clj
Clojure 1.9.0
user=> {:a 1}
{:a 1}
user=> {:a 1 :b}
RuntimeException Map literal must contain an even number of forms  clojure.lang.Util.runtimeException (Util.java:221)
nathell commented 4 years ago

The included examples have been rewritten and should work as of Skyscraper 0.3.0.