RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <tenebrousedge> the context here is still something I'm struggling with, but it seems like there could probably be two `Hash` objects, e.g. `INCLUDES = {}; EXCLUDES = {}`
<devil_tux> tene: yup, I thought about using two separate hashes
<FromGitter> <Blacksmoke16> @dscottboggs_gitlab figured out what broke Athena https://github.com/crystal-lang/crystal/issues/7698
<FromGitter> <Blacksmoke16> ib4 thats the desired behavior heh
<FromGitter> <Blacksmoke16> anyone run tests against nightly on travis?
alexherbo20 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 255 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
DmitryBochkarev has joined #crystal-lang
alexherbo204 has joined #crystal-lang
alexherbo20 has quit [Ping timeout: 255 seconds]
_whitelogger has joined #crystal-lang
<bmcginty> Is there any way to include a method module wide (so accessible inside classes) when including anotehr module? So Module A includes module B. Module A has class ClassA, that needs to access a method from module B. I've tried all sorts of things with macros and incuded and extended and finihed macros with no luck.
DmitryBochkarev has quit [Ping timeout: 246 seconds]
DmitryBochkarev has joined #crystal-lang
devil_tux has quit [Ping timeout: 268 seconds]
<bmcginty> To be a bit clearer, it looks like when a instance method is looked up inside a class, the parent modules of that class aren't checked, and same if it's a class method.
<FromGitter> <sam0x17> random thought: would be cool if using `?` at the end of a method name caused the compiler to require a boolean return type for that method
DmitryBochkarev has quit [Ping timeout: 244 seconds]
DmitryBochkarev has joined #crystal-lang
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
jokke has quit [Ping timeout: 244 seconds]
ua has quit [Ping timeout: 252 seconds]
sagax has quit [Ping timeout: 250 seconds]
jokke has joined #crystal-lang
ua has joined #crystal-lang
sagax has joined #crystal-lang
jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.28.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
ashirase has quit [Ping timeout: 246 seconds]
ashirase has joined #crystal-lang
<wuehlmaus> hip, hip, hurrah! jhass is alive and kicking :-)
DmitryBochkarev has quit [Ping timeout: 255 seconds]
<mps> trying to rebuild crystal 0.27.2 on Alpine Linux edge got yaml error in 'make spec' http://tpaste.us/J6pl
DmitryBochkarev has joined #crystal-lang
<FromGitter> <drum445> Is there anyway to pass dynamic variables into a macro:
<FromGitter> <drum445> I want to be able to do this in Kemal: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ but I get this error [https://gitter.im/crystal-lang/crystal?at=5cbb03381cd0b8307d42645d]
<FromGitter> <drum445> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cbb033b97dcb371d8e32be2]
<FromGitter> <anamba> @drum445 not with ECR, which inlines the file
<FromGitter> <anamba> right into your code
<FromGitter> <anamba> I'm trying to use liquid for dynamic templating, but the existing liquid shard was... very basic. So it's been a bit more work than I anticipated
<FromGitter> <drum445> ah damn, going to have to make a separate route for each file I guess then :(
<FromGitter> <drum445> cheers anyways
<FromGitter> <drum445> yeah I was just looking at liquid
DmitryBochkarev has quit [Ping timeout: 268 seconds]
<FromGitter> <drum445> I'm not sure how these template engines suit a strongly typed lang though
_whitelogger has joined #crystal-lang
<FromGitter> <straight-shoota> @bew ⏎ ⏎ > @straight-shoota Wait what? How can #7377 fix #7687 ? Since he's running on WSL, the stdlib for win32 shouldn't be used (and #7377 shouldn't impact the results).. Or am I looking it wrong? ⏎ ⏎ You're right. I missed that it was running on WSL not Windows directly. But it seems to be fixed in 0.28.0 anyway... [https://gitter.im/crystal-lang/crystal?at=5cbb12d76a84d76ed8c54b54]
<DeBot> https://github.com/crystal-lang/crystal/pull/7377 (Fix windows monotonic time bug) | https://github.com/crystal-lang/crystal/issues/7687 (Crystal can't measure time below 1100 nanoseconds) | https://github.com/crystal-lang/crystal/pull/7377 (Fix windows monotonic time bug)
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ashirase has quit [Ping timeout: 246 seconds]
ashirase has joined #crystal-lang
Jenz has joined #crystal-lang
<Jenz> IMO the C-binding example on crystal-lang.org should be a bit simpler
<Jenz> brb
Jenz has quit [Ping timeout: 244 seconds]
Jenz has joined #crystal-lang
<Jenz> It is a rather extensive example, and a bit complex, at least compared to the rest of crystal's syntax
<FromGitter> <bew> I agree, always thought it was hard to understand for a beginner
lucasb has joined #crystal-lang
<Jenz> I certainly was baffled when I saw it the first time (which was also the first time I saw Crystal), about the only thing I remember of starting out with crystal (plus reading loads of docs)
Jenz has quit [Ping timeout: 246 seconds]
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Read error: Connection reset by peer]
DmitryBochkarev has joined #crystal-lang
literal has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/6rd4
<FromGitter> <Blacksmoke16> doesnt that remove the point of ivars w/o a getter that should be private?
alexherbo2043 has joined #crystal-lang
alexherbo204 has quit [Ping timeout: 245 seconds]
DmitryBochkarev has quit [Ping timeout: 250 seconds]
<FromGitter> <tenebrousedge> the second `@name : String` seems redundant
<FromGitter> <tenebrousedge> but yeah, that's not quite what I would expect
<FromGitter> <tenebrousedge> in Ruby that would be a syntax error, but the ivar would still be public some senses
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Max SendQ exceeded]
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 246 seconds]
DmitryBochkarev has joined #crystal-lang
Jenz has joined #crystal-lang
* Jenz :o
<Jenz> I had no idea that was possible, I've never seen it used, and I agree, that seems weird, I had always thought ivars w/o a getter was private
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/issues/7671#issuecomment-484118199 is expected tho i guess
<FromGitter> <Blacksmoke16> :shrug:
<Jenz> Anyways, seems good people won't use it, I certainly won't, unless there's some niche problem where it's needed.
<Jenz> The pointer argument seems very strong
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/athena/releases/tag/v0.6.0 Athena version 0.6.0 is now released. Brings crystal 0.28.0 support, multiple param converter support, and a QoL change for `Nil` return types.
<Jenz> Failed :nodoc: :P
<Jenz> Otherwise, very nice docs Blacksmoke1
<Jenz> -6
<FromGitter> <Blacksmoke16> :S
<FromGitter> <Blacksmoke16> thanks, i try to keep em complete. makes figuring how to use it much easier
<FromGitter> <Blacksmoke16> im suprised that was generated tho, i guess private structs still show up
<Jenz> I think you need to have an empty comment line between the :nodoc: and the text
<FromGitter> <Blacksmoke16> putting it at the top also fixes it
<Jenz> parsing's such a mess
DmitryBochkarev has quit [Ping timeout: 250 seconds]
DmitryBochkarev has joined #crystal-lang
<FromGitter> <Blacksmoke16> working on my db query shard again...kinda forgot about it ha
<FromGitter> <Blacksmoke16> bringing type safety and reusability to a db near you
DmitryBochkarev has quit [Remote host closed the connection]
DmitryBochkarev has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cbb6f42375bac7470d8d821]
<FromGitter> <Blacksmoke16> `SELECT * FROM classes spec JOIN users j ON spec.id = j.user_id WHERE (spec.id = ? AND spec.name LIKE ? AND (j.id = ? AND spec.id = ?));`
<FromGitter> <Blacksmoke16> getting there
hightower3 has joined #crystal-lang
<hightower3> So happy about 0.28.0!
<FromGitter> <Blacksmoke16> ```BUG: called create_llvm_type for R (Exception) ⏎ from ??? ⏎ from ??? ⏎ from ??? ⏎ ``` [https://gitter.im/crystal-lang/crystal?at=5cbb78f4e416b84519b13199]
<FromGitter> <Blacksmoke16> that a new one ha
Jenz has quit [Ping timeout: 245 seconds]
DmitryBochkarev has quit [Ping timeout: 255 seconds]
<hightower3> Did Time#day_of_week change Sunday from 0 to 7, and/or did it become locale-dependent?
beepdog has quit [Quit: lol]
<FromGitter> <vladfaust> @Blacksmoke16 Crystal has infinite possibilities for exploration, like `???` and also `???`
<FromGitter> <Blacksmoke16> gotta explore the map first ;)
<FromGitter> <vladfaust> Every new day on Crystal brings me new `???` and it made me `???` `???`
<FromGitter> <vladfaust> `??????`
<FromGitter> <vladfaust> Thus said, those bugs are nasty, I understand you
<FromGitter> <Blacksmoke16> managed to get around it, so oh well
<FromGitter> <vladfaust> Maybe it's for good. In Crystal you *always* have to have plan B
<FromGitter> <vladfaust> It improves thinking
<FromGitter> <Blacksmoke16> yea for sure, sometimes leading to less optimal solutions tho
<FromGitter> <vladfaust> Indeed
<FromGitter> <vladfaust> I came for a minute here, good night!
_whitelogger has joined #crystal-lang
<FromGitter> <bajro17> Hello I have one problem in my code
<FromGitter> <bajro17> its little long
<FromGitter> <bajro17> but this is error I get
<FromGitter> <bajro17> Unhandled exception: Index out of bounds (IndexError)
<FromGitter> <tenebrousedge> use https://play.crystal-lang.org/#/cr
<FromGitter> <ryanstout> @bajro17 that usually means you're doing ```array[some_number]``` where some_number is greater than the number of elements in the array
<FromGitter> <bajro17> I do something
<FromGitter> <bajro17> but now this error
<FromGitter> <bajro17> undefined method 'each' for Float64 (compile-time type is (Array(Float64) | Float64))
<FromGitter> <bajro17> but I'm sure I pass array of float
<FromGitter> <tenebrousedge> Using `each` and/or manual array indexes is probably not taking sufficient advantage of higher-order iteration methods
<FromGitter> <ryanstout> humm, I would have to see the code. The variable you're calling each on can be either an Array(Float64) or a Float64
<FromGitter> <j8r> @bajro17 add more restrictions here and there, especially return types. this may help you
<FromGitter> <ryanstout> can you put some code in https://play.crystal-lang.org/#/cr
<FromGitter> <j8r> 👍
<FromGitter> <bajro17> this is code
<FromGitter> <bajro17> where program stack
<FromGitter> <ryanstout> what line is the error on?
<FromGitter> <bajro17> Line 65
<FromGitter> <j8r> I suggest to add type restrictions to your args
<FromGitter> <Blacksmoke16> ^
<FromGitter> <j8r> it'll ease your debug
<FromGitter> <j8r> and also return types, like `dayPortion(times : T) : U`
hightower3 has quit [Read error: Connection timed out]
<FromGitter> <tenebrousedge> and avoid using `each` or manually tracking indices
<FromGitter> <Blacksmoke16> why avoid .each?
<FromGitter> <ryanstout> ```times = self.computeTimes(times)``` ⏎ ⏎ returns the last non-comment line in computeTimes, which is whatever computeTime returns ⏎ I'm guessing that is changing times to a Float64 (and thus making it an ```Array(Float64) | Float64``` [https://gitter.im/crystal-lang/crystal?at=5cbb8daa990feb4518d5b927]
<FromGitter> <ryanstout> yea, each is fine
<FromGitter> <ryanstout> :-)
<FromGitter> <tenebrousedge> no, `each` is not fine
<FromGitter> <Blacksmoke16> how you figure?
<FromGitter> <ryanstout> @bajro17 when you run into issues like this, it can be helpful to specify types around the variables you're seeing the errors on. So if you change ```times = ``` to ```times : Array(Float64) = ``` on line 3, you'll see where it gets assigned to something else
<FromGitter> <ryanstout> (you'll get a compile time error when something tries to assign it to something else)
<FromGitter> <bajro17> yes it help but dont understand
<FromGitter> <tenebrousedge> it does not have a useful return value, and it's a low-level-of-abstraction iterator. The loop cannot be used to change program state unless it reaches outside the loop scope. At best, it forces you to expend two extra lines, to create the stateful object that it interacts with, and to do something useful with it afterwards. `each` should only be used when the loop is not intended to create a new value,
<FromGitter> ... i.e. metaprogramming or possibly output. You should instead use the highest level of abstraction which is practical.
<FromGitter> <bajro17> line 52
<FromGitter> <Blacksmoke16> its saying since you restricted `computeTimes` to only accept `Array(Float64)`, there is no method that accepts a `Float64` w
<FromGitter> <Blacksmoke16> since `times` is at some point not an array
<FromGitter> <Blacksmoke16> prob because it gets mutated from the response of `computeTimes` at some point
<FromGitter> <bajro17> yes
<FromGitter> <bajro17> <3
<FromGitter> <bajro17> thank you
<FromGitter> <bajro17> its because other is commented
<FromGitter> <Blacksmoke16> np
<FromGitter> <bajro17> Again problem
<FromGitter> <bajro17> line 86
<FromGitter> <bajro17> times[i] = self.floatToTime12(times[i])
<FromGitter> <bajro17> no overload matches 'Prayer#floatToTime12' with type Array(Float64)
<FromGitter> <bajro17> but I dont send array
<FromGitter> <bajro17> I send only single item from array
<FromGitter> <j8r> you maybe do
<FromGitter> <j8r> if `floatToTime12` or `floatToTime24` returns an array
early has quit [Quit: Leaving]
<FromGitter> <bajro17> even from this 2 functions I send only float64
<FromGitter> <j8r> that's because inside this methods you modify the `times` reference
early has joined #crystal-lang
<FromGitter> <j8r> I presume
<FromGitter> <j8r> nvm
early has quit [Remote host closed the connection]
<FromGitter> <j8r> when this lines are commented it compiles
early has joined #crystal-lang
<FromGitter> <bajro17> it mean something is inside
<FromGitter> <bajro17> I will try figure out
<FromGitter> <Blacksmoke16> are we sure there isnt an easier way to accomplish what you're trying to do? seems quite complex
<FromGitter> <Blacksmoke16> for just doing date stuff?
<FromGitter> <Blacksmoke16> but that latest error is something similar to the last one, trying to pass an `Array(Float64)` when it only takes a `Float64`
<FromGitter> <j8r> @bajro17 https://carc.in/#/r/6rfk
<FromGitter> <j8r> that's not what you want, right?
<FromGitter> <Blacksmoke16> id imagine he wants `(0..6)`
<FromGitter> <j8r> @bajro17 https://carc.in/#/r/6rfo
<FromGitter> <bajro17> I already change this
<FromGitter> <bajro17> to times.map
sagax has quit [Ping timeout: 246 seconds]
<FromGitter> <j8r> note that each time you do `Arrray[n]` it iterates n times in the array
<FromGitter> <bajro17> also change to times.map! to change array instead use temptimes
<FromGitter> <bajro17> I dont know a lot of methods and sometimes so hard to find in API
<FromGitter> <Blacksmoke16> `Enumerable` has a lot of good stuff
<FromGitter> <Blacksmoke16> as does `Array`
lucasb has quit [Quit: Connection closed for inactivity]