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…]
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]
<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 :)
_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]
<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