ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Remote host closed the connection]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
skyfex has joined #zig
<skyfex> @andrewrk: Little-endian packed struct tested, and typed enums both tested and works well for me :)
<andrewrk> great!
<andrewrk> and now the biggest issue is the reserved field thing right?
<skyfex> Hah, yes, I was just about to mention that :)
<skyfex> Also, it's a bit annoying to type out the whole enum value. It'd be great if I could type just "Connected" instead of "nrf.PinCnfInput.Connected"
<skyfex> I haven't checked the issues, but I think it might have been discussed already?
<andrewrk> I think there is not a discussion for that
<skyfex> K, gotta leave now, but maybe I'll open an issue for that later. I'm not sure if it's in the Zig style, but it'd be good to get some comments I suppose
<andrewrk> sure, might as well document the reasoning in either case
<skyfex> I see it as type-inference when declaring variables: not strictly necessary, could sometimes create a bit confusion, but generally worth it. Using enums should really be encouraged over non-descriptive integers or booleans
<andrewrk> encouraging enum use is a good argument for the feature
<andrewrk> I was thinking it might make sense to, for example, in switches, allow `.Connected` and the `.` would implicitly be accessing the type you switched on
<andrewrk> maybe also for function calls with enum parameters
<skyfex> it would make sense with this proposal as well: https://github.com/zig-lang/zig/issues/661
<andrewrk> good point
<andrewrk> really good point
<andrewrk> and for this one: https://github.com/zig-lang/zig/issues/649
<andrewrk> I think I'm sold
<aiwakura> hi andrewrk
<aiwakura> let's the madness begin
<andrewrk> hi aiwakura
<aiwakura> so %return -> try, correct?
<andrewrk> correct
<andrewrk> and ` %% ` -> ` catch `
skyfex_ has joined #zig
<GitHub108> [zig] AndreaOrru pushed 1 new commit to master: https://git.io/vNLuZ
<GitHub108> zig/master 98a95cc Andrea Orru: exit, createThread for zen
<andrewrk> skyfex, thanks for the writeup
arBmind has joined #zig
arBmind has quit [Quit: Leaving.]
jjido has joined #zig
jjido has quit [Read error: Connection reset by peer]
jjido has joined #zig
jjido has quit [Read error: No route to host]
jjido has joined #zig
<aiwakura> andrewrk are you going to get rid of ?? too?
<andrewrk> I have no plans in that regard
<andrewrk> good point though, it's an example of non-keyword control flow
<andrewrk> I believe C# has a precedent for ?? having the same behaivor as zig
jjido has quit [Read error: Connection reset by peer]
jjido has joined #zig
arBmind has joined #zig
jjido has quit [Read error: No route to host]
jjido has joined #zig
<jjido> Any chance that a %% b would be allowed again ? I don't feel too good writing a catch b when b is not a closure on the error
<andrewrk> jjido, actually it is a closure on the error: a catch |err| b
<andrewrk> the |err| is optional
<andrewrk> I'm responding to your comment on #632
<jjido> andrewrk: yes it is but the syntax hides it (unfortunately)
<andrewrk> jjido, can you elaborate? what do you mean the syntax hides it?
<jjido> While b expands to |err| b internally, when a human reads to program they see a catch b. That is what is commonly called "syntactic sugar" and in this case it makes the program harder to understand instead of easier
<andrewrk> jjido, let me make sure you understand this change
<andrewrk> `
<andrewrk> `%%` became `catch`. no other differences
<jjido> If a %% b is not available I would write a catch |_| b
<andrewrk> that is valid
<jjido> The difference is clear
<andrewrk> are you suggesting the |_| should be required?
<jjido> Yes that would make more sense with the catch keyword
<andrewrk> ok I see what you are saying now
<andrewrk> because without the |_| it sounds like you are catching `b`
<andrewrk> I think that is worth considering
jjido has quit [Read error: Connection reset by peer]