Volker. I don't know how to reply to what you state. I'm open to listen or read any thoughts you have about not using bool to int.
El vie, 20 oct 2023 a las 12:20, Volker Dobler (<dr.volker.dob...@gmail.com>) escribió: > I use 1 a lot and 4 (or the suggested bool<-->int conv) never. > I have no idea what you want to express with 2 > and 4 addresses a kind of problem that has no > simple solution like a one-line function. > > V. > > On Friday, 20 October 2023 at 15:12:06 UTC+2 Victor Giordano wrote: > >> Hello fellow gopherships... ¿How you doing? >> >> Hope just fine! >> >> A week ago I proposed to allow conversion from bool to int, assuming >> false to 0 and true to be 1. This was the proposal >> <https://github.com/golang/go/issues/63544> and I do appreciate a lot >> the polite responses from Ian. >> >> I pick my pike and dig into... the discussion... trying to understand >> what was the force or the motivation that refuses the proposal. >> >> I Found two interesting comments: >> >> - Adg stament >> <https://github.com/golang/go/issues/9367#issuecomment-143128337> >> - Commander statement >> <https://groups.google.com/g/golang-nuts/c/wyuBhAb1Rzk/m/i3mzAg5zoikJ> >> >> And what i perceive is that the cons is: *It may harm readability.* >> >> Well... If that is the case... (because, that is what I understood, and >> forget me if I'm wrong!) I have some points to put into the table if you >> allow... please, do not take it hard... I'm trying to make *an statement* >> . >> >> 1) One line Swapping >> >> a, b := 1, 2 // I never use this.. I always forget if the 1 go to the a >> and the 2 go to b or vice-versa.. (Like now!) >> >> I do like to write three lines instead of one... >> >> 2) Block scope, not per iteration scope >> <https://go.dev/blog/loopvar-preview> >> >> Well... actual web apps require to write in JavaScript, JavaScript uses >> block scopes.. so I appreciate a LOT this feature of the language, but as >> long this language has to live with other languages (like JavaScript) I >> don't feel that this will release me from the burden of knowing how to deal >> with block scopes variables used in a closure. JavaScript is not an example >> of well designed language but is the language widely used in web apps. >> >> 3) Generics... >> >> Well... With interfaces I already got the genericity I need to model >> abstractions.. But I do appreciate generics, because they do allow us to >> write less code at the cost complicating the language grammar. I start to >> use them... but before that I have no problem on converting an slice of >> interfaces using a for loop. >> >> 4) I "grow" writing these lines on any C program *I'm not too old (to >> reason), but also not too young (to dream). I have 40* >> >> #define TRUE 1 >> #define FALSE 0 >> >> *That definitively has shaped my mind.* >> >> *So the statement is*: >> >> The points 1,2 and 3 I show... are examples of questionable (at least, >> for me) things that you directly inject into the language. The point 4 I >> show how I feel that a bool is, in turn, an int. >> >> The proposal of making bool to int, could co exists. And people can >> choose to use it or not. You may give it a try... for me (and other folks) >> well come in handy in situations like this >> <https://github.com/vituchon/escobita/blob/dcff51ccf8b44f17d82b724650a24f967f282b9f/model/bot_player.go#L111> >> (context: >> count the number of Spanish's cards that belongs to the GOLD suit). >> >> If you say me: "Ey victor, we just won't put it because we don't like it" >> <- I will buy it. >> >> Or >> >> You may convince me... I leave that to you. I will try to stay open (I do >> recognize myself as person that can be a little stubborn.) >> >> Final words >> >> Is not my language and you have done a wonderful job... I mean.. from the >> old days in C, passing thought the cosmos of C++, then OOP disembark with >> Java and C#... and then Golang mixing a lot of learned lessons into a >> single language! >> >> Actual final words: >> >> Informal Greetings! 🤠🧉 >> >> >> >> -- > You received this message because you are subscribed to a topic in the > Google Groups "golang-nuts" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/golang-nuts/dSvR3uskT6M/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/61e90e0d-30a1-4c75-b6d3-9933dcaad632n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/61e90e0d-30a1-4c75-b6d3-9933dcaad632n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- V -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAPUu9svin0nkN32tAwEsDpPccoyFew8M9%2BigoThUjZfnL3xE-A%40mail.gmail.com.