<FromGitter>
<naqvis> variadic params are turned to `TupleLiteral` in macro land and that's same as for non-macro world.
<FromGitter>
<naqvis> this seems to be bug to me
hightower2 has quit [Ping timeout: 264 seconds]
hightower2 has joined #crystal-lang
<FromGitter>
<asterite> why?
<FromGitter>
<asterite> Strange, I thought this was documented. When a splat has a type restriction, it only matches one or more args. The reason is that if you have multiple overloads with different types, for example `foo(*x : Int32)` and `foo(*x : String)`, which one is chosen if you call it without args? The answer is: none! You have to define a separate overload `foo` without args. No ambiguity! But if there's no type
<FromGitter>
... restriction, the problem doesn't exist, so it matches zero args. Given that macros don't have type restrictions, splat match zero args.
<FromGitter>
<naqvis> thanks for the clarification Ary. But this restriction means that one can't have `Proc` defined for variadic params
<FromGitter>
<naqvis> as `Proc` requires type definitions to be defined
cfebs_ has joined #crystal-lang
<SamantazFox>
<asterite> "Strange, I thought this was documented." <- I'm going to be honnest: many, many edge cases and other complex part of the Crystal language are not documented at all.
<SamantazFox>
Like, sometimes, I have to go in the stdlib code to understand how some specifics work
<FromGitter>
<Blacksmoke16> it would be helpful if people create issues or ideally PRs when they run into this stuff
<FromGitter>
<Blacksmoke16> either on the book repo or crystal itself if its an API thing
<riza>
oh yes, right. the "positive" sign strikes again
<riza>
ruby has that figured out somehow
<straight-shoota>
Ruby has no overloading so there's only one + method
<riza>
I don't follow what you mean, how is overloading at play here?
<straight-shoota>
wait
<straight-shoota>
Short block syntax in Ruby are just symbols which are turned into a proc and call a method of their own name, forwarding all block parameters.
<straight-shoota>
In Crystal it's a separate syntax feature and you write the call explicitly with full controll over it
<riza>
there we go, that's what I was assuming
ua__ has quit [Ping timeout: 268 seconds]
<FromGitter>
<Blacksmoke16> fwiw in this case you can just use `#sum`
<riza>
well... why didn't you say that 45min ago! hah
<FromGitter>
<jrei:matrix.org> Not fun otherwise :)
<riza>
does the crystal implementation of Time provide for a notion of time which isn't fixed to a day? or is the practice to simply ignore the date-part of a Time if all that's needed is the hours/minutes/esconds
<FromGitter>
<Blacksmoke16> Time::Span maybe?
<FromGitter>
<oprypin:matrix.org> nah that's not it. ⏎ i think there isn't such a thing in crystal
<FromGitter>
<Blacksmoke16> It's more so for duration yea
<FromGitter>
<oprypin:matrix.org> i've actually never run into such a thing anywhere, so i was surprised that Python has it
ua_ has joined #crystal-lang
<SamantazFox>
Time::Span seems the more appropriate to simply store hours/minutes/seconds
<SamantazFox>
And if required, can easily be applied to a Time object.
<FromGitter>
<Blacksmoke16> yea it stores a duration of time
<FromGitter>
<Blacksmoke16> what's your use case for only needing the time and not the date?