Fork me on GitHub
#clojure
<
2016-07-17
>
adamw08:07:28

Hi, very newbie deftype question; I'm getting java.lang.ClassNotFoundException with my newly defined protocols, although I can't see why this should be. Any ideas? I've tried restarting, new repl, &c. but doesn't seem to help.

(defprotocol AreaRefs
  (select-area [ss ref]))

(deftype SpreadSheet [^Workbook wb assocs g]
  ...

  AreaRefs
  (select-area [this ref]
    (select-keys this (.getAllReferencedCells (AreaReference. ref)))))
In my repl (new, restarted):
nREPL server started on port 54200 on host 127.0.0.1 - 
Loading src/net/cgrand/spreadmap.clj... 
java.lang.ClassNotFoundException: net.cgrand.spreadmap.AreaRefs

adamw08:07:30

oh God. Never mind. I just saw an import decleration - intellij auto-added it to the top of my file (??)

martinklepsch09:07:12

How can I print something from a Clojure macro without it ending up in the resulting form?

hans09:07:40

~@(print foo)?

chbm10:07:10

i’m looking for something to persist records seamlessly a bit like mnesia but can’t really find anything

chbm10:07:17

any pointers ?

martinklepsch11:07:20

This gets me to Attempting to call unbound fn: #'clojure.core/unquote-splicing @hans

martinklepsch11:07:23

Maybe a bit more context helps: I'm essentially trying to do something like (map my-macro ...)

hans11:07:06

@martinklepsch: at that point in the code, you don't need the unquote.

martinklepsch11:07:26

@hans: I see, it seems to work fine in Clojure but when using the macro in ClojureScript the line is added to the JS. Might be just an issue of properly setting *out*

hans11:07:20

Ah, ClojureScript, I don't know anything about that.

martinklepsch11:07:00

@hans: do you have any advice regarding the compile-mult macro? or generally how I could map a macro over stuff?

chbm11:07:53

https://github.com/itmeze/toadie seems like a building block of what i was describing

mpenet16:07:23

@chbm depends on what features from mnesia you require

chbm16:07:25

don’t need distributed, just a way to persist/load a record without writing extra code

mpenet16:07:59

Carmine/redis could be decent at this

mpenet16:07:30

I think it serializes records via nippy

lvh17:07:02

What’s the recommended way to get useful error messages back when testing two or more predicates with are? I moved my assertions into a fn (with separate is exprs inside), but in the end I still get a fairly useless expected: (f x y) actual: (not (f x y))

lvh17:07:35

I guess doseq maybe?

leo.ribeiro19:07:27

Florida Restaurant Inspections API https://github.com/Code-for-Miami/restaurant-inspections-api/wiki Please send me your thoughts, suggestions and feedbacks. Feel free to colaborate! — made in clojure