These are chat archives for ramda/ramda

10th
Jun 2015
David Chambers
@davidchambers
Jun 10 2015 20:59
I have to share this with some people who’ll think ugh as I did: npm/npm#8527.
Michael Hurley
@buzzdecafe
Jun 10 2015 21:00
yep.
very javascript-y
David Chambers
@davidchambers
Jun 10 2015 21:02
Brendan Eich did the same thing somewhere in the DOM API. I heard him refer to it on a podcast as automatic array promotion, I believe. It’s horrific that there’s a term for this nonsensical idea.
Michael Hurley
@buzzdecafe
Jun 10 2015 21:05
certainly of the two alternatives, it is the worse choice :smile:
Jethro Larson
@jethrolarson
Jun 10 2015 21:23
@paldepind not much into comments are ya? :)
Raine Virta
@raine
Jun 10 2015 21:24
have you had any thoughts about ramda-ext type of project that would host useful functions but ones that are not fit for ramda core?
Michael Hurley
@buzzdecafe
Jun 10 2015 21:24
sounds good to me. maybe ramda-contrib?
Jethro Larson
@jethrolarson
Jun 10 2015 21:29
could be a good idea just to have an obvious place to put functions that are underutilized as ramda evolves
Simon Friis Vindum
@paldepind
Jun 10 2015 21:29
@jethrolarson I suppose that is a joke? ;)
Nor really a joke
Simon Friis Vindum
@paldepind
Jun 10 2015 21:32
Ahh. Comments in code. I like them when they make sense. What do you think needs commenting?
Jethro Larson
@jethrolarson
Jun 10 2015 21:33
createRmCb looks like alphabet soup to me
patchVnode - I'm not sure what patching a node would be
Simon Friis Vindum
@paldepind
Jun 10 2015 21:37
Create remove callback? Standard shortening to me.
Raine Virta
@raine
Jun 10 2015 21:38
anyone wanna go ahead and start an official ramda-contrib project?
Simon Friis Vindum
@paldepind
Jun 10 2015 21:38
The functions takes an old and a new vnode and is named patch?
Hardy Jones
@joneshf
Jun 10 2015 21:38
@davidchambers isn't that just normal js stuff for arrays?
David Chambers
@davidchambers
Jun 10 2015 21:39
I think it’s a good idea, @raine. I believe you have the necessary permissions to create the repository.
Hardy Jones
@joneshf
Jun 10 2015 21:39
Or wait, it does [1,2,3].toString() === "1,2,3"
David Chambers
@davidchambers
Jun 10 2015 21:40

One version:

1.0.0

Multiple versions:

['1.0.0', '1.0.1']
Jethro Larson
@jethrolarson
Jun 10 2015 21:41
invokeDestroyHook could be a cool bandname
David Chambers
@davidchambers
Jun 10 2015 21:41
What I really want is newline-separated output, since I’m writing a shell script. I had been doing $(node --print "$(jitsu view "$name" versions).join(' ')") but 1.0.0 is not even syntactically valid JavaScript.
Jethro Larson
@jethrolarson
Jun 10 2015 21:42
I'm okay with shortening things but pain english version should be nearby in that case
Hardy Jones
@joneshf
Jun 10 2015 21:42

@paldepind question about this: https://github.com/paldepind/snabbdom/blob/master/snabbdom.js#L33

Isn't that just checking for listeners === 1?

@davidchambers yeah tht's pretty much awful.
@davidchambers can it output json?
David Chambers
@davidchambers
Jun 10 2015 21:48
I don’t think so. My current approach is to strip everything that’s not a digit or a period to get the newline-separated value I’m after: sed "s:[^0-9.]::g".
The JavaScript language is far from perfect, but it can be used responsibly. The wider JavaScript community, on the other hand… >.<
Hardy Jones
@joneshf
Jun 10 2015 21:50
is that the only place it's fudged up?
meaning, it only has a special case for single version
what if there are no versions?
David Chambers
@davidchambers
Jun 10 2015 21:52
Oh, you’re right: there is a --json option!
OUTPUT
       If only a single string field for a single version is output, then it will not be colorized or quoted, so as to  enable
       piping the output to another command. If the field is an object, it will be output as a JavaScript object literal.

       If the --json flag is given, the outputted fields will be JSON.
(I don’t think it’s possible for a package to have no versions.)
Hardy Jones
@joneshf
Jun 10 2015 21:54
unfortunately, it's a json string
rather than being a json singleton array
David Chambers
@davidchambers
Jun 10 2015 21:54
OMG, you’re right! This infection is insidious!
Final solution:
for version in $(jitsu view "$name" versions | sed "s:[^0-9.]::g") ; do
  # ...
done
David Chambers
@davidchambers
Jun 10 2015 22:04
Indeed! (Aside: npm’s source code makes me queasy. Mutation everywhere.)
Michael Hurley
@buzzdecafe
Jun 10 2015 22:29
:laughing: they are deliberately taking it out of the Array! hilarious
Scott Sauyet
@CrossEye
Jun 10 2015 23:55
@davidchambers: Too funny!
@raine: Go ahead and start one. We'll figure it out as we go.