jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
trapped has quit [Read error: Connection reset by peer]
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
<crystal-gh> [crystal] kostya opened pull request #2965: base64: add encode and decode to io, fixed #2964 (master...base64_stream) https://git.io/vKqvg
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 249 seconds]
pawnbox has joined #crystal-lang
Liothen has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Renich has quit [Quit: leaving]
paulcsmith_ has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
willl has quit [Quit: Connection closed for inactivity]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
mbarbar has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
ozra has quit [Ping timeout: 272 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
Liothen has quit [Remote host closed the connection]
Liothen has joined #crystal-lang
Liothen has quit [Changing host]
Liothen has joined #crystal-lang
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
ome has joined #crystal-lang
snsei has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
mbarbar has quit [Ping timeout: 252 seconds]
mark_66 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
bjz has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
bjz has quit [Client Quit]
Raimondii is now known as Raimondi
Oliphaunte has joined #crystal-lang
alsm has joined #crystal-lang
<FromGitter> <mrfoto> hello
<FromGitter> <mrfoto> i'm scraping again, and encountered issues again :D
<FromGitter> <mrfoto> i iterate through nodeset with each and if i print out each node it looks ok
<FromGitter> <mrfoto> but if i do xpath on the node in the each i get the same result as if i would run xpath on the whole nodeset
<FromGitter> <mrfoto> meaning i always get the first element
Oliphaunte has quit [Ping timeout: 250 seconds]
<FromGitter> <mrfoto> so how can i limit xpath search to current node?
<jhass> / starts at the root node, always
<jhass> eh
<jhass> //
<jhass> you can use ./ or just omit it I think
<FromGitter> <mrfoto> but div should be a new node, no?
<jhass> doesn't matter, xpath is always in the context of the whole document and then has a current node concept
<jhass> // ignores the current node
<FromGitter> <mrfoto> ah, cause in the docs it says "Searches this node for XPath path."
<jhass> patches welcome :P
<FromGitter> <mrfoto> ok, gonna look into this a bit more
<FromGitter> <mrfoto> thanks
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
globalkeith has quit [Quit: Textual IRC Client: www.textualapp.com]
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
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
Philpax has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
trapped has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
ome has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
elia has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
bjz has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Client Quit]
Oliphaunte has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Oliphaunte has quit [Ping timeout: 250 seconds]
bjz has joined #crystal-lang
mbarbar has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
g3funk is now known as braidn
pawnbox has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
<alsm> can types be values? I'm writing an mqtt client, when I receive a packet the first byte tells me what kind of control packet we're receiving, I need to use that information to create a new <packet_type> and call that types from_io, so essentially want a lookup table of UInt8 to <packet_type>
pawnbox has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<alsm> doing a case on the type UInt8 instead
pawnbox has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
<alsm> hmm, can't have from_io on an abstract class to do io.read_bytes ?
ozra has joined #crystal-lang
snsei has joined #crystal-lang
Oliphaunte has joined #crystal-lang
ozra has quit [Ping timeout: 258 seconds]
paulcsmith_ has joined #crystal-lang
snsei has quit [Remote host closed the connection]
paulcsmith_ has quit [Client Quit]
paulcsmith_ has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
snsei has joined #crystal-lang
Philpax_ has quit [Ping timeout: 252 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
Raimondii is now known as Raimondi
mbarbar has quit [Ping timeout: 276 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ozra has joined #crystal-lang
alsm has quit [Ping timeout: 264 seconds]
<RX14> crystal's stdlib specs are taking ages and ages on my machine.
<RX14> it's been stuck on 1 spec for like 5 mins
<crystal-gh> [crystal] RX14 opened pull request #2967: [Incomplete] Add MIME multipart parsing (master...feature/multipart) https://git.io/vKmX3
<RX14> ok there, incomplete PR
<RX14> finally
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<RX14> travis-ci.com so much faster than travis-ci.org...
bjmllr has quit [Read error: Connection reset by peer]
Raimondi has quit [Quit: All hail WeeChat 1.5-dev!]
Raimondi has joined #crystal-lang
<BlaXpirit> what a surprise...
<RX14> it being expected doesn't stop me maoning about it :)
bjmllr has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
tomchapin has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
<RX14> i failed the specs anyway :/
<RX14> "hmmn why are my specs taking so long" "oh its my fault"
ozra__ has joined #crystal-lang
paulcsmith_ has quit [Client Quit]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomchapin has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Oliphaunte has quit [Remote host closed the connection]
paulcsmith_ has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vKmxC
<crystal-gh> crystal/master 405528c O_o: base64: add encode and decode to io, fixed #2964 (#2965)
ome has quit [Quit: Connection closed for inactivity]
tomchapin has joined #crystal-lang
elia has joined #crystal-lang
elia has quit [Client Quit]
<travis-ci> crystal-lang/crystal#405528c (master - base64: add encode and decode to io, fixed #2964 (#2965)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/143119574
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vKYTj
<crystal-gh> crystal/master 85df1d4 Ary Borenszweig: Removed deprecated `embed_ecr` and `ecr_file`
<crystal-gh> crystal/master ff690f4 Ary Borenszweig: Compiler: missing usage of MetaVars alias
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<travis-ci> crystal-lang/crystal#ff690f4 (master - Compiler: missing usage of MetaVars alias): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/143134434
Oliphaunte has joined #crystal-lang
snsei has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
tomchapin has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kulelu88 has joined #crystal-lang
kulelu88 has quit [Changing host]
kulelu88 has joined #crystal-lang
pawnbox has joined #crystal-lang
j2k has quit [Ping timeout: 246 seconds]
pawnbox has quit [Ping timeout: 244 seconds]
j2k has joined #crystal-lang
kulelu88 has quit [Quit: Leaving]
willl has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
elia has joined #crystal-lang
<RX14> "can't cast Hash(String, String) to Hash(String, String | Nil)" why not?
<RX14> downgrading something which isnt nillable to something which is nillable should be easy
<RX14> yet i can't seem to do it
<RX14> i have a class where one of the class variables is Hash(String, String?)?
<RX14> and i need to pass a Hash(String, String) to the constructor
<RX14> but I can't work out how to deal with it
<RX14> because to me, they are compatible types
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BlaXpirit> RX14, well no, they're not compatible types and conversion is a costly process. if you think about it, a type could even define an entirely special behavior depending on the subtype
<RX14> well... it worked on older crystal
<RX14> just worked
<RX14> no special code just magically converted
<BlaXpirit> RX14, really doubt it
<RX14> yeah sorry it did
<BlaXpirit> RX14, no it didn't
<RX14> well whatever i did worked
elia_ has joined #crystal-lang
<RX14> and the type signature was definitely Hash(String, String?)?
<BlaXpirit> >> a = {"a" => "b"}.map { |k, v| {k, v as String?} } .to_h; pp a
<DeBot> BlaXpirit: a # => {"a" => "b"} - more at https://carc.in/#/r/13ej
<BlaXpirit> right, doesn't specify type
<BlaXpirit> >> a = {"a" => "b"}.map { |k, v| {k, v as String?} } .to_h; puts "#{a} : #{typeof(a)}"
<DeBot> BlaXpirit: {"a" => "b"} : Hash(String, String | Nil) - more at https://carc.in/#/r/13ek
<BlaXpirit> RX14 ^
elia has quit [Ping timeout: 240 seconds]
<RX14> crystal is just
<RX14> not being ok
<BlaXpirit> RX14, tell me when you find a compiled language that could do anything even close to this
<RX14> no
<RX14> but
<RX14> this error message isn't right
<RX14> it should be comaining that no overload on .new exists
<RX14> not this weird-ass message
<RX14> even here! https://carc.in/#/r/13ep
pawnbox has joined #crystal-lang
<RX14> it's totally fine with hash(String, String) being a subset of Hash(String, String?)? when used as a type restruction but it can't handle it as an instance var, i guess it must codegen different methods based on the type
<BlaXpirit> RX14, yes, hmm that must be something new, and quite nice to allow this flexibility when used as a type restriction
<BlaXpirit> but an instance variable must have a predefined memory layout
<RX14> its just weird
<RX14> so weird
<RX14> it's not the error I woulkd expect in this situation at all
<RX14> i would expect that I don't have to rewrite my spec file to specify the type sygnature of every hash when I didn't before...
<RX14> it's a regression, i don't know how it worked before but it did
<RX14> in 0.15.0: https://carc.in/#/r/13er
<RX14> works
<BlaXpirit> yep, 0.15.0 is the one. i didn't try it
<RX14> if the codegen is possible it's a regression to me
<BlaXpirit> well yes, it used to allow instance variables of any type, they were just unions
<RX14> hmmn
<RX14> i guess you're right
pawnbox has quit [Ping timeout: 272 seconds]
<BlaXpirit> RX14, not very nice for performance and whatnot https://carc.in/#/r/13ex
<RX14> so i'm going to have to prefix all of my hash literals in my specs
<RX14> i wish i could do it in a clean way
Oliphaunte has quit [Remote host closed the connection]
<RX14> i guess if its specs I could map the hash
<BlaXpirit> RX14, https://carc.in/#/r/13f1
<RX14> blergh
<RX14> i'll map it
<RX14> i'm using a helper method in the spec
<RX14> gen_m for generate method
<RX14> its easy to accept other hash types there
<RX14> yay
<RX14> finally got the damn thing to work
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
Dreamer3 has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 250 seconds]
Dreamer3 has joined #crystal-lang
pawnbox has joined #crystal-lang
badeball has quit [Ping timeout: 246 seconds]
pawnbox has quit [Ping timeout: 246 seconds]
badeball has joined #crystal-lang
elia_ has quit [Quit: Computer has gone to sleep.]