On Thu, Jul 16, 2020 at 3:43 PM Robert Viragh <rvir...@gmail.com> wrote: > > Hi guys, > > Great conversation! I think that seeing a lot of edge cases would make it > easiest to see what is best. > > Since the conversation went into [[ and ]] > > Before coming up with [_ and _] I very strongly considered [[ and ]] because > I thought things should be orthogonal and different things should look > different, not the same, and I thought that looked pretty different.
[_ _] is ambiguous though, because _ is also an identifier character. [_x_] can be parsed as indexing with identifier _x_ > > As I recall, I didn't like the look of it, and especially I didn't like that > it seemed to be nesting something. However I did recall that python has """ > (triple quotation mark to start a multiline string) which is like a special > kind of quotation mark, yet consists of repeating the character, so I very > strongly considered [[ and ]] or even [[[ and ]]] as the right solution. I > just didn't think it looked that great. > > However to me the few examples given so far look pretty good with [_ and _] > instead of [[ and ]]. Any more corner cases? keep them coming! > > By jpap: > > [[T]] -- https://go2goplay.golang.org/p/NXqVM89QFor > > [T] -- https://go2goplay.golang.org/p/L9AKNHxPkUU > > Here it is with [_ and _] (doesn't run, obviously): > https://go2goplay.golang.org/p/i3eZOeR-oD6 > > I find this extremely readable, like crazy readable if you remember that [_ > _] is a mnemonic for fill in the blank. > > By Carla Pfaff: > > >MyMap[[string, MyList[[int]]]] > > Here it is with [_ and _]: > MyMap[_string, MyList[_int_]_] > > that's really obvious to me if you consider that you're filling in the blank > - MyList is a generic and you're "filling the blank" in with int, and MyMap > is a generic and you're "filling the blank" in with string and MyList. I > can't parse MyMap[[string, MyList[[int]]]] with my eyes even if I know what > it's supposed to mean - I can't even see if the brackets are matched or > unmatched, can you? > > Could people reply with more corner examples? I think a large wealth of > cases would best show the different options. > > The team came up with a really clever way to let [ and ] itself be > unambiguous (this whole thread, starting at the top), so I do think making it > more explicit (turning those [ and ] into [_ and _] at the appropriate spots) > could just be handled by gofmt. This would make the gofmt'ed output very > readable forever and the user could still just enter [ and ] at the keyboard. > > Is there some collection of edge cases? Can people come up with some more? > > I think we should see how it looks especially at the corners and more cases > and examples would show that best. > > -- > 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/CAFwChBn71m9%2B-DMTG5yH3g5TadKscm1X0WBwQKpzXyegxVN1PQ%40mail.gmail.com. -- 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/CAMV2Rqp%3DkikN6kEDugQys66UCKNdWjUqHYX9_0QsBu1BKw2OXA%40mail.gmail.com.