On Wed, May 3, 2017 at 7:04 PM, T L <tapir....@gmail.com> wrote: > > > On Thursday, May 4, 2017 at 12:46:47 AM UTC+8, Axel Wagner wrote: >> >> but >> const ( >> a = iota >> b >> s string >> d >> ) >> is not a valid declaration. You can't say "the rule is the same for >> constants". >> > > For the same rule, I mean just copying the corresponding part from last > line. > Yes, declared constant must be assigned. This is an unrelated rule for > this topic. >
No, it is not an unrelated rule. Because it means that "just like for consts" isn't an argument. You need, at the very least, answer the valid question ("what happens with that var-declaration and why?") raised about your proposal. Or better yet, realize that var and const declarations behave very differently and thus "consistency" isn't an argument to add something otherwise useless. > > >> >> Again: const-declarations and variable declarations are very different. >> You can not argue "it's the same"; it's not. >> >> On Wed, May 3, 2017 at 6:28 PM, T L <tapi...@gmail.com> wrote: >> >>> >>> >>> On Thursday, May 4, 2017 at 12:17:13 AM UTC+8, Jan Mercl wrote: >>>> >>>> On Wed, May 3, 2017 at 6:00 PM T L <tapi...@gmail.com> wrote: >>>> >>>> > Just like what expected for constants. >>>> >>>> For constants it's expected to reuse the last iota expression when >>>> absent. Do you propose that >>>> >>>> var ( >>>> a = iota >>>> b >>>> ) >>>> >>>> will become valid and initialize a to 0 and b to 1? >>>> >>>> If so, is it valid and what shall happen when one writes >>>> >>>> var ( >>>> a = iota >>>> b >>>> s string >>>> d >>>> ) >>>> >>>> ? >>>> >>> >>> The rule is same for constants: d is also string, as s. >>> >>> >>> >>>> >>>> If it's not valid, why? >>>> >>>> >>>> -- >>>> >>>> -j >>>> >>> -- >>> 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...@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. > -- 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.