DeBot has quit [Read error: Connection reset by peer]
DeBot has joined #crystal-lang
soveran has quit [Remote host closed the connection]
maxpowa has quit [Ping timeout: 246 seconds]
maxpowa has joined #crystal-lang
unshadow_ has joined #crystal-lang
unshadow has quit [Ping timeout: 255 seconds]
marciogm has quit [Ping timeout: 255 seconds]
gloscombe has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
sz0 has quit [Quit: Connection closed for inactivity]
soveran has quit [Ping timeout: 245 seconds]
soveran has joined #crystal-lang
unshadow has joined #crystal-lang
unshadow_ has quit [Ping timeout: 276 seconds]
<FromGitter>
<drosehn> Hmm. Did the handling of NaN get sorted out? NaN is defined to be not-equal NaN, and that is not a weird decision. `0.0/0.0 == NaN`, but so does `42*0.0/0.0`. But you don't want the language to claim that `0.0/0.0 == 42*0.0/0.0`.
soveran has quit [Remote host closed the connection]
<FromGitter>
<drosehn> NaN is *not* some specific value. It's a place-holder to say "whatever this value is, the computer has no way to represent it".
<Papierkorb>
> But you don't want the language to claim that `0.0/0.0 == 42*0.0/0.0`.
<Papierkorb>
Why, I mean, that's a correct statement math-wise
<FromGitter>
<drosehn> Imagine NaRN, for "Not a Rational Number". pi and e are both "not a rational number", but that does not mean `pi == e`.
<Papierkorb>
but `pi.narn? == e.narn?` would hold true
<Papierkorb>
I get your point I think, but I also don't think there's a good solution to it
<Papierkorb>
NaN is already pretty weird in math terms
<Papierkorb>
A number that doesn't exist? huh?
<FromGitter>
<drosehn> But it has to have the behavior that it has. In that sense, it is not weird. It's the only way to make it work right.
<Papierkorb>
yes
<FromGitter>
<drosehn> I'm not completely sure I understand where the earlier discussion left off. I just wanted to point out that you really don't want one NaN to be equal to some other NaN. Not unless the language keeps track of what generated each NaN.
<FromGitter>
<MaxLap> What you need is a different equality method for hashes (ruby has #eql? for this exact purpose)
<Papierkorb>
Sounds reasonable
<FromGitter>
<drosehn> There are a few cases where this causes a problem, and offhand I can only think of one. Note that in ruby: `bb = Hash.new ; bb[0.0/0] = 1 ; bb[0.0/0*40] = 2` gives you a hash which is: `{NaN=>1, NaN=>2}`
<RX14>
adding more equality methods seems stupid personallt
<FromGitter>
<drosehn> and `bb.has_key?(0.0/0) => false`
bjz has joined #crystal-lang
<Papierkorb>
I don't have much stake in it tbh, but is it an actual problem? Adding an eql? equivalent has a cost, but is it worth it?
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<Yxhuvud>
papierkorb: no, mathwise it is an *undefined* statement.
<Papierkorb>
Yxhuvud: are they different undefineds too?
<Papierkorb>
(I guess so, but...)
<FromGitter>
<mverzilli> @drosehn I think I agree with you
<Yxhuvud>
statement doesn't make sense. undefined is undefined - there are no equality operation defined for it.
<FromGitter>
<mverzilli> @papierkorb think of algebra of limits in Math
<FromGitter>
<mverzilli> you can't claim inf == inf unless you know they "progress at the same speed"
<Yxhuvud>
I kinda dislike that Hash[] is dependent on ==, but tbh, I don't feel it is worth caring too much about it. Any performance and most clean code concerns would probably be more important. It is an edge case that isn't so cute, but still an edge case.
unshadow has quit [Ping timeout: 258 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
unshadow has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter>
<drosehn> Hmm. I'm installing the newest crystal using `brew` on MacOS, and it tells me that "autocode is not installed". And `brew` does not know about any package called `autocode`. Que pasa aqui? (<- spanish from my high school days, many many years ago. Possibly incorrect spanish.)
<FromGitter>
<drosehn> MacOS Yosemite (10.10.5), if that matters.
bjz has joined #crystal-lang
bjz has quit [Client Quit]
<FromGitter>
<mverzilli> that's good Spanish :)
<FromGitter>
<mverzilli> I'm on Sierra, but let me give it a try
<FromGitter>
<drosehn> There are only a few phrases that I remember, but we used to say that one a lot.
<FromGitter>
<mverzilli> looks to work alright on Sierra, I was going to suggest that you opened an issue, but I see you just did :)
<FromGitter>
<mverzilli> just in case, could you run `brew doctor`and paste the results here or an issue?
<FromGitter>
<drosehn> Well, actually I mentioned it in reply to a different issue.
<FromGitter>
<drosehn> ... it's in /opt/homebrew, because I didn't want `brew` to be doing anything in /usr/local (where I have some other packages).
<FromGitter>
<drosehn> I don't seem to have any file named `autocode\*` under /opt/homebrew.
<FromGitter>
<drosehn> There is a: ⏎ /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/autocode.rb ⏎ I'll see if I can do something with that.
soveran has quit [Remote host closed the connection]
<FromGitter>
<drosehn> Hmm. I think I've done something which may have fixed things. Or it may have broken them in different ways.
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
<FromGitter>
<mverzilli> that's good, or bad
<FromGitter>
<mverzilli> would you elaborate?
<FromGitter>
<drosehn> Ugh. Well, I think I'm in a mess which is mostly because brew needs to do things in a way that I don't want it to. Namely, it wants to own /usr/local, and I want to box it into /opt/homebrew. I now have autocode installed okay, but now when I go to install crystal I'm told "autocode 1.3.1 already installed". Why, *yes*, it's installed. You said you needed it installed, and I had brew install it.
marciogm has joined #crystal-lang
<FromGitter>
<drosehn> This has me unhappy, but I don't want to rant about it here.
<FromGitter>
<mverzilli> sorry about that! I'm not sure what's the right place to rant about this issue :worried:
unshadow has quit [Ping timeout: 240 seconds]
unshadow has joined #crystal-lang
<FromGitter>
<bcardiff> @drosehn i think latests versions of brew are able to work without owning /usr/local. Also you can download crystal binaries from github if you prefer other installation methods
<FromGitter>
<drosehn> Well, I don't mean "owning" as in the unix sense of `chown`. I mean they want to have total say in what goes on in that directory and all subdirectories. And I don't want `brew` to have *anything* to do with /usr/local.
<FromGitter>
<drosehn> I may have a work-around though. I'll keep experimenting for awhile.
<FromGitter>
<drosehn> I recently used `brew` to upgrade to a new version of `ripgrep`, and ran into problems there too. So I suspect I'm tripping over issues in the newer versions of `brew`, or that the fact that I'm still on yosemite is causing more and more problems as time goes on. Probably both!
<FromGitter>
<drosehn> I might have to wait until tomorrow to continue experiments. We have a snowstorm coming in very soon, and I should head home! :smile:
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 240 seconds]
<FromGitter>
<crisward> Anyone can give me some help on json builder?
<FromGitter>
<drosehn> I'm not sure I can help, but what's the problem?
<FromGitter>
<crisward> This outputs json from a model with a json mapping. However, I'm not getting any commas after each row of data.
<FromGitter>
<crisward> ok worked it out, thanks.
<FromGitter>
<drosehn> I haven't worked at that level of json. You want a comma after each `model.new(resultSet).to_json(ctx.response)`? I'd be tempted to just add that as a separate command in the innermost `do` loop. I'll guess you'd do that with `json.raw(".")`
<FromGitter>
<crisward> `model.new(resultSet).to_json(ctx.response)` should have been `model.new(resultSet).to_json(json)`
<FromGitter>
<drosehn> Hmm. did that come out as a comma or a period? I meant to type a comma.