jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.15.0 | 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
Philpax has joined #crystal-lang
broz has quit [Remote host closed the connection]
broz has joined #crystal-lang
broz has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rolha has joined #crystal-lang
rolha has quit [Client Quit]
x0f_ has joined #crystal-lang
x0f has quit [Read error: Connection reset by peer]
Philpax has quit [Ping timeout: 250 seconds]
zeno_ has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
zeno has joined #crystal-lang
zeno is now known as Guest23295
Guest23295 has quit [Quit: 离开]
Philpax has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
Philpax has quit [Ping timeout: 250 seconds]
Philpax has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
pawnbox has quit [Ping timeout: 268 seconds]
pawnbox has joined #crystal-lang
broz has joined #crystal-lang
Philpax has quit [Ping timeout: 250 seconds]
soveran has joined #crystal-lang
Philpax has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
swav has quit [Ping timeout: 250 seconds]
ssvb_ has quit [Ping timeout: 244 seconds]
matp has quit [Ping timeout: 260 seconds]
swav has joined #crystal-lang
ssvb_ has joined #crystal-lang
matp has joined #crystal-lang
<nwmcsween> how can you define an unnamed macro that takes a splat?
matp has quit [Ping timeout: 240 seconds]
<nwmcsween> I have to keep an the enum members in sync with struct members as you cannot eval in crystal to set an instance variable based on the the value of a variable
matp has joined #crystal-lang
<nwmcsween> e.g enum bar a b c end class foo def initialize @bar.names.each {|x| @x} end end
<nwmcsween> so to work around this one has do: enum bar a b c end struct Sbar a b c end class foo def initialize @sbar = Sbar.new end end
<nwmcsween> I think
<nwmcsween> I wish there was an easy way to create a variable indirectly
broz has quit [Remote host closed the connection]
nwmcsween_ has joined #crystal-lang
nwmcsween has quit [Ping timeout: 276 seconds]
soveran_ has joined #crystal-lang
soveran_ is now known as soveran
soveran has quit [Changing host]
soveran has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
trapped has joined #crystal-lang
Ven has joined #crystal-lang
TheLemonMan has joined #crystal-lang
<jhass> nwmcsween_: I don't follow at all what you're trying to do
dsounded has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
havenwood has quit [Ping timeout: 250 seconds]
justinmcp has joined #crystal-lang
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
havenwood has joined #crystal-lang
dsounded has quit [Read error: Connection reset by peer]
trapped has quit [Read error: Connection reset by peer]
pawnbox has quit [Remote host closed the connection]
dsounded has joined #crystal-lang
pawnbox has joined #crystal-lang
mark_66 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
dsounded has quit [Remote host closed the connection]
rok has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zeno has joined #crystal-lang
zeno has quit [Client Quit]
Guest12177 has joined #crystal-lang
Guest12177 is now known as zeno_
<zeno_> https://play.crystal-lang.org/#/r/x49 Crystal's error message sometimes is not friendly
soveran has quit [Remote host closed the connection]
dsounded has joined #crystal-lang
<BlaXpirit> >> class C; @c : Int32 = 3; end # wtf
<DeBot> BlaXpirit: Syntax error in eval:21: unexpected token: = - https://carc.in/#/r/x4g
dsounded has quit [Remote host closed the connection]
dsounded has joined #crystal-lang
<BlaXpirit> also you know what? crystal 0.15 sucks
<BlaXpirit> not being able to use generics for type annotations is so lame
<BlaXpirit> and by 0.15 i mean 0.16
<BlaXpirit> Int32 everywhere, ZOMG
<BlaXpirit> Can't infer the type of global variable ...
Ven has joined #crystal-lang
<BlaXpirit> is this real? do I have to write $font : SF::Font; $font = SF::Font.from_file("resources/font/Ubuntu-R.ttf")
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
<TheLemonMan> as if using global state is a good thing
<BlaXpirit> TheLemonMan, don't demonize it without reason
<BlaXpirit> a font and a texture are indeed global resources
<BlaXpirit> wrapping it in a silly class doesnt make anything better
<TheLemonMan> see, it's not crystal that sucks, it's what you want to do with it :)
<BlaXpirit> i see, no point reasoning with you
<TheLemonMan> there's a recent commit that deals with inferring types from globals
<BlaXpirit> i'm on latest. it's a collection of workarounds more than anything else
<BlaXpirit> calling .new is specialcased but a method that 100% returns a particular type is not good enough
<TheLemonMan> are you 100% that the type inferred for from_file is just Font ?
<BlaXpirit> TheLemonMan, yes
<BlaXpirit> even added annotation like def self.from_file(a : String) : Font
<TheLemonMan> if it does work with local variables then there might be some constraint that's not satisfied (or a bug)
<BlaXpirit> TheLemonMan, check this out https://bpaste.net/show/d556c2442b9d
<BlaXpirit> a collection of 7 workarounds, as I was saying
<BlaXpirit> there has to be a reason why this can't be the same as instance variables deduction but i'm not even close to getting it
Ven has quit [Ping timeout: 276 seconds]
<TheLemonMan> you have to be extra careful when doing flow analisys of global (or exported) data
dsounded has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
dsounded has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
pawnbox has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
dsounded has quit [Read error: Connection reset by peer]
dsounded has joined #crystal-lang
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 1 new commit to master: https://git.io/vwZux
<crystal-gh> crystal/master 1493690 Jonne Haß: Fix typo in semantic/exception.cr: begin -> being
dsounded_ has joined #crystal-lang
dsounded has quit [Read error: Connection reset by peer]
matp has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#1493690 (master - Fix typo in semantic/exception.cr: begin -> being): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/124430523
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 276 seconds]
Ven has joined #crystal-lang
dsounded_ has quit [Read error: Connection reset by peer]
dsounded has joined #crystal-lang
dsounded has quit [Read error: Connection reset by peer]
dsounded has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rok has quit [Quit: rok]
Ven has joined #crystal-lang
dsounded has quit [Remote host closed the connection]
Raimondi has quit [Quit: The road to wisdom?—Well, it's plain and simple to express: Err and err and err again, but less and less and less. — Piet Hein]
dsounded has joined #crystal-lang
Raimondi has joined #crystal-lang
trapped has joined #crystal-lang
dsounded has quit [Read error: Connection reset by peer]
dsounded has joined #crystal-lang
ponga has joined #crystal-lang
matp has joined #crystal-lang
dsounded has quit [Read error: Connection reset by peer]
dsounded has joined #crystal-lang
matp has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
dsounded has quit [Read error: Connection reset by peer]
dsounded has joined #crystal-lang
soveran has quit [Remote host closed the connection]
zeno_ has quit [Ping timeout: 250 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dsounded has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
dsounded has joined #crystal-lang
matp has joined #crystal-lang
rok has joined #crystal-lang
dsounded_ has joined #crystal-lang
dsounded has quit [Read error: Connection reset by peer]
dsounded_ has quit [Read error: Connection reset by peer]
trapped_ has joined #crystal-lang
dsounded has joined #crystal-lang
g3funk has quit [Excess Flood]
trapped has quit [Ping timeout: 250 seconds]
g3funk has joined #crystal-lang
zeno_ has joined #crystal-lang
dsounded has quit [Ping timeout: 260 seconds]
broz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
dsounded has joined #crystal-lang
dsounded has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
broz has quit [Remote host closed the connection]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
broz has joined #crystal-lang
shawn42 has quit [Quit: Connection closed for inactivity]
shawn42 has joined #crystal-lang
<zeno_> As long as use recursion, the error message would be troublesome
dsounded has joined #crystal-lang
<zeno_> Unfriendly error messages with strict type inspection makes me crazy
rok has quit [Quit: rok]
dsounded has quit [Read error: Connection reset by peer]
Philpax has quit [Ping timeout: 250 seconds]
dsounded has joined #crystal-lang
dsounded has quit [Read error: Connection reset by peer]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kfpratt has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 260 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
pawnbox has joined #crystal-lang
ponga has quit [Quit: Connection closed for inactivity]
rok has joined #crystal-lang
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
trapped_ is now known as trapped
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
kfpratt has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vwn6j
<crystal-gh> crystal/master 541a01a Ary Borenszweig: Compiler: don't error if we the temporary file for execution can't be deleted
kfpratt has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#541a01a (master - Compiler: don't error if we the temporary file for execution can't be deleted): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/124527872
<crystal-gh> [crystal] asterite opened pull request #2486: Guess types from `T.method`, if `T.method` has a return type annotation (master...feature/more_inference) https://git.io/vwn1K
<asterite> BlaXpirit: I hope with this a lot of "suffering" will be gone. I personally would like to see that merged, but we'll see
<asterite> After all, if we can reduce the amount of redundant type annotations, I think it's better
mark_66 has quit [Remote host closed the connection]
<BlaXpirit> woo thanks
<BlaXpirit> no need to write an issue now :D
<BlaXpirit> asterite, but I don't understand why you can't just take the type of an expression and apply it
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
kfpratt has joined #crystal-lang
kfpratt has quit [Read error: Connection reset by peer]
<asterite> BlaXpirit: because in the general case to type an expression you might need to know the type of some instance variable... which is what we are trying to figure out in the first place. So the rule is: we can add as many rules as we want, but they can't depend on knowing the type of global/class/instance vars
<BlaXpirit> asterite, ok, then how about instead of all those special cases you just take the type of the expression if it doesn't depend on the type of some instance variale
<asterite> BlaXpirit: for example?
<BlaXpirit> asterite, for example, $a = function_that_calls_a_function_that_has_a_type_annotation()
<asterite> That could work too, I guess. But how frequent is that?
<BlaXpirit> asterite, my point isn't to add another rule for this case but to make it general
kfpratt has joined #crystal-lang
_kfpratt has joined #crystal-lang
<asterite> I see. It probably makes the rule easier to understand. But, again, I don't know how frequent that's going to be, but if you have several use cases of this we can make it
<BlaXpirit> oh they're gonna crop up for sure
<BlaXpirit> this is about consistency
<BlaXpirit> you said yourself that adding more and more rules is confusing
<asterite> But `function_that_calls_a_function_that_has_a_type_annotation` will have to be a top-level method. Otherwise it must be `T.method`, which is probably more likely
<asterite> In any case, we can add the rule later, after checking that this proposal is good :)
<BlaXpirit> asterite, I'm not saying to add this rule.......
<asterite> I know, just changing its semantic. But I'll have to write code to make it work :)
<asterite> (unless I'm misunderstanding something)
<BlaXpirit> like in normal code, normal variable assignment, you have a way to find out the type of an expression
<BlaXpirit> make it the same there
kfpratt has quit [Ping timeout: 250 seconds]
TheLemonMan 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 [Ping timeout: 244 seconds]
mjblack is now known as mjblack|afk
<travis-ci> azukiapp/crystal#b6bec27 (daemonize2 - Changed default dir to “/“ and added documentation.): The build failed. https://travis-ci.org/azukiapp/crystal/builds/124578283
_kfpratt has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
Raimondi has quit [Quit: The road to wisdom?—Well, it's plain and simple to express: Err and err and err again, but less and less and less. — Piet Hein]
<jhass> asterite: https://carc.in/#/r/x59 is recursing endlessly on HEAD, too. Bug?
mjblack|afk is now known as mjblack
Raimondi has joined #crystal-lang
<travis-ci> azukiapp/crystal#7517137 (daemonize2 - Adding docker version output): The build is still failing. https://travis-ci.org/azukiapp/crystal/builds/124583223
g3funk is now known as braidn
<jhass> asterite: also what about this one? https://carc.in/#/r/x5a
<jhass> well, probably the same cause
<jhass> asterite: since this one works... https://carc.in/#/r/x5d
slash_ni1k has joined #crystal-lang
slash_ni1k has quit [Changing host]
slash_ni1k is now known as slash_nick
<crystal-gh> [crystal] dkhofer opened pull request #2488: Add product method to enumerable. (master...add-enumerable-product-method) https://git.io/vwcuT
vifino- is now known as vifino
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
soveran has quit [Remote host closed the connection]
trapped has quit [Read error: Connection reset by peer]
kfpratt has joined #crystal-lang
rok has quit [Quit: rok]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
<asterite> jhass: `new` beats `initialize`, and since it has no type restrictions, if you do `new(whatever)` it will never go through the `initialize`
<asterite> Just an edge-case in all the `new`/`initialize` dilema
<jhass> my intuition would be that def initialize(whatever here is) generates a def self.new(whatever here was) : self; obj = allocate; obj.initialize(forward that stuff); obj; end
<jhass> and then pretty normal dispatch happen among the so available "new"s
Philpax has quit [Ping timeout: 250 seconds]
broz has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
<asterite> jhass: yeah, that's probably how it should be. However right now if there's a matching `new`, `initialize` isn't even considered... probably worth adding an issue for this
broz has joined #crystal-lang
<jhass> shall I or do you want to?
soveran has quit [Ping timeout: 252 seconds]
pawnbox has quit [Ping timeout: 250 seconds]
zeno_ has quit [Ping timeout: 244 seconds]
zeno_ has joined #crystal-lang
pawnbox has joined #crystal-lang