Fork me on GitHub
#cljs-dev
<
2019-09-12
>
dnolen16:09:35

Had a couple of hours of uninterrupted hacking in Berlin

dnolen16:09:54

type inference of Closure return values works

dnolen16:09:24

arity checking, REPL affordances - (i.e. doc strings) also works

parens 56
mfikes17:09:54

That’s awesome

cljs.user=> (require '[goog.string :as gstr])
nil
cljs.user=> (dir gstr)
...
unescapeEntities
unescapeEntitiesWithDocument
urlDecode
urlEncode
whitespaceEscape
nil
cljs.user=> (doc gstr/trim)
-------------------------
goog.string/trim
([str])
  /**
 * Trims white spaces to the left and right of a string.
 * @param {string} str The string to trim.
 * @return {string} A trimmed copy of {@code str}.
 */

nil
cljs.user=> (gstr/trim "a " "b ")
WARNING: Wrong number of args (2) passed to goog.string/trim at line 1 <cljs repl>
"a"
cljs.user=> (+ (gstr/trim "a ") 3)
WARNING: cljs.core/+, all arguments must be numbers, got [string number] instead at line 1 <cljs repl>
"a3"

parrot 32
👍 4
🆒 4
mfikes17:09:09

For reference, the currently shipping behavior:

cljs.user=> (require '[goog.string :as gstr])
nil
cljs.user=> (dir gstr)
nil
cljs.user=> (doc gstr/trim)
-------------------------
goog.string/trim
  nil

nil
cljs.user=> (gstr/trim "a " "b ")
"a"
cljs.user=> (+ (gstr/trim "a ") 1)
"a1"