<crystal-gh>
[crystal] 5t111111 opened pull request #1410: Add a code example to the doc for type rescrictions (gh-pages...add-code-example) http://git.io/vZtaA
tatey_ has joined #crystal-lang
<nakilon>
how do I do puts some_object.method(:some_method).source_location in Crystal?
watsy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fowlduck has joined #crystal-lang
watsy has joined #crystal-lang
<nakilon>
omg, Crystal creates ./.crystal folders ..( is it when I call with --release?
waj_ has joined #crystal-lang
Ven has joined #crystal-lang
waj_ has quit [Ping timeout: 244 seconds]
ylluminate has joined #crystal-lang
watsy has quit [Ping timeout: 255 seconds]
tatey_ has joined #crystal-lang
<jhass>
nakilon: no always. You can set a central location with CRYSTAL_CACHE_DIR
<jhass>
I have some hope that throw/catch is not going to happen
<jhass>
Float64#inspect should probably append a .0
BlaXpirit has joined #crystal-lang
<nakilon>
I don't like wraping piece of code in an additional function (that would need dealing with scopes, argument passing) just because "let's pretend that breaking through more than one loop stack is impossible or never needed by noone just because I didn't need it during last three days"
<nakilon>
yes, it's nice that "everything is an object" returns some value from the loop that we can check, but it looks not much better than catch/throw block
rob_ has left #crystal-lang [#crystal-lang]
<nakilon>
[10:32:08] <jhass> nakilon: no always. You can set a central location with CRYSTAL_CACHE_DIR
<crystal-gh>
[crystal] jhass pushed 3 new commits to master: http://git.io/vZqGF
<crystal-gh>
crystal/master cafe91e Will Leinweber: Benchmark::IPS report relative stddev instead
<crystal-gh>
crystal/master cafe3be Will Leinweber: Benchmark::IPS use SI suffix for often large means
<crystal-gh>
crystal/master 3ffd898 Jonne Haß: Merge pull request #1405 from will/benchmark-ips-formatting...
<crystal-gh>
[crystal] jhass closed pull request #1410: Add a code example to the doc for type rescrictions (gh-pages...add-code-example) http://git.io/vZtaA
<crystal-gh>
[crystal] MakeNowJust opened pull request #1414: Fix file name command ambiguity (master...file-name-command-ambiguity) http://git.io/vZqhy
dyulax has quit [Quit: This computer has gone to sleep]
dyulax has joined #crystal-lang
dyulax has quit [Client Quit]
Maksatbek has joined #crystal-lang
oleh has quit [Quit: Lost terminal]
oleh has joined #crystal-lang
<oleh>
I start learn Crystal, and can't use 'rand' function, I wrote something like: require "random"; n = Random.rand(5); , but compiler gives error: undefined constant Random. What am I doing wrong?
<vegai>
seems to work here
<vegai>
>> require "random"; n = Random.rand(5); puts n;
<Papierkorb>
tbh I really enjoy the expect() stuff. It also makes mocking the same as any other expectation. also generates code that's actually "readable" in terms of being almost human language
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: http://git.io/vZO0l
<crystal-gh>
crystal/master 9be9778 Ary Borenszweig: Fixed a bug where a type wasn't correctly found in a macro def
<crystal-gh>
crystal/master 1174565 Ary Borenszweig: Expand array literals to `Array.build(capacity) { |buffer| .. }` so we can make `length=` protected
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<BlaXpirit>
in my opinion, minitest is a big step behind
<BlaXpirit>
Papierkorb, i guess you would also like to write a.equals b instead of a == b in normal code :|
<Papierkorb>
BlaXpirit: No.
<slash_nick>
BlaXpirit: i didn't much like minitest's mocks at first... i'm pretty indifferent now though
<Papierkorb>
BlaXpirit: That "foo".equals(bar) stuff Java does is horrific and a language defect to me
<BlaXpirit>
Papierkorb, well that's what RSpec is all about, as well
BitPuffin has quit [Ping timeout: 244 seconds]
<BlaXpirit>
they had to invent a domain-specific language because there was no other way
<BlaXpirit>
but willingly embracing it when there are better alternatives?
qard has quit [Ping timeout: 264 seconds]
qard has joined #crystal-lang
elbow_jason has quit [Remote host closed the connection]
<Kilo`byte>
so apparently compiling crystal takes > 2 gig of ram
<Kilo`byte>
because the compile died with "Cannot allocate memory" during compiling itself
<Kilo`byte>
on a 2 gig bo
<Kilo`byte>
x
<jhass>
yeah :/
<jhass>
it's in the llvm codegen phase from my checks, so not sure we can do much about it :/
<Kilo`byte>
meh
<Kilo`byte>
added 5 gig of swap to the mix
shadeslayer has quit [Ping timeout: 250 seconds]
<adam12>
heh
dfockler has quit [Remote host closed the connection]
shadeslayer has joined #crystal-lang
qard has joined #crystal-lang
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 264 seconds]
trapped has quit [Read error: Connection reset by peer]
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 240 seconds]
dfockler has joined #crystal-lang
jmg_ has joined #crystal-lang
jmg_ has quit [Client Quit]
jmg_ has joined #crystal-lang
leafybasil has joined #crystal-lang
<asterite>
jhass: I have a commit that removes "length" and "count" in favor of "size"
<asterite>
waj already agreed. If you too, I'll push it
<asterite>
We expect this to break every code in existence, but the fix should be pretty simple
<asterite>
And the sooner we do this, the better
<jhass>
sure
<jhass>
do you also rename instance variables and such?
<asterite>
Yes, except in String because that's hardcoded in the compiler. For this we'll have to make an intermediate release
<asterite>
I also keep the "length" macro method for now because otherwise the current code stops compiling. But we can remove it in that intermediate release too
<asterite>
And unfortunately we can't the "Content-length" header to "Content-size"
<asterite>
* can't change
<jhass>
heh, yeah
<jhass>
but HTTP is broken anyway, I mean "Referer" ;)
<asterite>
:)
<dyulax>
hahaha
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vZ3Bd
<crystal-gh>
crystal/master baf1855 Ary Borenszweig: Fixed #1363: removed `length` and `count` (without block) methods in favor of a single `size` method.
Ven has joined #crystal-lang
dyulax93 has joined #crystal-lang
endou_ has joined #crystal-lang
jhass|off has joined #crystal-lang
jhass has quit [Excess Flood]
endou has quit [Read error: Connection reset by peer]
jhass|off is now known as jhass
emmanueloga has quit [Ping timeout: 252 seconds]
dyulax has quit [Ping timeout: 252 seconds]
emmanueloga has joined #crystal-lang
<jmg_>
Might be approaching this from the wrong angle- Trying to get the JSON response into one of two classes for later processing http://play.crystal-lang.org/#/r/eem
<travis-ci>
manastech/crystal#baf1855 (master - Fixed #1363: removed `length` and `count` (without block) methods in favor of a single `size` method.): The build passed. https://travis-ci.org/manastech/crystal/builds/79361482
<jhass>
mmh, it shouldn't segfault
<jhass>
asterite: ^
nakilon has joined #crystal-lang
<jhass>
jmg_: but it won't work that way anyway. Don't you have a response code on which you can decide?
<jmg_>
jhass: In this particular case I do; however, I'm curious if there is a way of handling this if there wasn't one.
<jhass>
JSON.parse and guessing with .is_a?'s
<jhass>
then reparsing into the mappings
<jmg_>
Hmm, ok. Any thoughts on implementing a 'from_json?' that throws a nil instead of an exception?
<asterite>
But we'll probably remove the ability to invoke methods on union classes, so that will stop compiling
<asterite>
I think that "feature" was a mistake
<jhass>
:/
<jhass>
stuff like to_s and .inspect is certainly useful
vikaton has quit [Quit: Connection closed for inactivity]
<jhass>
I also very much like being able to sort of compose without having to introduce common ancestors
<asterite>
Oh, that'll work because a union class extends from Class... somehow
<asterite>
it's just that you won't be able to invoke, say, `zero` on the class (Int32 | Int64)
<jhass>
which is finicky to deal with anyway
<jhass>
having to cast stuff so you can pass to things expecting the superclass, the covariance stuff and all that madness
<jhass>
would really hate to see that go
<jhass>
I don't quite follow why it's so much of a trouble, isn't it just building a small runtime dispatch and packing the return value into the union again?
tomchapin has joined #crystal-lang
<BlaXpirit>
asterite, i hope you mean disabling only class methods, not instance methods
<jhass>
oh wait, or am I confusing that with invoking stuff on an instance of a union vs the union itself right now, sigh
<BlaXpirit>
jhass, probably. but it tripped me up as well
<jhass>
yeah, I'm still tired I guess m(
<BlaXpirit>
doing this to instance methods would instantly make the language garbage
<BlaXpirit>
>> (Int32 | Int64).zero
<DeBot>
BlaXpirit: Error in line 4: undefined method '|' for Int32:Class - http://carc.in/#/r/eex
<BlaXpirit>
oh yeah, this change totally makes sense
<BlaXpirit>
>> a = true ? 5i32 : 3i64; typeof(a).zero.class
<jhass>
and we want to reduce if not completely drop aliases
<jhass>
that'll always make somebody unhappy, but in the end it's better than having the community fighting about which one to use
<avdi>
By habit I go for #size in ruby, but I tend to agree that it's a more ambiguous word. Then again, I'm a fan of ambiguity in some contexts.
<jhass>
the "just use what you prefer" doesn't work :P
<avdi>
But I gotta say I *love* the aliases in Ruby. I think that's one of the things that makes the language special.
<avdi>
jhass: doesn't work in what sense?
<jhass>
I mean people will fight over it when both exist
<jhass>
they won't just let the other side have the other opinion :P
<avdi>
People will always fight. You can't stop that.
<avdi>
I've the Ruby community to be quite accepting of differing styles, by and large.
<BlaXpirit>
jhass, u got 110% there btw
<jhass>
yeah, but reduce the pointless ones by just removing them
<BlaXpirit>
i would definitely keep only length
<jhass>
and change to bytelength ?
<jhass>
idk, it's pointless really, we went with size, deal with it IMO
<BlaXpirit>
eh the fact that "bytesize" is the common name for byte size makes me reconsider
<jhass>
I'd made a sadface if it had become length and moved on
<avdi>
jhass: a gentle nudge - saying something is "pointless" can be very antagonizing because it suggests other people's opinions have no merit at all.
<jhass>
sorry if it came across that way. I'm saying my own opinion about it is as pointless as anybody else's
blue_deref has joined #crystal-lang
<jhass>
it's personal preference, everybody has their own. We want to get rid of the aliases so we have to pick one. size got the majority and any other discussion about it is IMO pointless
<avdi>
jhass: sure :-) I just noticed you said it twice in a row to two different people, and sometimes these things come across differently than intended.
<avdi>
jhass: somewhere there's probable someone who thinks that discussing it more is important, and not pointless at all. It sounds like what you mean is that it has been settled, and more discussion won't change it - is that accurate?
waj has quit [Read error: Connection reset by peer]
waj_ has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
dfockler has quit [Remote host closed the connection]
NeverDie has joined #crystal-lang
dfockler has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dfockler has quit [Ping timeout: 255 seconds]
fowlduck has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
fowlduck has joined #crystal-lang
dylanmei has joined #crystal-lang
vegai has quit [Ping timeout: 246 seconds]
blue_deref has quit [Quit: Taking myself out of hear.]
vegai has joined #crystal-lang
havenwood has quit [Ping timeout: 265 seconds]
trapped has joined #crystal-lang
waj_ has quit [Ping timeout: 240 seconds]
<crystal-gh>
[crystal] will opened pull request #1421: Benchmark::IPS bugfix and better comparison alignment (master...benchmark-ips-formatting-2) http://git.io/vZsIV
waj has joined #crystal-lang
waj has quit [Remote host closed the connection]
waj has joined #crystal-lang
waj_ has joined #crystal-lang
waj has quit [Read error: Connection reset by peer]