if r == 13 despiteallobjections { ... }

-rob


On Fri, Apr 24, 2020 at 8:04 AM 'Dan Kortschak' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> I look forward to the addition of the definition of "in a handwavy
> sense" to the spec.
>
> On Thu, 2020-04-23 at 11:41 -0700, Michael Jones wrote:
> > You could extend the notation:
> >
> > If r 13+- {
> >   // if r is close to 13, in a handwavy sense
> >   :
> > }
> >
> > On Thu, Apr 23, 2020 at 9:43 AM Ian Lance Taylor <i...@golang.org>
> > wrote:
> > > On Thu, Apr 23, 2020 at 8:48 AM anon notmyfault64 <
> > > bagasdo...@gmail.com> wrote:
> > > >
> > > > Many times outside programming we use "number plus" postfix
> > > syntax to denote more than or equal, for example:
> > > >
> > > > a 99+
> > > >
> > > > But why isn't there such syntax above in all programming
> > > languages, including Go? That is, why does following code not
> > > compile with invalid syntax error?
> > > >
> > > > var r int = 18
> > > >
> > > > if r 13+ {
> > > >     fmt.Println("Hooray! We are teen! We can do anything!")
> > > > } else {
> > > >     fmt.Println("Oh No! We are still child, so we need parental
> > > control!")
> > > > }
> > >
> > > I don't see the advantage over writing r >= 13.
> > >
> > > It's not useful for a programming language to have multiple ways of
> > > writing the exact same thing.  Of course, any language does have
> > > multiple ways of doing some things, but there is should always be a
> > > reason for it.  I don't see a reason for this one.
> > >
> > > For what it's worth, I'm not familiar with the "a 99+" notation.  I
> > > would not know what that meant without an explanation.
> > >
> > > 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/dd0eb4cfb15efb25b2ea374ace24a3268df2ebc5.camel%40kortschak.io
> .
>

-- 
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/CAOXNBZRUU7RwAxYXqHnrnFvOywC%3DtAbZL_1rcL6T6m91N%3DvLRQ%40mail.gmail.com.

Reply via email to