<FromGitter>
<vladfaust> Well, no. Accessing the `@deque` after `@capacity` changed raises
<FromGitter>
<bew> What do you mean by "dynamic capacity"? "I could just add" you mean, adding it yourself to Channel? (I don't think that's a good idea..)
<FromGitter>
<vladfaust> Yeah, that's what I want
<FromGitter>
<bew> Hmm
<FromGitter>
<vladfaust> Current fiber blocks when buffered channel is full
<FromGitter>
<bew> Use a big buffer?
<FromGitter>
<vladfaust> I want that channel to change size dynamically, so `full?` returns different result in different moments of time
<FromGitter>
<vladfaust> I think `def size; @queue.size; end` would work for me now
<FromGitter>
<vladfaust> No, it would not
<FromGitter>
<vladfaust> I don't understand why queue raises after capacity changes...
<FromGitter>
<bew> @vladfaust I'd suggest creating your own Channel impl (with `< Channel(T)`) similar to `Channel::{Buffered Unbuffered}` and start playing from there
<FromGitter>
<bew> This way you don't break existing code, and you can do your own things
<FromGitter>
<vladfaust> That's not the attitude I'm used to
<FromGitter>
<vladfaust> It also works with both classes and structs. The only thing that it crashes on is `Nil`
<FromGitter>
<vladfaust> Is that a **BUG**?
<FromGitter>
<vladfaust> #Bug?
<FromGitter>
<michalvalasek> hello all! i'm a noob here and having problem running any crystal program. I'm on a mac (Mojave). When i run `crystal run src/my_app.cr`I get ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ca9ea6e759abc043c7f28f5]
<FromGitter>
<michalvalasek> is there a way to fix this?
<FromGitter>
<vladfaust> @michalvalasek you should have `libcrypto` installed on your machine
<FromGitter>
<vladfaust> Which is kinda obvious from the message
<FromGitter>
<vladfaust> Try something like `whatever-mac-apt-alternative install libcrypto-dev`
<FromGitter>
<michalvalasek> that's of course what it tried first
<FromGitter>
<michalvalasek> no luck tho, no such package on homebrew (`libcrypto` or `libcrypto-dev`)
<FromGitter>
<vladfaust> Should either find a way to install that package, or symlink to an existing one
<FromGitter>
<michalvalasek> yea, no such package in my `/usr/local/lib` either
DmitryBochkarev has quit [Ping timeout: 268 seconds]
<FromGitter>
<michalvalasek> ok, thanks anyway
<FromGitter>
<vladfaust> I did not help, I guess 😅
<FromGitter>
<vladfaust> There are some mac users here, though
<FromGitter>
<michalvalasek> btw. is there some REPL for crystal?
<FromGitter>
<michalvalasek> i found `icr`, installed it via shards in my project, but dunno how to run it :)
<FromGitter>
<michalvalasek> there doesn't seem to be an integrated first-party REPL directly in crystal
<FromGitter>
<vladfaust> It's better to install it system-wide
<FromGitter>
<michalvalasek> i'm a total noob on a quest into crystal, appreciate your help
<FromGitter>
<michalvalasek> i'm rewriting an old rails API into something more performant, so I thought crystal might work quite nice here
<FromGitter>
<vladfaust> Indeed
<FromGitter>
<vladfaust> IIRC it was asked before, but is there a fast way to `select` with priorities?
<FromGitter>
<vladfaust> Just curious, I have plan B
<FromGitter>
<vladfaust> You should always have plan B in Crystal :D
<FromGitter>
<vladfaust> Am I right, @Blacksmoke16? :p
<tsundsted>
@michalvalasek make sure you have openssl installed. you may need to install a version via homebrew
DmitryBochkarev has joined #crystal-lang
<tsundsted>
it seems to be a common problem on mojave (i'm still running high sierra)
DmitryBochkarev has quit [Ping timeout: 250 seconds]
<FromGitter>
<vladfaust> Well, the `when` defined earlier has higher precedence: https://carc.in/#/r/6ocb
tsundsted has quit [Ping timeout: 256 seconds]
_whitelogger has joined #crystal-lang
<FromGitter>
<dscottboggs_gitlab> oh wow, the implementation of `forward_missing_to` has changed...
<FromGitter>
<Blacksmoke16> @vladfaust indeed
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Remote host closed the connection]
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Max SendQ exceeded]
DmitryBochkarev has joined #crystal-lang
fanta7531 has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 268 seconds]
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 244 seconds]
DmitryBochkarev has joined #crystal-lang
<FromGitter>
<ryanstout> Question if anyone knows. In the past I had seen a shard that had its own annotations. I'm working on a shard that lets you expose crystal code to ruby via ffi on the ruby side. Is there any docs for custom annotations? Or am I better off using macros?
<FromGitter>
<ryanstout> (in this specific case, I want to mark a struct as something that gets generated using FFI::Struct on the ruby side also)
<FromGitter>
<dscottboggs_gitlab> *annotation but yeah
<FromGitter>
<ryanstout> @Blacksmoke16 cool, thanks a bunch.
<FromGitter>
<ryanstout> I'll check it out
<FromGitter>
<Blacksmoke16> > (in this specific case, I want to mark a struct as something that gets generated using FFI::Struct on the ruby side also) ⏎ ⏎ this might be tricky as you'll face the same problem as https://github.com/crystal-lang/crystal/issues/7274
<FromGitter>
<Blacksmoke16> er maybe not, i misread that
<FromGitter>
<Blacksmoke16> np
<FromGitter>
<ryanstout> yea, I think I could do something like: ⏎ ⏎ ```expose do ⏎ struct Something ⏎ .. ⏎ end ⏎ end``` ⏎ ⏎ (```expose``` is a placeholder, still thinking through the api) I could build the above with a macro that takes a block, but I was thinking annotations make for a better looking api I think. [https://gitter.im/crystal-lang/crystal?at=5caa282e93fb4a7dc2ed2eb4]
<FromGitter>
<Blacksmoke16> whats the goal specifically? like what would you be doing within that block?
<FromGitter>
<ryanstout> generating the FFI::Struct file on the ruby side, then returning the crystal struct AST back to the compiler
<FromGitter>
<ryanstout> the idea is when you compile it would write out a file with all of the ruby ffi code needed to bridge.
<FromGitter>
<bew> @dscottboggs_gitlab "forward_missing_to has changed" how so?
<FromGitter>
<Blacksmoke16> so basic would want to get an array of all structs that have a given annotation, then do some logic and output a file?
<FromGitter>
<ryanstout> @Blacksmoke16 (still early, might not work out in practice)
<FromGitter>
<Blacksmoke16> actually give me a few hours, turns out its not that hard to add
<FromGitter>
<Blacksmoke16> got types working
DmitryBochkarev has quit [Ping timeout: 268 seconds]
<FromGitter>
<malkomalko> Is there anyway to force a return signature to be the abstract class if a method call happens to only return one of the types inheriting from the abstract class?
<FromGitter>
<malkomalko> Looks like the compiler infers the explicit class instead of the base abstract class even if I explicitly mark the return signature as the base abstract class until the method I'm writing returns more than one of the classes inheriting from the abstract class. Gosh, that's a mouthful!
sagax has quit [Read error: No route to host]
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<malkomalko> nevermind, figured it out by casting with `.as(AbstractClass)`