ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.33.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
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
_whitelogger has joined #crystal-lang
chachasmooth has quit [Ping timeout: 260 seconds]
chachasmooth has joined #crystal-lang
_whitelogger has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <sam0x17> hey so I have an abstract class with an abstract method signature like `abstract def each_file(&block)` is there a way I can have it specify that the block has to yield a string? I'm guessing some sort of proc syntax but I always get fuzzy on the difference between blocks and procs
_ht has joined #crystal-lang
_whitelogger has joined #crystal-lang
_ht has quit [Remote host closed the connection]
Human_G33k has quit [Quit: Leaving]
ur5us has joined #crystal-lang
tdc has joined #crystal-lang
repo has left #crystal-lang ["WeeChat 2.7"]
repo has joined #crystal-lang
alexherbo2 has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
<FromGitter> <maattdd> hi :) The postgres driver (crystal-pg) mentions supporting array types but the README shows only reading array value from the DB. Does it support passing an Array as an arg to db.query ?
<FromGitter> <naqvis> @sam0x17 `abstract def each_file(&block: -> String)`
<FromGitter> <naqvis> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e6a18bee203784a55a20aa0]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
postmodern has quit [Quit: Leaving]
<FromGitter> <Blacksmoke16> would more so be `& : String -> _`
<FromGitter> <Blacksmoke16> assuming he wants to *yield* a string, versus have the return value of the block be a string
<FromGitter> <Blacksmoke16> also id use `&`, to indicate the method can yield but the block cant be captured
<FromGitter> <naqvis> yeah, my understanding of question "....block has to yield a string...." was that its being asked on how to enforce type checking on return type of block.
<FromGitter> <naqvis> But its good to have answer to both questions
<sorcus> Hi :-)
<FromGitter> <Blacksmoke16> o/
<FromGitter> <Blacksmoke16> convert a string to hex?
<sorcus> It looks like a little weird X-)
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<travis-ci> crystal-lang/crystal#14df86e (master - Use CRYSTAL_OPTS env variable as default compiler options (#8900)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/661564157
<DeBot> https://github.com/crystal-lang/crystal/pull/8900 (Use CRYSTAL_OPTS env variable as default compiler options)
<sorcus> Blacksmoke16: I'm not sure. Because main logic is `use first byte and make `exclusive or` with all other`. %-)
<sorcus> Blacksmoke16: Oh...
<sorcus> Blacksmoke16: https://gist.github.com/MrSorcus/f47c19038e8d0ea12cc2e0988f8fbd03 - here is how it should be.
<FromGitter> <stronny> so what's wrong with your code? why do you want to rewrite it?
<sorcus> stronny: because i'm not sure about my code...
<FromGitter> <stronny> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e6a57678e42396957845d88]
<FromGitter> <Blacksmoke16> `String.new(str.hexbytes)`
<FromGitter> <Blacksmoke16> assuming the hex string is correctly encoded ofc
<FromGitter> <stronny> you need to XOR each byte with the first one
<sorcus> Blacksmoke16: Nope, `String.new` doesn't return valid result.
<sorcus> stronny: Yeap X-)
watzon has quit [Quit: watzon]
watzon has joined #crystal-lang
watzon has quit [Client Quit]
ua has quit [Excess Flood]
ua has joined #crystal-lang
<sorcus> https://gist.github.com/MrSorcus/154e47c3b347c461e09a3339db4878f6 - i rewrite it. I think it looks more better now.
<sorcus> > convert_old 329.25k ( 3.04µs) (± 3.78%) 802B/op 3.47× slower\nconvert_new 1.14M (875.84ns) (± 4.81%) 112B/op fastest
<sorcus> Hmmm. `\n` doesn't work here. Sad :-(
DTZUZU has quit [Ping timeout: 258 seconds]
DTZUZU has joined #crystal-lang
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci> crystal-lang/crystal#c6718ce (master - Revert "Deprecate String#codepoint_at (#8475)" (#8902)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/661605286
travis-ci has left #crystal-lang [#crystal-lang]
<DeBot> https://github.com/crystal-lang/crystal/pull/8475 (Deprecate String#codepoint_at) | https://github.com/crystal-lang/crystal/pull/8902 (Revert "Deprecate String#codepoint_at")
alexherbo2 has quit [Ping timeout: 255 seconds]
alexherbo2 has joined #crystal-lang
alexherbo20 has joined #crystal-lang
_ht has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo20 is now known as alexherbo2
<FromGitter> <watzon> Seems like `LibC` is missing the `LongDouble` type
<FromGitter> <watzon> It it maybe because `long double` is too big?
<FromGitter> <watzon> Also, fuck: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e6a80a285f81e18a801190e]
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
alexherbo2 has joined #crystal-lang
<FromGitter> <Blacksmoke16> f
<FromGitter> <watzon> How the fuck am I gonna make this work? Lol
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <watzon> There has to be a better way to get a `Pointer(Pointer(UInt8))` than this, right? ⏎ ⏎ ```argv = "".to_slice.to_unsafe ⏎ pointerof(argv)```` [https://gitter.im/crystal-lang/crystal?at=5e6a85aeff8bf14a5451ac5f]
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
postmodern has joined #crystal-lang
<FromGitter> <watzon> Also, is it possible to get a function pointer? Or do procs have to be used?
<FromGitter> <Blacksmoke16> thats what a proc is
alexherbo2 has quit [Ping timeout: 265 seconds]
FromGitter has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
tdc has quit [Ping timeout: 255 seconds]
_ht has quit [Quit: _ht]
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #crystal-lang
DTZUZU has quit [Ping timeout: 255 seconds]