Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:47
    HertzDevil edited #11537
  • 17:36
    straight-shoota milestoned #11515
  • 17:36
    straight-shoota synchronize #11343
  • 17:34
    straight-shoota closed #11512
  • 17:13
    HertzDevil labeled #11537
  • 17:13
    HertzDevil labeled #11537
  • 17:13
    HertzDevil opened #11537
  • 15:44
    straight-shoota edited #11536
  • 15:43
    straight-shoota labeled #11536
  • 15:43
    straight-shoota labeled #11536
  • 15:43
    straight-shoota labeled #11536
  • 15:43
    straight-shoota labeled #11536
  • 15:43
    straight-shoota opened #11536
  • 12:51
    BlobCodes opened #11535
  • 12:06
    gballet synchronize #9848
  • 09:33
    straight-shoota closed #11521
  • 09:29
    straight-shoota labeled #11534
  • 09:29
    straight-shoota labeled #11534
  • 09:25
    straight-shoota labeled #11533
  • 09:25
    straight-shoota labeled #11533
From IRC (bridge bot)
@FromIRC
<riza> or you can use a macro to build out the guts of the class
Ary Borenszweig
@asterite
@suskeyhose:matrix.org you can break from a block where there's no while at all. The break goes a GOTO to the end of the called method (done with LLVM)
mfiano
@mjfiano:matrix.org
[m]
Thanks
From IRC (bridge bot)
@FromIRC
George Dietrich
@Blacksmoke16
:grimacing:
im sure there's a better way...
From IRC (bridge bot)
@FromIRC
<raz> i wish... but all these things can be nil and i can't change it (protobuf). i tried rewriting it in a bunch of ways. but it seems my only choices are spreading it out over 6 variable assignments or, well, this.
mfiano
@mjfiano:matrix.org
[m]
oh dear
George Dietrich
@Blacksmoke16
if you know all of this stuff is not nilable is there a reason its nilable in the first place?
im not super familiar with protobuf, but isn't the idea that you dont make everything nilable?
From IRC (bridge bot)
@FromIRC
<raz> well it's a "oneof". request.item.obj tells me which attr is set, so i can then look it up as request.item[ request.item.obj ]. i'm afraid all of these things are legally nil'able in this situation, but i'm still trying to find a better way
oprypin
@oprypin:matrix.org
[m]
heh could be a union of namedtuples
From IRC (bridge bot)
@FromIRC
<raz> https://carc.in/#/r/blw8 - this version also works.
oprypin
@oprypin:matrix.org
[m]
(with exactly one key each)
From IRC (bridge bot)
@FromIRC
<raz> but that's what my complain from earlier was about, i don't find it exactly clearer to read
George Dietrich
@Blacksmoke16
are you the only one using these types?
could leverage getter!
just would have to know when to do .item? versus .item
From IRC (bridge bot)
@FromIRC
<raz> hmmm that sounds like an idea. i may try a pr on protobuf.cr
George Dietrich
@Blacksmoke16
a quick look suggests they already support that
required ones are not nilable, optional are
From IRC (bridge bot)
@FromIRC
<raz> yea, but in proto3 everything is optional (don't get me started...)
George Dietrich
@Blacksmoke16
welp
From IRC (bridge bot)
@FromIRC
<riza> might as well write in node then
<raz> heureka.not_nil!
<raz> that was actually easy to add... phew
<raz> i'll just add me a helper for that has lookup, too, then it'll be pretty
<raz> hash*
<hightower2> Seems a couple presentations are not among the recordings.. e.g. Ary's or btate's.. What's up with that?
<hightower2> (from the crystal conf, of course)
<hightower2> ah could be in main track
mfiano
@mjfiano:matrix.org
[m]
I have a few types which all include some partial types. These modules are never intended to be seen be the user, such as in generated documentation pages with crystal doc, but I can't exactly make them private either if I want to include them in other modules/types, and protected doesn't seem to work on modules, so I'm not really sure if Crystal has a solution for me...
The mixins are purely for DRY/maintenance reasons
George Dietrich
@Blacksmoke16
# :nodoc:
mfiano
@mjfiano:matrix.org
[m]
Any ideas?
Oh hmm, that might be what I'm looking for :)
mfiano
@mjfiano:matrix.org
[m]
That does work, however, perhaps it's me being picky but it'd be nice if the types that include a :nodoc: module didn't generate docs with references to the hidden module, as it currently does with "Instance methods inherited from module..."
George Dietrich
@Blacksmoke16
you'd probably need to have public methods in each type that delegate to the module
otherwise the docs are correct, those methods dont actually live in the type, they come from that module
From IRC (bridge bot)
@FromIRC
<straight-shoota> I think the docs generator is not handling things like this very nicely
<straight-shoota> If you want this mixin to be completely invisible, maybe you could just use a macro that generates these methods.
mfiano
@mjfiano:matrix.org
[m]
I see. This is not a big deal really, and delegates/macro would be more trouble than its worth.
Thanks for the pointers. I'm happy enough with :nodoc:
George Dietrich
@Blacksmoke16
@straight-shoota related to crystal-lang/crystal#10977, so is the current output actually correct?
From IRC (bridge bot)
@FromIRC
<straight-shoota> Yes, the behaviour is correct and as expected. The documentation is just wrong.
George Dietrich
@Blacksmoke16
hm, whats the reasoning when not using a buffered channel that the output is
Before send 1
Before send 2
1
2
Before send 3
After send
3
shouldnt the first send cause the receive to print the value?