Fork me on GitHub
#beginners
<
2015-08-24
>
jeffh-fp17:08:58

I’m running Cursive (latest beta) in IntelliJ 14.1, running a local REPL (nREPL) — how do I get the REPL to recompile my code (without launching an entirely new REPL)? I tried (use ‘mynamespace) again but that doesn’t reload it

potetm17:08:22

@jeffh-fp: Tools -> REPL -> (Load file/Sync files) in REPL

potetm17:08:50

You can also set up a keymap for that.

jeffh-fp17:08:27

that works great — yea a shortcut will be necessary

bmay18:08:32

why does (assoc (hash-map) 1 1000) return a PersistentArrayMap and not PersistentHashMap?

jeffh-fp18:08:54

@potetm: looks like there are Cursive and Emacs keybinding default sets that I just hadn’t loaded

potetm18:08:10

@bmay: That’s a really good question. From the best I can gather, the evaluation of an empty expression (one with a fn but no args) is somewhat different from the evaluation of expressions with args. The return value for an empty hash-map expression (or empty {} expression) seems to be a static final PersistentArrayMap.

potetm18:08:22

I don’t have any real knowledge about the clojure compiler/parser though. This may be a better question for the #C03S1KBA2 channel.

Alex Miller (Clojure team)19:08:21

@bmay: array maps and hash maps are two different implementations of persistent maps. array maps are generally used for maps with <= 8 entries and then auto-promote to a hash map when they get bigger.

Alex Miller (Clojure team)19:08:38

array maps store entries in a single array and use linear searches rather than in the tree structure used by hash map