jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
bjz has quit [Max SendQ exceeded]
bjz has joined #crystal-lang
onethirtyfive has quit [Read error: Connection reset by peer]
onethirtyfive has joined #crystal-lang
mkl0501 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/viYBu
<crystal-gh> crystal/master f76ac03 Ary Borenszweig: Compiler: missing replace of type parameters for virtual types. Fixes #3235
pawnbox has joined #crystal-lang
<travis-ci> crystal-lang/crystal#f76ac03 (master - Compiler: missing replace of type parameters for virtual types. Fixes #3235): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/157247349
<DeBot> https://github.com/crystal-lang/crystal/issues/3235 (Apparent regression with generic types)
pawnbox has quit [Ping timeout: 265 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
willl has quit [Quit: Connection closed for inactivity]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
<FromGitter> <ttdonovan> Does `Http::Client` follow redirection? If not would that be useful or just something the implementer should handle?
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
<FromGitter> <ttdonovan> I guess cookie management needs to also be handled outside of Http::Client
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
soveran has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<crystal-gh> [crystal] maiha opened pull request #3236: Fixed some typos in spec description (master...fix-typos) https://git.io/viYox
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
bjz has quit [Quit: Textual IRC Client: www.textualapp.com]
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
Ven_ has joined #crystal-lang
bew78 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Nik736 has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<BlaXpirit> is there any way to find out whether the current source file is the main... compilation unit?
<BlaXpirit> for example, i want to execute some code only if I run a file as 'crystal run foo.cr', but not when it's `require "./foo"`
<Yxhuvud> In ruby I'd check $0 vs __FILE__. does that work?
<BlaXpirit> Yxhuvud, that's what i'm finding in google for ruby as well. but i'm afraid it will not work well
<BlaXpirit> first of all, this is a runtime check and i would prefer a compiletime one
<BlaXpirit> 2nd, the name if the executable does not have '.cr' and may even be renamed or moved
<BlaXpirit> of*
<BlaXpirit> another thing I've been wondering - what's the best way to define constants in a class, in a way that a subclass can override them?
<BlaXpirit> https://carc.in/#/r/18d1 but working
<BlaXpirit> using class variables instead does not work because it is initialized once for each class and i don't want that
<BlaXpirit> oh look, i broke it https://carc.in/#/r/18d8
<Yxhuvud> I would have expected the 18d1 to work
soveran has quit [Remote host closed the connection]
<RX14> BlaXpirit, lol compiler segfault
tomchapi_ has joined #crystal-lang
tomchapin has quit [Ping timeout: 244 seconds]
<Papierkorb> BlaXpirit: tbh I expected your first paste to work. Open an issue for it?
<Papierkorb> expected to work in a user-sense, no idea about compiler internals
<BlaXpirit> Papierkorb, it's quite obvious why it doesnt work - because the initialize method gets "instantiated" only for the base class and has no reason to change for the subclass
dome22xl has joined #crystal-lang
dome22xl is now known as puppetpies
<puppetpies> has anyone got 0.18.7 installed ?
<puppetpies> i've currently got 0.18.6 at present and i've found something weird
<BlaXpirit> puppetpies, https://carc.in has 0.18.7 installed
<puppetpies> Each one of these returns 1 https://play.crystal-lang.org/#/r/18dd
<BlaXpirit> what's a self.initialize anyway
<puppetpies> It was just a crazy idea.
<BlaXpirit> this code makes no sense at all
<puppetpies> crystal eval 'class A; def self.initialize; @d = 1; end; def test; puts "hello #{@d}"; end; end; a = A.new; a.test'
<puppetpies> on the command line ends up with a zero instead of 1
<BlaXpirit> you didn't override the class, it mixed the methods instead. so i renamed the class to B
<BlaXpirit> puppetpies, ok that's a bug
<BlaXpirit> puppetpies, https://carc.in/#/r/18df ready to report
<puppetpies> The only difference weirdly is the end; end this correct ?
<puppetpies> i see
<BlaXpirit> puppetpies, no, like I just said, i renamed the class below to B so it's actually a different class, and not intermixing the methods of the existing A class
bew78 has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
<BlaXpirit> seems like setting instance variables behaves totally crazy inside class method
<puppetpies> i don't its anything that anyone would use anyway.
<BlaXpirit> yeah, it breaks as it's supposed to if you actually try to use such a class method. but if you just define and don't use it, it messes up other things
<puppetpies> on another note how is creating an initialize method in a struct different to creating one in a class ?
<BlaXpirit> puppetpies, well it's the same, but the difference lies just outside of the initialize method
<puppetpies> ok interesting it seems when declaring one in struct the compiler wants you to define your local variables as instance variables confused
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<BlaXpirit> puppetpies, I don't think that's the case. something else may be affecting the situation.
<puppetpies> i was using a record i don't how that affects things
<BlaXpirit> puppetpies, well probably significantly
<BlaXpirit> in my opinion, record became almost useless since crystal 0.16
<puppetpies> Well you can create your own structs anyway really i guess
<BlaXpirit> instead of writing 'struct Name; property ...' you write 'record Name, ... do' big whoop
<puppetpies> :)
<BlaXpirit> puppetpies, are you planning to report the bug you found? else i will
<Yxhuvud> well, they are redundant now that there are proper tuples
<puppetpies> You report it i find to many
<BlaXpirit> Papierkorb, oh wow, regarding the example you replied to earlier - ruby agrees with crystal :<
<Papierkorb> ... I'm surprised I never tried that in ruby
<BlaXpirit> how do ruby programmers live without that?
<Papierkorb> I never needed it but it already annoys me
<BlaXpirit> i mean what's the alternative?
<Papierkorb> def foo; FOO; end
<BlaXpirit> Papierkorb, adding that to each class that changes the value?
<Papierkorb> I didn't claim it to be nice
<Yxhuvud> well, there is always self.class::FOO
<BlaXpirit> Yxhuvud, that does not work
<BlaXpirit> :: must be preceded by a constant
<BlaXpirit> maybe you meant in ruby
<BlaXpirit> {% begin %}{{@type.id}}::FOO{% end %} works ...
<Yxhuvud> I did.
<Papierkorb> BlaXpirit: you could put that into a macro I think
<Papierkorb> and then use it like the_value = const(FOO)
<BlaXpirit> :|
<Papierkorb> Forget that, that won't help you either
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
<RX14> this is just plain weird: https://carc.in/#/r/18dq
<RX14> why on earth does an Array.new() method exist which doesn't return an array
<BlaXpirit> RX14, tilpner, it's a new addition i think. must be a typo
<RX14> it doesn't look like a typo to me
<BlaXpirit> no, nevermind. 4 Dec 2014
<RX14> yeah that need to change
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
puppetpies has quit [Quit: Leaving]
<BlaXpirit> Papierkorb, well something is 100% wrong there, pls report
<BlaXpirit> Papierkorb, actually nevermind, these are 2 different functons
<BlaXpirit> because one has yield and the other doesnt
pawnbox has joined #crystal-lang
<RX14> BlaXpirit, exactly
<crystal-gh> [crystal] asterite closed pull request #3236: Fixed some typos in spec description (master...fix-typos) https://git.io/viYox
pawnbox has quit [Ping timeout: 264 seconds]
mkl0501 has joined #crystal-lang
pawnbox has joined #crystal-lang
<travis-ci> crystal-lang/crystal#5887fd6 (master - Merge pull request #3236 from maiha/fix-typos): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/157310294
<DeBot> https://github.com/crystal-lang/crystal/pull/3236 (Fixed some typos in spec description)
Ven_ has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/viYFO
<crystal-gh> crystal/master 3d1f00f Ary Borenszweig: Use select keyword in channel select sample
<crystal-gh> crystal/master 11cf844 Ary Borenszweig: Fixed #3239: Using instance variables in class methods affects initialization
trapped has joined #crystal-lang
<travis-ci> crystal-lang/crystal#11cf844 (master - Fixed #3239: Using instance variables in class methods affects initialization): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/157314877
<DeBot> https://github.com/crystal-lang/crystal/issues/3239 (Using instance variables in class methods affects initialization)
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
soveran has quit []
<BlaXpirit> sigh, just when my program started getting reasonably complex, the screen fills with GC Warning: Finalization cycle involving 0x19126c0
<RX14> rip
<BlaXpirit> i don't think it's my fault though. yes, the work of GC is understandably difficult but what can i do?
<RX14> ignore the warnings :P
<FromGitter> <sdogruyol> @RX14 have you seen Arys comments
<RX14> @sdogruyol yes
<RX14> @sdogruyol I'll get something merged at least for 0.19.1
<RX14> i hope
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
<FromGitter> <sdogruyol> You mean a pull parser
<RX14> yeah
<RX14> probably
<RX14> better than nothing
<RX14> the callback parser will be a very thin wrapper, honestly
snsei has quit [Ping timeout: 276 seconds]
<RX14> which can easilly be implemented by kemal
kulelu88 has joined #crystal-lang
bew78 has joined #crystal-lang
<FromGitter> <sdogruyol> Well I am OK with both
<FromGitter> <sdogruyol> I am curious though what's the max file size limit 2Gb?
snsei_ has quit [Remote host closed the connection]
mkl0501 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
snsei has joined #crystal-lang
pawnbox has quit [Ping timeout: 265 seconds]
<RX14> no it's not
<RX14> it all uses UInt64
<RX14> and it's streaming anyway
bew78 has quit [Remote host closed the connection]
bmcginty has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
bmcginty has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
bew78 has joined #crystal-lang
bmcginty has quit [Ping timeout: 244 seconds]
bmcginty has joined #crystal-lang
pawnbox has joined #crystal-lang
xmgx has joined #crystal-lang
Exilor has joined #crystal-lang
Exilor has quit [Quit: Page closed]
bew78 has quit [Ping timeout: 250 seconds]
<crystal-gh> [crystal] RX14 opened pull request #3243: Add HTTP::FormData parsing and generating (master...feature/formdata-pull) https://git.io/viOJB
pawnbox has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> @RX14 the pull parser is not callback based, right?
<RX14> ...no
tomchapi_ has quit [Read error: Connection reset by peer]
tomchapin has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
xmgx has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/viOIx
<crystal-gh> crystal/master eceb2d8 Ary Borenszweig: Compiler: improve error message when guessing variable as Nil. Fixes #3232
<travis-ci> crystal-lang/crystal#eceb2d8 (master - Compiler: improve error message when guessing variable as Nil. Fixes #3232): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/157353568
<DeBot> https://github.com/crystal-lang/crystal/issues/3232 (Can't infer Nil instance variable)
globalkeith has joined #crystal-lang
globalkeith has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
<Papierkorb> Is it possible to make the compiler emit the generated code of a macro?
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
<RX14> Papierkorb, {% debug() %}
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
aldum has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/viOng
<crystal-gh> crystal/master d6da673 Ary Borenszweig: Fixed #3238: problem with generic class inheritance and new
<crystal-gh> crystal/master 824cb8e Ary Borenszweig: Compiler: fixed incorrect initialize being generated for generic subclass
<crystal-gh> crystal/master d6e0876 Ary Borenszweig: Compiler: don't incorrectly upcast to virtual type for primitive types
trapped has quit [Read error: Connection reset by peer]
<travis-ci> crystal-lang/crystal#824cb8e (master - Compiler: fixed incorrect initialize being generated for generic subclass): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/157378022