ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.34.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
<FromGitter> <Blacksmoke16> yea i was using the github one versus the linux one
<FromGitter> <Blacksmoke16> what should i do with `ENV LIBRARY_PATH=/bdwgc/.libs/`
<FromGitter> <Blacksmoke16> the build image sets it to something different
<FromGitter> <Blacksmoke16> or maybe i dont need it?
<FromGitter> <Blacksmoke16> no i do
ur5us has joined #crystal-lang
livcd has quit [Ping timeout: 260 seconds]
<FromGitter> <kinxer> @Blacksmoke16 Do you mind if I lift that `assert_error`code (with in-code attribution)?
<FromGitter> <Blacksmoke16> Sure
<FromGitter> <kinxer> Excellent. Thanks.
<FromGitter> <Blacksmoke16> Wonder if you can use some of the test methods the compiler uses, probably be faster
<FromGitter> <kinxer> I wouldn't mind that. In my case, I only have one macro `raise` to test, so the time isn't such a big deal.
gangstacat has joined #crystal-lang
<FromGitter> <Blacksmoke16> yea, benefit of having it tested outweighs the extra 5sec or whatever it takes to run
<FromGitter> <kinxer> Yeah, absolutely.
straight-shoota has quit [Ping timeout: 260 seconds]
<FromGitter> <watzon> Lol nice work on `saline` @kinxer
<FromGitter> <watzon> At least one good thing came out of that post
<FromGitter> <kinxer> Lol. Thanks.
deavmi has quit [Read error: No route to host]
deavmi has joined #crystal-lang
<FromGitter> <Blacksmoke16> are the tar files published somewhere for nightly builds?
<FromGitter> <Blacksmoke16> iirc they're in circle build artifacts?
ur5us has left #crystal-lang ["Leaving"]
<FromGitter> <watzon> Isn't there a method whereby you can use a constant to get around not knowing the type of a generic? For instance, in an initializer I have `@fields = {} of String => Field`, but `Field` is actually a generic type, so I need to provide a type to it.
<FromGitter> <watzon> I've heard you can use a constant to kind of hack around it, but I've never actually seen it done
<FromGitter> <Blacksmoke16> Use a parent type
<FromGitter> <Blacksmoke16> Without a generic
<FromGitter> <watzon> Like a type that `Field` extends?
<FromGitter> <Blacksmoke16> Yea
<FromGitter> <Blacksmoke16> Or a non generic module that your module includes
<FromGitter> <wontruefree> is there a way to remove a type from a union type?
<FromGitter> <Blacksmoke16> .as ?
<FromGitter> <wontruefree> if I have a union type and I run compact removing Nils can I create a new union type that does not have Nil
<FromGitter> <Blacksmoke16> Use non bang compact
<FromGitter> <Blacksmoke16> Would need to create a new array without nil, which that would do
<FromGitter> <watzon> Unfortunately it seems like the base class method won't work very well, unless I move everything that doesn't use the generic into that class
<FromGitter> <Blacksmoke16> Oh?
<FromGitter> <Blacksmoke16> Can't use the module approach?
<FromGitter> <watzon> Crystal isn't able to accurately determine that a field exists
<FromGitter> <watzon> I still have to try the module approach
<FromGitter> <watzon> But I assume it will be the same issue
<FromGitter> <watzon> Lol nvm
<FromGitter> <watzon> It works, but the class approach doesn't. How weird.
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <wontruefree> so there is no way'
<FromGitter> <Blacksmoke16> im assuming `.as(Array(T))` doesnt work?
<FromGitter> <Blacksmoke16> could try like `.map &.as(Int32)`
<FromGitter> <wontruefree> well I want this for a method signature
<FromGitter> <wontruefree> so how would you write the method signature of `Array.compact`
<FromGitter> <watzon> Afaik there really isn't a way
<FromGitter> <watzon> It might help to see the code you're working with though
zorp has quit [Ping timeout: 260 seconds]
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #crystal-lang
_ht has joined #crystal-lang
baweaver has quit [Excess Flood]
baweaver has joined #crystal-lang
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
alexherbo2 has joined #crystal-lang
ericm has quit [Ping timeout: 240 seconds]
alexherbo23 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo23 is now known as alexherbo2
straight-shoota has joined #crystal-lang
alexherbo27 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 244 seconds]
alexherbo27 is now known as alexherbo2
livcd has joined #crystal-lang
deavmi has quit [Read error: No route to host]
deavmi has joined #crystal-lang
alexherbo29 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo29 is now known as alexherbo2
alexherbo27 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo27 is now known as alexherbo2
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
DTZUZU has quit [Ping timeout: 260 seconds]
DTZUZU2 has joined #crystal-lang
zorp has joined #crystal-lang
DTZUZU2 has quit [Quit: WeeChat 2.7]
DTZUZU has joined #crystal-lang
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
daemonwrangler has joined #crystal-lang
daemonwrangler has quit [Client Quit]
daemonwrangler has joined #crystal-lang
DTZUZU has quit [Ping timeout: 246 seconds]
DTZUZU2 has joined #crystal-lang
<oprypin> 🤔
Deuns has left #crystal-lang [#crystal-lang]
<FromGitter> <asterite> there is a way but without seeing the code it's hard to help
<FromGitter> <tenebrousedge> ohai guys, how's goes?
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
<FromGitter> <lbarasti> rocking hard @tenebrousedge, you?
<FromGitter> <tenebrousedge> heh, maybe not quite that 😀 but doing good
return0e has joined #crystal-lang
<FromGitter> <Blacksmoke16> heres a question
<FromGitter> <Blacksmoke16> is there a way to tell if a file is in argv?
<FromGitter> <Blacksmoke16> E.x. `./app --input=yaml -r --arg chart stolon --arg version 1.5.10 '$version' file.yaml`
<FromGitter> <Blacksmoke16> im parsing arguments related to `app`, but would like to pass the remaining arguments, minus the files to another process
<oprypin> Blacksmoke16, theres no way other than parsing them properly. and optionparser does not expose that information
<FromGitter> <Blacksmoke16> parsing them properly meaning?
<FromGitter> <tenebrousedge> `argv.partition(&->File.file?(string))` maybe?
<oprypin> pls
<oprypin> Blacksmoke16, well like the example https://crystal-lang.org/api/0.34.0/OptionParser.html
<FromGitter> <Blacksmoke16> hm yea, i guess the more proper way to handle this would be adding the options for the other process into option parser
<FromGitter> <Blacksmoke16> so they are correctly removed
<FromGitter> <Blacksmoke16> but what about handling args that have more than one value? like `--arg key value`?
<oprypin> cant 😂
<FromGitter> <Blacksmoke16> rip
<FromGitter> <Blacksmoke16> hrm
<oprypin> **easiest** way is probably to implement option parsing from scratch without any helper
<robacarp> and that's why there are so many option parsers on the market
<oprypin> and it's kinda silly that you have to be aware of every option of the underlying tool
<oprypin> Blacksmoke16, u could require the files to be passed after a "--"
<FromGitter> <tenebrousedge> ^
<FromGitter> <Blacksmoke16> that could work, jq allows that as well
<FromGitter> <Blacksmoke16> making that a requirement wouldnt be terrible
<FromGitter> <jwaldrip> @Blacksmoke16 Admiral supports a bunch of these options
<FromGitter> <Blacksmoke16> @jwaldrip ill look into it thanks
<FromGitter> <jwaldrip> np
<FromGitter> <eliasjpr> Hello everyone. Hope that everyone is doing well. ⏎ ⏎ Just wanted to shared a small OAuth2 Provider library for Crystal to implement OAuth2 Servers https://github.com/eliasjpr/authly
<FromGitter> <eliasjpr> Please feel free to open an issue or contribute with a PR ⏎ Stay safe everyone
<FromGitter> <jwoertink> Hey @eliasjpr! That's awesome
_ht has quit [Quit: _ht]
<raz> yep looks great. the first time i look at the readme of an oauth lib and feel like i actually understand how it's meant to work
<FromGitter> <jwoertink> If you call `GC.prof_stats.heap_size` is that the size in bytes for what's on the heap? Also, the heap is where classes go, right? (as opposed to the stack) I always get those two mixed up
<oprypin> 1. dunno 2. yes
<FromGitter> <jwoertink> thanks
DTZUZU2 has quit [Ping timeout: 246 seconds]
DTZUZU2 has joined #crystal-lang
_ht has joined #crystal-lang
_ht has quit [Ping timeout: 264 seconds]
<FromGitter> <Blacksmoke16> oprypin: seems option parser strips the `--` :/
<FromGitter> <Blacksmoke16> i really dont want to manually parse ARGV, but think i might
<FromGitter> <asterite> @tenebrousedge something for you: https://github.com/crystal-lang/crystal/pull/9197
<FromGitter> <jwoertink> Is there anything that will return the path to where you run the crystal command? Like a `__FILE__` or `__DIR__` type thing but gives you the root of the project?
<FromGitter> <jwoertink> oh, it's `Dir.current` that does what I wanted
<oprypin> jwoertink, its the dir where you run your executable though
<FromGitter> <jwoertink> right. That's what I wanted
<oprypin> there's no root of the project. u might want __DIR__/../..
<FromGitter> <jwoertink> yeah `Dir.current` gives me what I wanted
<FromGitter> <watzon> Any idea what the simplest way would be to take a `Slice(UInt8)` and convert it to a `Slice(UInt32)`
<FromGitter> <watzon> I imagine it would be something with `IO::ByteFormat`
<straight-shoota> watzon, `slice_u8.map(&.to_u32)`?
<FromGitter> <watzon> Not quite, I need to convert it at the byte level. So 4 bytes becomes one u32.
<straight-shoota> ah yes
<straight-shoota> then you need IO::ByteFormat
<FromGitter> <watzon> Basically `IO::ByteFormat::BigEndian.decode(UInt32, slice[0, 4])`, but for the whole slice
<FromGitter> <watzon> Just wondering if there was an easier way than looping over the slice in chunks of 4 bytes
<straight-shoota> you could set the encoded byte slice as buffer of an IO::Memory