unrepl

discussing specification of an edn-based repl and its implementations.
cgrand 2017-04-10T16:23:25.185539Z

@pesterhazy @richiardiandrea that’s what I meant by an evented reader https://gist.github.com/cgrand/d99afba8ce7ae9a13931184a58bbffc8 (not complete yet)

πŸ‘ 1
dominicm 2017-04-10T17:18:57.380900Z

@cgrand aset is for arrays. You want goog.object, aset works by coincidence.

πŸ‘ 1
cgrand 2017-04-10T17:52:50.108392Z

@dominicm source that it is frowned upon/not guaranteed to keep working?

dominicm 2017-04-10T17:54:46.151876Z

https://cljs.github.io/api/cljs.core/aset these docs. Also conversations with @anmonteiro (who can probably point at the correct source)

pesterhazy 2017-04-10T17:55:39.172158Z

yeah dnolen doesn't like aget/aset used for JS objects

thheller 2017-04-10T17:55:56.178514Z

@cgrand (:require [goog.object :as gobj]) (gobj/set obj "foo" 1)

thheller 2017-04-10T17:56:07.182573Z

it is more about the closure compiler really

pesterhazy 2017-04-10T17:56:25.189662Z

one source: https://lambdaisland.com/episodes/clojurescript-interop

thheller 2017-04-10T17:56:28.190845Z

they don't like obj["foo"] = 1

pesterhazy 2017-04-10T17:57:26.212906Z

@thheller using brackets makes the closure compiler not minify the properties, but not minifying is often exactly what you want

thheller 2017-04-10T17:58:07.227622Z

goog.object is inlined to the above as well and won't be renamed

pesterhazy 2017-04-10T17:58:08.228156Z

I think the point is more that aget/aset exists in clojure and operates on arrays, and the fact that it works for objects is an implementation detail you don't want to rely on

thheller 2017-04-10T17:58:42.241040Z

goog.object just interacts better with the closure type system

pesterhazy 2017-04-10T17:58:56.246544Z

I agree goog.object/set is the way to go

pesterhazy 2017-04-10T17:59:23.256649Z

I didn't know that there's an interaction with the closure type system

pesterhazy 2017-04-10T17:59:52.268256Z

fun fact: goog.object is automatically required so you should be able to use it without the require clause

thheller 2017-04-10T18:00:50.292662Z

I hate using the long name πŸ˜‰ ... also always require everything you use ... will only lead to issues if you dont

pesterhazy 2017-04-10T18:04:53.385922Z

yes I guess you're right

pesterhazy 2017-04-10T18:05:19.395841Z

oh I wish that gobj/get and gobj/set were part of cljs.core

pesterhazy 2017-04-10T18:05:33.400913Z

but that ship has sailed πŸ™‚

cgrand 2017-04-10T18:39:03.136398Z

Thanks all

dominicm 2017-04-10T19:00:05.593092Z

Sorry. Didn't mean to turn this into a big conversation πŸ˜› That code looks really useful.