(please reply to the list, so others with a similar question can find this thread.)
I'm sorry, I should have made it clear: for me it's hard to parse the question. I'll try again: could you please write 1 working example in play.golang.org with the assumed precedence rules? If you could share a link to that example in your reply, that would help clarify the question. (Use the share button on play.golang.org to show a link to be shared.) On 12/14/18, 伊藤和也 <kazya.ito.dr...@gmail.com> wrote: > OUnary operators have the highest precedence. > According to go language specification, unary operators have the highest > precedence means binary operators are the 2nd highest precedence maybe. > and binary operators also have the precedence in 5 levels. When I use > parentheses with unary operators, unary operators are evaluated first and > when I use parentheses with binary operators, parentheses are evaluated > first. > Example of parentheses with binary operators > > fmt.Println(false && (false || true)) > > fmt.Println(false && false || true) > > There is no example of parentheses with unary operators. > Yes, parenthesis isn't an operator, it's a punctuation. > So can I say the precedence of parethesis which is a parenthesis is lower > than unary operators and > higher than binary operators. > unary operators (high) > ↑ > parentheses ↑ > ↑ > binary operators (low) > 2018年12月14日(金) 19:15 <fge...@gmail.com>: > >> Could you please give 2 examples, where the results depend on the >> precedence? Maybe on play.golang.org ? >> Maybe this also helps: https://golang.org/ref/spec#Operators >> >> On 12/14/18, 伊藤和也 <kazya.ito.dr...@gmail.com> wrote: >> > Can I say the precedence of paretheses are lower than unary operators >> > and >> > higher than binary operators. >> > unary operators (high) >> > ↑ >> > parentheses ↑ >> > ↑ >> > binary operators (low) >> > >> > -- >> > 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. >> > For more options, visit https://groups.google.com/d/optout. >> > >> > -- 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. For more options, visit https://groups.google.com/d/optout.