soveran has quit [Remote host closed the connection]
<FromGitter>
<johnjansen> anyone know the equivalent to this ruby `match = Regex.last_match(1)`
<FromGitter>
<asterite> $1
<FromGitter>
<asterite> (that's the equivalent)
<FromGitter>
<johnjansen> haha, thanks Ary
<FromGitter>
<asterite> Or $~[1]
<FromGitter>
<asterite> (not that, in gitter it shows a link...)
<FromGitter>
<asterite> `$[1]`
<FromGitter>
<johnjansen> lol
<FromGitter>
<asterite> :-D
<FromGitter>
<johnjansen> i was about to rant about how you dont know what your talking about ;-)
<FromGitter>
<johnjansen> JOKE
HakanD has quit [Quit: Be back later ...]
HakanD has joined #crystal-lang
HakanD_ has joined #crystal-lang
HakanD has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
HakanD_ has quit [Client Quit]
HakanD_ has joined #crystal-lang
snsei has joined #crystal-lang
HakanD_ has quit [Ping timeout: 248 seconds]
snsei has quit [Ping timeout: 260 seconds]
HakanD_ has joined #crystal-lang
<FromGitter>
<johnjansen> Hey @asterite does that mean that $~[2] == Regexp.last_match(2) etc
HakanD_ has quit [Quit: Be back later ...]
<FromGitter>
<asterite> Yes, according to Ruby Regexp.last_match is "Equivalent to reading the global variable $~". Crystal only has $~, and $1 is $~[1], etc.
HakanD_ has joined #crystal-lang
HakanD_ has quit [Ping timeout: 250 seconds]
<FromGitter>
<johnjansen> thanks Ary
<FromGitter>
<johnjansen> @asterite I wonder if there is a nice way to add these kind of differences to the documentation such that omissions in the API for design reasons, have documentation (when applicable). This seems a little extravagant, but it would aid Rubyist and those porting ruby code …
<FromGitter>
<johnjansen> there is no precedent that im aware of, but it seems like a nice addition
<FromGitter>
<johnjansen> also @asterite is there a more elegant way of defining something as a union type explicitly, my first quick hack was just `some_var = [Int32.new(0), nil, ""].first`
<FromGitter>
<fkchang> @asterite @johnjansen thanks, that did the trick
<Cyrus>
How would I most easily get the user's current home directory in Crystal?
<FromGitter>
<asterite> Cyrus: I think ENV["HOME"]
dhk has quit [Ping timeout: 250 seconds]
<Cyrus>
Indeed, thank you.
soveran has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
soveran has joined #crystal-lang
dhk has joined #crystal-lang
HakanD_ has joined #crystal-lang
w400z has joined #crystal-lang
<w400z>
hey everyone, first time joining the crystal chan.
<w400z>
just starting to mess around with the language, pretty excited.
<w400z>
any shards or libraries around image processing?
<michael_campbel->
puts "welcome"
<Cyrus>
Hmm...man, missing rpartition in the crystal stdlib is rough.
DeBot has joined #crystal-lang
soveran has quit [Remote host closed the connection]
bjz has joined #crystal-lang
<FromGitter>
<zatherz> Cyrus: a contribution would be very welcome, yesterday my contribution of String#index and String#rindex with Regex was merged (https://github.com/crystal-lang/crystal/pull/3417). just submit the initial code and fix whatever the crystal-lang members tell you to fix
<FromGitter>
<johnjansen> @zatherz im looking at it now, dont know if ill get to finish anything in short order though
pawnbox has quit [Remote host closed the connection]
<Cyrus>
I will try my hand at it this weekend.
<FromGitter>
<johnjansen> dont get lost in the ruby (c) though ;-) its a nasty rabbit whole