straight-shoota has quit [Quit: ZNC 1.8.2 - https://znc.in]
straight-shoota has joined #crystal-lang
phuncmain has quit [Quit: WeeChat 2.8]
richbridger has joined #crystal-lang
aquijoule_ has quit [Ping timeout: 272 seconds]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 260 seconds]
<FromGitter>
<watzon> I thought you could bind a socket to a random port by setting the port as `0` and letting the system choose. Is it not supposed to be `0`?
Flipez has quit [Read error: Connection reset by peer]
Flipez7 is now known as Flipez
<FromGitter>
<erdnaxeli:cervoi.se> hi, can I do a case in a macro ?
<FromGitter>
<erdnaxeli:cervoi.se> like {% case test %}
<FromGitter>
<erdnaxeli:cervoi.se> it seems to complains
deavmi has quit [Quit: Eish! Load shedding.]
deavmi has joined #crystal-lang
<FromGitter>
<naqvis> don't believe you can do that, afaik `if` is the only conditional expression which can be used inside macros.
<FromGitter>
<erdnaxeli:cervoi.se> ok thanks
deavmi has quit [Quit: Eish! Load shedding.]
deavmi has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 264 seconds]
aquijoule_ has joined #crystal-lang
richbridger has quit [Ping timeout: 272 seconds]
DTZUZU__ is now known as DTZUZU
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
deavmi has quit [Ping timeout: 265 seconds]
alexherbo2 has joined #crystal-lang
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 240 seconds]
deavmi has joined #crystal-lang
<FromGitter>
<watzon> @naqvis problem is I'm using TCPSocket directly, not HTTP::Server
<FromGitter>
<watzon> I think I figured the problem out though. I was attempting to connect and then bind. It seems to work if I bind first and then connect.
<FromGitter>
<rukkiddo> is there a shorthand for hashes like js have for objects?
<FromGitter>
<rukkiddo> in js {a} is actually {"a":a}
<FromGitter>
<Blacksmoke16> no
<FromGitter>
<rukkiddo> do you think is it possible to emulate it with function
<FromGitter>
<rukkiddo> like array to hash
<FromGitter>
<Blacksmoke16> probably but is it really worth it?
<FromGitter>
<rukkiddo> if I give [a] can it convert it to {"a":a}
<FromGitter>
<rukkiddo> well it depends
<FromGitter>
<watzon> You could do it with a tuple instead and maintain the curly brace syntax, but you'd have to monkey patch `Tuple` with a method and then call that method, there wouldn't really be a way to do it automatically
<FromGitter>
<watzon> Actually... you'd probably need a macro come to think of it
<FromGitter>
<Blacksmoke16> hardly seems worth the extra complexity
<FromGitter>
<watzon> Yeah it's something that would be better supported at the compiler level, but it won't happenm
<FromGitter>
<rukkiddo> i dont really understand why, but the same request was also rejected by ruby community
<FromGitter>
<rukkiddo> I thought it is convenient for some cases but it is ok
<FromGitter>
<Blacksmoke16> arbitrary objects arent as common in crystal land
<FromGitter>
<Blacksmoke16> plus there would be some confusion as to how exactly this would work
<FromGitter>
<Blacksmoke16> i.e. `{a}` should that be expanded to a named tuple/hash, or is a tuple of one element
<FromGitter>
<rukkiddo> yeah current literals are deal breaker in this case
<FromGitter>
<rukkiddo> still I will agree to disagree I guess
<FromGitter>
<Blacksmoke16> i mean dont get me wrong i like the feature in TS/JS land, but i dont really find myself needing as often in Crystal land
eax has joined #crystal-lang
eax has quit [Client Quit]
eax has joined #crystal-lang
eax has quit [Client Quit]
eax has joined #crystal-lang
<FromGitter>
<watzon> Same, tbh I would much rather have named tuple destructuring
<FromGitter>
<watzon> Or indirect initialization be supported
<FromGitter>
<watzon> I don't get why it isn't right now
eax has quit [Client Quit]
eax has joined #crystal-lang
Human_G33k has quit [Ping timeout: 240 seconds]
Human_G33k has joined #crystal-lang
<FromGitter>
<alexherbo2> is there a way to transfer `stdin` to a named pipe (fifo)?
<FromGitter>
<oprypin:matrix.org> @alexherbo2: i dont know if it will work but try `STDIN.reopen(that)`
<FromGitter>
<alexherbo2> the use case is to send a command (in a session of an editor) to open a fifo, which have access to the stdin from the command-line
<FromGitter>
<oprypin:matrix.org> @alexherbo2: interesting use case. but can't you *just* launch it with Process.new?
<FromGitter>
<alexherbo2> @oprypin:matrix.org the editor can only access the fifo
<FromGitter>
<oprypin:matrix.org> you just want `Process.new(stdin: :pipe)`
<FromGitter>
<oprypin:matrix.org> if creating a *named* pipe is not one of your requirements, (rather just a way to achieve goal), i'm telling you that your goal has easier ways to achieve