FAQ
Hello,
Is there any reason for go to use regular brackets for const/import and
curly brackets for structs. It seems confusing. Why no curly braces
everywhere?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Ian Lance Taylor at Sep 6, 2013 at 2:44 pm

    On Fri, Sep 6, 2013 at 6:47 AM, wrote:
    Is there any reason for go to use regular brackets for const/import and
    curly brackets for structs. It seems confusing. Why no curly braces
    everywhere?
    I guess it could have been curly braces everywhere. I can't think of
    any very deep reason for why it is different. In general Go uses
    curly braces for blocks, and const/var/type/import are not blocks.
    But then Go also uses curly braces for composite literals.

    Ian

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dragomir Ivanov at Sep 6, 2013 at 2:50 pm
    Yes, I was wondering why different for import/const/type. I am sill
    lacking muscle memory, I wonder was struct brace curly or not. Scopes are
    easy,...like C.

    On Fri, Sep 6, 2013 at 5:44 PM, Ian Lance Taylor wrote:
    On Fri, Sep 6, 2013 at 6:47 AM, wrote:

    Is there any reason for go to use regular brackets for const/import and
    curly brackets for structs. It seems confusing. Why no curly braces
    everywhere?
    I guess it could have been curly braces everywhere. I can't think of
    any very deep reason for why it is different. In general Go uses
    curly braces for blocks, and const/var/type/import are not blocks.
    But then Go also uses curly braces for composite literals.

    Ian
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Atomly at Sep 6, 2013 at 7:17 pm
    One of my pet peeves is confusion over names for () / [] / {} / <>

    I think the following is the clearest:

    () => parentheses
    [] => brackets
    {} => braces
    <> => brokets or chevrons

    :: atomly ::

    [ atomly@atomly.com : www.atomly.com : http://blog.atomly.com/ ...
    [ atomiq records : new york city : +1.347.692.8661 ...
    [ e-mail atomly-news-subscribe@atomly.com for atomly info and updates ...

    On Fri, Sep 6, 2013 at 9:47 AM, wrote:

    Hello,
    Is there any reason for go to use regular brackets for const/import and
    curly brackets for structs. It seems confusing. Why no curly braces
    everywhere?

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Matthew Kane at Sep 6, 2013 at 7:25 pm
    They are wakas!

    http://poetry.about.com/od/poetryplay/l/blwakawaka.htm
    On Fri, Sep 6, 2013 at 3:16 PM, atomly wrote:
    One of my pet peeves is confusion over names for () / [] / {} / <>

    I think the following is the clearest:

    () => parentheses
    [] => brackets
    {} => braces
    <> => brokets or chevrons

    :: atomly ::

    [ atomly@atomly.com : www.atomly.com : http://blog.atomly.com/ ...
    [ atomiq records : new york city : +1.347.692.8661 ...
    [ e-mail atomly-news-subscribe@atomly.com for atomly info and updates ...

    On Fri, Sep 6, 2013 at 9:47 AM, wrote:

    Hello,
    Is there any reason for go to use regular brackets for const/import and
    curly brackets for structs. It seems confusing. Why no curly braces
    everywhere?

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    matt kane
    twitter: the_real_mkb / nynexrepublic
    http://hydrogenproject.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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kevin Gillette at Sep 6, 2013 at 7:29 pm
    Supplemental emoticoids

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rob Pike at Sep 6, 2013 at 10:54 pm
    Rounds (), squares [], curlies {} and pointies <>.

    -rob

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rob Thornton at Sep 10, 2013 at 9:13 pm
    I agree with all of Rob's suggestions except pointies. They're clearly
    angles.
    On Friday, 6 September 2013 15:54:03 UTC-7, Rob Pike wrote:

    Rounds (), squares [], curlies {} and pointies <>.

    -rob
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Alexei Sholik at Sep 6, 2013 at 7:28 pm
    <> => brokets or chevrons
    The actual characters are "less than" and "greater than". They are only
    approximations of true chevrons "⟨" and "⟩".

    More info at http://en.wikipedia.org/wiki/Bracket

    On Fri, Sep 6, 2013 at 10:16 PM, atomly wrote:

    One of my pet peeves is confusion over names for () / [] / {} / <>

    I think the following is the clearest:

    () => parentheses
    [] => brackets
    {} => braces
    <> => brokets or chevrons

    :: atomly ::

    [ atomly@atomly.com : www.atomly.com : http://blog.atomly.com/ ...
    [ atomiq records : new york city : +1.347.692.8661 ...
    [ e-mail atomly-news-subscribe@atomly.com for atomly info and updates ...

    On Fri, Sep 6, 2013 at 9:47 AM, wrote:

    Hello,
    Is there any reason for go to use regular brackets for const/import and
    curly brackets for structs. It seems confusing. Why no curly braces
    everywhere?

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    Best regards
    Alexei Sholik

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 6, '13 at 1:47p
activeSep 10, '13 at 9:13p
posts9
users8
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase