<FromGitter>
<drosehn> [from awhile ago] adam12: hmm. some time ago I implemented my own setproctitle() function for those OS's which didn't have one (and at the time, most OS's did not have one). It was kinda tricky to do it right. The thing is, I can't even remember what the project was where I wrote that.
<adam12>
Heh
srabuini is now known as sebasr
<adam12>
@drosehn: I think this is *kinda* there, for Linux anyways. But Darwin looks like it's going to be a pain so I abandoned. https://play.crystal-lang.org/#/r/1664
Oliphaunte has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 250 seconds]
<FromGitter>
<drosehn> I managed to find the version I wrote a long time ago. It kinda works on MacOS 10.10, but let me see if I can get it to work a bit better.
<FromGitter>
<drosehn> Sorry. This seems to be some version before the one which was completely correct. Now that I realize what the bug is, I (vaguely) remembered hitting it before and fixing it. Too tired to figure it out right now.
<adam12>
No worries.
the_drow has joined #crystal-lang
Philpax has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 244 seconds]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
the_drow has quit [Quit: This computer has gone to sleep]
<RX14>
Slice.map returns an array and that annoys me a lot of times
<jhass>
not sure how that would look like
<RX14>
yeah i don't think its possible while remaining efficient
<jhass>
keep in mind all of these are still up for discussion
<jhass>
if you think something should return something else, open a PR or issue
Philpax has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
Philpax 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]
Philpax has quit [Quit: Leaving]
matp has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 265 seconds]
mkl0501 has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
sardaukar has joined #crystal-lang
RinkanaZ has joined #crystal-lang
sardaukar_ has joined #crystal-lang
Philpax has joined #crystal-lang
sardaukar_ has quit [Client Quit]
sardaukar has quit [Remote host closed the connection]
<RinkanaZ>
Hey guys, i'm working on some HTTP::Client adjustments. And for that i want to add a new init property. However i do not like to pass all the parameters to get to the new one.
sardaukar has joined #crystal-lang
<jhass>
well, can you find a sensible default value?
<RinkanaZ>
Yeah, it can be empty
<RinkanaZ>
But i'm more worried about the need to write the other parameters that would still retain the default values
<RinkanaZ>
But then they are hard coded in the application.
ponga has joined #crystal-lang
<RinkanaZ>
I was thinking of making a utility function that you can use to just set that variable.
<jhass>
I'm not sure I quite follow what the problem is
<RinkanaZ>
I was wondering if that is the recommended method or if i just use the parameter one
<jhass>
Given the shortcut methods, (keyword) parameter passing is probably more ideal
<FromGitter>
<sdogruyol> wow, 0.18.7 and master has 308 commits diff
<sardaukar>
bodes well for the next release :D
sardaukar has left #crystal-lang ["Leaving"]
<FromGitter>
<sdogruyol> indeed
sardaukar has joined #crystal-lang
<FromGitter>
<sdogruyol> Still master doesnt have the MIME parser :/
<FromGitter>
<Rinkana> When i do ```Client.new(URI.new)``` it goes to the wrong init
<FromGitter>
<sdogruyol> what's your `initialize` like?
<FromGitter>
<Rinkana> ```def initialize(@host, port = nil, tls : Bool | OpenSSL::SSL::Context::Client = false, handlers = [] of Handler)```
<FromGitter>
<Rinkana> And it defaults to this initialize function with the error saying that the first param needs to be a string and not an URI object
<FromGitter>
<sdogruyol> it's definitely not calling `self.new`
<FromGitter>
<sdogruyol> how do you call it?
<FromGitter>
<Rinkana> ```typeof(Client.new(URI.new))``` in a spec
<FromGitter>
<Rinkana> But ```typeof(Client.new(URI.new, nil, [] of HTTP::Client::Handler))``` works
<FromGitter>
<sdogruyol> that matches the signature of self.new so it's normal
<FromGitter>
<Rinkana> Yeah but what's odd is is that just with only an URI it does not work
<FromGitter>
<sdogruyol> in your case it doesnt understand if you're passing an URI or a String when calling the method with just 1 param
<FromGitter>
<sdogruyol> why don't you initialize @host like the others?
<FromGitter>
<sdogruyol> i mean by default
pawnbox has quit [Ping timeout: 258 seconds]
<FromGitter>
<Rinkana> This is currently in the code. I only added the ```headers = [] of Header``` part and then it does not work anymore
pawnbox has joined #crystal-lang
<FromGitter>
<Rinkana> Hmm even ```Client.new(URI.new, headers: [] of Header)``` gives an error. Only when i add the tls option it finds the correct new function.
<jeromegn>
RinkanaZ: yea the macro is what breaks it.
fedruantine has quit [Quit: client exited: Ex-Chat]
<BlaXpirit>
if I have MyClass that defines to_unsafe, what's a nice way to convert MyClass? to MyClass* ?
<BlaXpirit>
or Void* even
<BlaXpirit>
a ? a.to_unsafe : Pointer(Void).null is the best i can come up with
fedruantine has joined #crystal-lang
<FromGitter>
<Rinkana> Serdar, it seems that it has to do something with the specs itself. When i try it from the playground it works as intended.
<FromGitter>
<Rinkana> This is odd. Is there some caching going one?
<FromGitter>
<sdogruyol> uhm, not sure about spec but you can delete .crystal folder either in your project or home folder
<FromGitter>
<Rinkana> Oh huh, my bad. I wrote crystal play in the terminal. And ofc that works as that is the source...
<FromGitter>
<Rinkana> Argh, this is killing me ```Client.new(uri: URI.new)``` works too