<FromGitter>
<dscottboggs_gitlab> yeah I just didn't really have anything profound to say about it haha
confact has joined #crystal-lang
<FromGitter>
<dscottboggs_gitlab> thank you
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<Blacksmoke16> made it to a friday at least :P
<FromGitter>
<dscottboggs_gitlab> ugh... src/*compiler*/crystal/tools... I kept looking in `src/crystal` and being like "wtf there's nothing here" haha
confact has quit [Ping timeout: 252 seconds]
<FromGitter>
<Blacksmoke16> yea
<FromGitter>
<dscottboggs_gitlab> Yeah, gotta get my cars up for sale this weekend, the busses suck around here
<FromGitter>
<Blacksmoke16> its *magic*
<FromGitter>
<Blacksmoke16> :(
<FromGitter>
<dscottboggs_gitlab> plz no magic lol
<FromGitter>
<dscottboggs_gitlab> OMG that file is 4800 lines long wtf
<FromGitter>
<Blacksmoke16> theres the magic
<FromGitter>
<Blacksmoke16> lol
<FromGitter>
<dscottboggs_gitlab> it's not magic it's just a damn novel
<FromGitter>
<dscottboggs_gitlab> I get really annoyed that ⏎ ⏎ ```some_method call: "with", ⏎ many: "params", ⏎ too: "long", ⏎ to_fit: "on one line"``` ⏎ ⏎ and have been meaning to submit a PR but...jeeze...that's one hell of a complicated module. [https://gitter.im/crystal-lang/crystal?at=5cb12f1f759abc043cb119a0]
<FromGitter>
<Blacksmoke16> ha i found a bug i think that been annoying me
<FromGitter>
<dscottboggs_gitlab> it was commas that separated enum members, I thought? Yes @Blacksmoke16 mentioned that the formatter converts them to semicolons earlier thanks though
<FromGitter>
<j8r> it was ether new line, semicolon or comma (yes sorry not colon)
<FromGitter>
<j8r> and even space (bug fixed for 0.28.0)
<FromGitter>
<Blacksmoke16> yes commas went to semicolons
Jenz_ has joined #crystal-lang
Jenz_ is now known as Jenz
<Jenz>
Crystal stdlib spec is really cool
<Jenz>
There's just some small features I'm missing
<FromGitter>
<Blacksmoke16> heres a question, say im building a binary that will be added to a project's bin directory on install
<FromGitter>
<Blacksmoke16> and i want to require that projects files within the binary
<FromGitter>
<Blacksmoke16> im thinking you cant because you dont have the files when the binary is built
druonysus has quit [*.net *.split]
<FromGitter>
<Blacksmoke16> well shit, whats plan b
<FromGitter>
<Blacksmoke16> hmm
<FromGitter>
<Blacksmoke16> suppose i could have a command to generate a file in the project that can be ran to generate the documentation, not as optimal but oh well
olbat has quit [Ping timeout: 246 seconds]
olbat has joined #crystal-lang
Jenz has quit [Quit: leaving]
oz has quit [Ping timeout: 264 seconds]
oz has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 246 seconds]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
lucasb has joined #crystal-lang
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
DTZUZO has quit [Ping timeout: 246 seconds]
DmitryBochkarev has joined #crystal-lang
alexherbo2 has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]
teardown has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]
<FromGitter>
<elorest> Were appending bytes without issue to an existing IO there.
<FromGitter>
<ryanstout> ok, so maybe .write is the way to go then
<FromGitter>
<ryanstout> thanks
<FromGitter>
<elorest> For sure.
<FromGitter>
<elorest> Now back to my Taxes :(
<FromGitter>
<ryanstout> best of luck
<FromGitter>
<ryanstout> my small company's were 175 pages this year :-)
<FromGitter>
<elorest> Crazy. I just use turbotax but between home sale, investment property sale, IRA, moving states, 1099's, it's becoming difficult.
<FromGitter>
<ryanstout> yea
<FromGitter>
<ryanstout> one other question, is there a good way to do fiber local variables?
<FromGitter>
<r00ster91> A local variable inside of a fiber?
<FromGitter>
<ryanstout> like ruby thread locals: ```Thread.current[:something] = 5```
<FromGitter>
<ryanstout> but for fibers
<FromGitter>
<ryanstout> or a good way to accomplish the same thing
<FromGitter>
<elorest> local variables inside of fibers should only be accessable from within that block, to begin with. I use channels to send recieve information from fibers.
<FromGitter>
<ryanstout> maybe I should explain my use case. I've got a usb device I'm interacting with where commands get sent in parts all with the same transaction_id passed along. Theres different methods to build up a transaction across a few classes (it's complicated) My goal was to have multiple transactions being able to run at once across more than one fiber. So my idea was to use something like a thread local to keep
<FromGitter>
... track of the current transaction id. (I realize I should probably pass it around, but this would clean up the API quite a bit at the cost of less clarity on that detail)
<FromGitter>
<ryanstout> anyway, I can figure something out, was trying to avoid passing transaction id's through every method, but that might be the clearest
<FromGitter>
<ryanstout> @dscottboggs_gitlab maybe I'm not explaining it right. Have you used thread locals in or similar?
<FromGitter>
<elorest> @ryanstout Maybe we're not understanding you but a local variable should remain in the fiber and be callable from inside it.
<FromGitter>
<ryanstout> @elorest so so the idea would be to have it where any of my code could grab the current transaction_id for that fiber (since there might be more than one transaction going on at once, but only one in each fiber)
<FromGitter>
<dscottboggs_gitlab> I haven't used thread locals before, if they mean something other than a variable local to the thread then that could be our misunderstanding
<FromGitter>
<ryanstout> but from whereever, not just the scope where I setup a local
<FromGitter>
<dscottboggs_gitlab> Oh I see
<FromGitter>
<dscottboggs_gitlab> perhaps you could implement a struct which internally handles spawning and stores the data you're referring to next to the reference to the fiber?
<FromGitter>
<ryanstout> I could maybe create a lookup using ```Fiber.current``` as the key
<FromGitter>
<ryanstout> yea
<FromGitter>
<ryanstout> thats probably the best way to do it
<FromGitter>
<ryanstout> thanks
<FromGitter>
<dscottboggs_gitlab> np
<FromGitter>
<dscottboggs_gitlab> that would be a nice feature -- perhaps there could be a module which could be included to create custom structs of data associated with a fiber.
<FromGitter>
<elorest> Ok. My understanding of thread locals was that ruby handled threads differently and therefore this was necessary to saparate variables between threads.
<FromGitter>
<elorest> In your case I would probably just push the information along with the fiber id to a global hash of some type.
<FromGitter>
<ryanstout> thanks for the help. I've got something I think will work. thanks
<FromGitter>
<dscottboggs_gitlab> It's cool I just think it would be a cool feature for the language and was trying to figure out some way it could work easily for everyone.
<FromGitter>
<dscottboggs_gitlab> Crystal's MT and concurrency system feels to me like it could use some work
<FromGitter>
<ryanstout> making concurrency easy is something CS had been trying to do for 50+ years now. :-)
<FromGitter>
<ryanstout> some day
<FromGitter>
<dscottboggs_gitlab> yup
<FromGitter>
<ryanstout> I'm happy having evented io without promises or async/await
<FromGitter>
<straight-shoota> > I could maybe create a lookup using ```Fiber.current``` as the key ⏎ ⏎ Yeah, that's the recommended approach. You could also reopen `Fiber` and add a custom instance var. But using the current fiber as a key is probably the best.
<FromGitter>
<ryanstout> @straight-shoota thanks
<FromGitter>
<ryanstout> sorry, running into a lot of questions today I can't find the answers to anywhere. Is there a way to get the underlying type of an enum at compile time? (doing a .read_bytes from an io)
<FromGitter>
<ryanstout> generically for any enums
tsundsted has joined #crystal-lang
<FromGitter>
<bajro17> does anyone plan to record tutorials for crystal lang and put on udemy?
moei has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 250 seconds]
<FromGitter>
<dscottboggs_gitlab> Does anyone know a way to debug crystal code *with* watched variables?