ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
DTZUZU_ has quit [*.net *.split]
astronavt has quit [*.net *.split]
sorcus has quit [*.net *.split]
sagax has quit [*.net *.split]
DTZUZU_ has joined #crystal-lang
sagax has joined #crystal-lang
astronavt has joined #crystal-lang
sorcus has joined #crystal-lang
<FromGitter> <Blacksmoke16> so heres an interesting problem, i have a class `Some::Namespace::Foo`, that im using as a class and namespace. I'm trying to create `abstract class Some::Namespace::Foo::Bar` and have `Some::Namespace::Foo` inherit from it
<FromGitter> <Blacksmoke16> but theres a catch-22 here in that you can define `Bar` before `Foo` as it'll treat it as a module, but you can define `Foo` before `Bar` or it won't know about the superclass its trying to inherit from
<FromGitter> <Blacksmoke16> can't define*
<FromGitter> <Blacksmoke16> i also can't define `Foo` before hand or you run into a superclass mismatch
<FromGitter> <Blacksmoke16> prob have to go with a module in this case i guess
aquijoule__ has joined #crystal-lang
aquijoule_ has quit [Ping timeout: 246 seconds]
chachasmooth has quit [Ping timeout: 258 seconds]
chachasmooth has joined #crystal-lang
lchapoguzman has joined #crystal-lang
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 252 seconds]
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #crystal-lang
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [*.net *.split]
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 268 seconds]
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 268 seconds]
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 265 seconds]
DTZUZU_ has joined #crystal-lang
<FromGitter> <erdnaxeli:cervoi.se> indeed I don't think there is a solution
<FromGitter> <erdnaxeli:cervoi.se> but I don't see neither a case for that :p
DTZUZU has quit [Ping timeout: 260 seconds]
hendursaga has quit [Ping timeout: 240 seconds]
hendursaga has joined #crystal-lang
Olbat has quit [Quit: Bye ...]
oz has quit [*.net *.split]
oz has joined #crystal-lang
snapcase has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
snapcase has joined #crystal-lang
daemonwrangler has joined #crystal-lang
PixeLInc has quit [*.net *.split]
justinmcp has quit [*.net *.split]
duane has quit [*.net *.split]
Nekka has quit [*.net *.split]
Xeago has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
straight-shoota has quit [*.net *.split]
DeBot has quit [*.net *.split]
Liothen has quit [*.net *.split]
deavmi has quit [*.net *.split]
HumanG33k has quit [*.net *.split]
asterite has quit [*.net *.split]
markmarkmark has quit [*.net *.split]
xybre-libera has quit [*.net *.split]
bougyman has quit [*.net *.split]
hendursaga has quit [*.net *.split]
Flipez has quit [*.net *.split]
V[llf] has quit [*.net *.split]
ua has quit [*.net *.split]
DTZUZU_ has quit [*.net *.split]
Vexatos has quit [*.net *.split]
Stephie has quit [*.net *.split]
yxhuvud has quit [*.net *.split]
hendursaga has joined #crystal-lang
DTZUZU_ has joined #crystal-lang
yxhuvud has joined #crystal-lang
Vexatos has joined #crystal-lang
Liothen has joined #crystal-lang
asterite has joined #crystal-lang
V[llf] has joined #crystal-lang
Flipez has joined #crystal-lang
ua has joined #crystal-lang
straight-shoota has joined #crystal-lang
bougyman has joined #crystal-lang
HumanG33k has joined #crystal-lang
xybre-libera has joined #crystal-lang
Stephie has joined #crystal-lang
deavmi has joined #crystal-lang
DeBot has joined #crystal-lang
markmarkmark has joined #crystal-lang
PixeLInc has joined #crystal-lang
dostoyevsky has joined #crystal-lang
justinmcp has joined #crystal-lang
Nekka has joined #crystal-lang
duane has joined #crystal-lang
Xeago has joined #crystal-lang
lchapoguzman has quit [*.net *.split]
chachasmooth has quit [*.net *.split]
astronavt has quit [*.net *.split]
sagax has quit [*.net *.split]
sorcus has quit [*.net *.split]
lchapoguzman has joined #crystal-lang
chachasmooth has joined #crystal-lang
astronavt has joined #crystal-lang
sagax has joined #crystal-lang
sorcus has joined #crystal-lang
badeball has quit [*.net *.split]
badeball has joined #crystal-lang
<FromGitter> <alexherbo2> Is there an equivalent to Ruby `then` (functional `tap`)?
lchapoguzman has quit [Quit: Leaving]
markmarkmark has quit [Ping timeout: 246 seconds]
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 246 seconds]
markmarkmark has joined #crystal-lang
Flipez has quit [Quit: The Lounge - https://thelounge.github.io]
<FromGitter> <erdnaxeli:cervoi.se> it could be easily implemented, but I must be missing the point: https://carc.in/#/r/b7l4
<FromGitter> <erdnaxeli:cervoi.se> ok it is useful when you want to use the value but not as a receiver as I did
<FromGitter> <naqvis> you don't have to write a macro for that, `try` does the same thing
<FromGitter> <naqvis> difference between `tap` and `try` is that, `tap` returns self after yielding, while `try` returns the result of block. which should be what your posted link of ruby doc states
<FromGitter> <naqvis> `try` comes with added benefit of `Nil` safetey, as it has been overridden by `Nil` and won't yield on `Nil` instance
<FromGitter> <erdnaxeli:cervoi.se> you're right, `try` does the same thing as `then`
<straight-shoota> yxhuvud, regarding https://github.com/crystal-lang/crystal/issues/10740#issuecomment-847072602, your don't need anything to show
<straight-shoota> I think it would already be a nice talk about possibilities and approaches
DTZUZU has joined #crystal-lang
<yxhuvud> perhaps, but I still want to be further ahead than I am.
<straight-shoota> okay
DTZUZU_ has quit [Ping timeout: 260 seconds]
<yxhuvud> one thing to note though, is having automatic scope based joining of fibers makes the tests much nicer. https://github.com/yxhuvud/nested_scheduler/blob/main/spec/io_uring_context_spec.cr#L94 (and other specs in same file) is so much nicer than the original spec I grabbed from the crystal repo :)
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 265 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <RespiteSage> @alexherbo2 You can use `#try`: https://carc.in/#/r/b7nw
<FromGitter> <RespiteSage> It's semantically a bit weird for that purpose, but it works.
<FromGitter> <erdnaxeli:cervoi.se> I think it is ok semantically. It means "try to do this, unless self is nil then stop the chain.
DTZUZU_ has quit [Read error: Connection reset by peer]
DTZUZU_ has joined #crystal-lang
<FromGitter> <RespiteSage> Yeah, I just mean that it's not quite the same semantically as a hypothetical `#then`. I agree that `#try` makes sense for its intended purpose, it's just that using it to chain operations on a non-nilable object isn't its intended purpose.
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 252 seconds]
justinmcp has quit [*.net *.split]
PixeLInc has quit [*.net *.split]
duane has quit [*.net *.split]
Nekka has quit [*.net *.split]
Xeago has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
dostoyevsky has joined #crystal-lang
duane has joined #crystal-lang
PixeLInc has joined #crystal-lang
Xeago has joined #crystal-lang
johnny101 has joined #crystal-lang
Nekka has joined #crystal-lang
justinmcp has joined #crystal-lang
early has quit [Ping timeout: 240 seconds]
ua has quit [Ping timeout: 240 seconds]
early has joined #crystal-lang
ua has joined #crystal-lang
<FromGitter> <Daniel-Worrall> Any built in way to turn an Int representation of an IP and turn it into a String?
<FromGitter> <RespiteSage> Like `19216811_i8`?
<FromGitter> <RespiteSage> 1) `_i32`
<FromGitter> <oprypin:matrix.org> @Daniel-Worrall: seems there's not. all usages are private. https://github.com/crystal-lang/crystal/blob/5999ae29beacf4cfd54e232ca83c1a46b79f26a5/src/socket/address.cr#L178 . if you're feeling risky, maybe u could call `LibC.inet_pton` yourself
<straight-shoota> eh, how's that supposed to work?
<FromGitter> <Daniel-Worrall> I'm just translating https://www.codewars.com/kata/52e88b39ffb6ac53a400022e
<FromGitter> <Daniel-Worrall> Ruby has `IPAddr.new n, Socket::AF_INET`
<straight-shoota> Okay, so you really mean the Int32 representation, not a string-like integer
<FromGitter> <Daniel-Worrall> Int32 -> String
<straight-shoota> that's what I assumed from the literal value
<FromGitter> <Daniel-Worrall> Yeah, I didn't mean the literal posted above
zorp has joined #crystal-lang
<straight-shoota> unsafe_as(StaticArray(UInt32, 4)) should give you a collection of the individual octets
<FromGitter> <Daniel-Worrall> but I'm just wondering about any inbuilt methods
<FromGitter> <Daniel-Worrall> I mean, I can do it pretty easily
<FromGitter> <Daniel-Worrall> Gitter being a bit bad today
<straight-shoota> Not that I'm aware of
<straight-shoota> Can't think of a real-world use case either
<FromGitter> <Daniel-Worrall> all good
<straight-shoota> for the record: a custom implementation should rather use IO::ByteFormat::NetworkEndian.encode than unsafe_as :D
hightower2 has joined #crystal-lang
<hightower2> Hey are we aware of break not returning break value inside while loop? I mean https://play.crystal-lang.org/#/r/b7po
<hightower2> is this intended or?
<FromGitter> <Blacksmoke16> should be resolved in next release
ua has quit [Ping timeout: 265 seconds]
<hightower2> mmm.. ok spent good 2 hours trying to find the issue... well, nice to see our noble friend HertzDevil stepped in :)
<hightower2> ok gonna replace it for now with loop do, and just break as the first next line if while condition is no longer true
<hightower2> thanks!
<FromGitter> <Blacksmoke16> could you use a higher level iterator?
<hightower2> this code already is a code which I turned around to avoid using loop labels which are unsupported
<hightower2> and spent a bunch of time doing that... so, just want to fix this and forget for the time being :)
ua has joined #crystal-lang
<hightower2> @Blacksmoke16 what's the likelyhood of that 'undefined' idea of yours getting accepted? It would really be cool to have e.g. a declaration of @x = "test", and then define initialize( x = undefined ), and as long as it remains as undefined (as opposed to nil), it gets set to the default from class level
<hightower2> likelihood*
<FromGitter> <Blacksmoke16> that's not how i was picturing it to work
<FromGitter> <Blacksmoke16> but it's possible, prob just not a high priority atm
<hightower2> Can you remind me of issue# pls, can't find it in history
<FromGitter> <Blacksmoke16> there isn't an issue, was just on the forums
<hightower2> aha ok, that explains it :)
<FromGitter> <Blacksmoke16> but the idea was mainly focused towards method overloading
<FromGitter> <Blacksmoke16> e.g. overloading `self.new`
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60ad7e0814d9cd234a5adeac]
<FromGitter> <Blacksmoke16> like this
zorp has quit [Ping timeout: 265 seconds]
oz has left #crystal-lang ["WeeChat 3.1"]
<hightower2> right, right, but the final "fallback" would be getting the default from the declaration at class level I would think
<FromGitter> <Blacksmoke16> not quite, in this case it would be the default on `@message` within the initializer
<hightower2> sure, got it, but what would/could happen if you leave it undefined in initialize as well?
<FromGitter> <wyhaines> Is the purpose there just to avoid overloading `self.from_range`?
<hightower2> would be very useful to use the default from the declaration
<FromGitter> <Blacksmoke16> @wyhaines mainly to avoid needing to duplicate the same defaults for every overload
<FromGitter> <Blacksmoke16> and im not sure, i was thinking it would be a compile time error
<FromGitter> <Blacksmoke16> if you use it with a variable that doesnt have a default
<FromGitter> <Blacksmoke16> maybe it could also look at ivar def but :shrug: too far ahead to know