Fork me on GitHub
#hoplon
<
2017-04-14
>
micha15:04:46

@onetom unfortunately weakmaps are not that useful as far as I can tell

micha15:04:12

weakmap implementation is equivalent to just adding a property to the key object

micha15:04:42

what we really need are weak references, which appears to be something the browser devs are unwilling to allow to happen

micha15:04:18

you really need weak references to make certain kinds of data structures work well with GC

onetom16:04:25

that's a pity. it sounded like the key in the weakmap itself is a weak reference

alandipert16:04:07

it might happen in the future tho

alandipert16:04:18

there is a massive thread on es-discuss about it that fires up from time to time

alandipert16:04:38

the reasons against are technically interesting, related to security and a technique called jit spraying

micha17:04:27

@onetom you could say the idea of the weakmap is itself a weak one 🙂

micha17:04:04

the idea is that the value can be garbage collected whenever the key can be garbage collected

micha17:04:22

but this is not so useful, because it means that you must not keep references to the keys in the map

micha17:04:47

without references to the keys in the map you cannot do things like enumerate the keys of the map

micha17:04:52

or iterate over them

micha17:04:23

given a key object, the weakmap returns the associated value

micha17:04:40

function new_weak_map() { return uuid.generate(); }
function assoc(weakmap, k, v) { k[weakmap] = v; }
function get(weakmap, k) { return k[weakmap]; }

micha17:04:02

that's what it all boils down to, unfortunately

bocaj23:04:08

I'm trying to get .bootignore to work on windows 10. I'm editing in emacs

bocaj23:04:26

# emacs
#.bootignore controls construction of the initial boot-fileset. Files matching the regexes in .bootignore will be excluded. For example, to ignore emacs backup files, .bootignore should contain
.*~$.
# To ignore transient emacs files, add
^\.#
#and
/\.#.

bocaj23:04:52

Writing adzerk\boot_reload.cljs to connect to ...
Writing main.cljs.edn...
Compiling ClojureScript...
ò main.js
No such namespace: modern-cljs..#core, could not locate modern_cljs//_SHARP_core.cljs, modern_cljs//_SHARP_core.cljc, o
 Closure namespace "modern-cljs..#core" in file boot\cljs\main489.cljs
Elapsed time: 0.170 sec

bocaj23:04:29

and clearly that's not meant for boot-reload