Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:?smth should construct a truthy pair (say (:?foo)) #6405

Closed
p6rt opened this issue Jul 22, 2017 · 17 comments
Closed

:?smth should construct a truthy pair (say (:?foo)) #6405

p6rt opened this issue Jul 22, 2017 · 17 comments

Comments

@p6rt
Copy link

p6rt commented Jul 22, 2017

Migrated from rt.perl.org#131781 (status was 'rejected')

Searchable as RT131781$

@p6rt
Copy link
Author

p6rt commented Jul 22, 2017

From @AlexDaniel

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
  expecting any of​:
  colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

@p6rt
Copy link
Author

p6rt commented Jul 22, 2017

From @zoffixznet

On Sat, 22 Jul 2017 07​:53​:26 -0700, alex.jakimenko@​gmail.com wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's large possibility of introducing some unwanted ambiguity somewhere and it's hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax feature of the language, requiring beginners to learn a wealth of syntax to understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend their syntax to carry large benefits, however, the proposal offers literally zero practical use and the OP came up[^1] with this idea while trying to think of more cases to add to the catalog of colon uses in Rakudo. The `?` prefix op at least coerces the already-true arg to Bool (e.g. `?"foo" === True`) but in the case of the colonpair, there's nothing to coerce, so there's absolutely no point in typing the extra `?` and it's unlikely anyone would want to type it.
4) The OP makes the case that this syntax should exist solely for the sake of consistency, by interpreting the `!` in `​:!foo` syntax to mean the `!` op, and there exists the `?` op. But if we follow that logic, it'd mean​:
  *) `!! ??` should be allowed too, to mean reverse ternary
  *) `​::!CLASS` should mean `anything but :​:?CLASS`
  *) `has $?foo` should be an alternative to `has $!foo`
  *) `self?foo` should be an alternative to `self!foo`
  *) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"` not `"​:"` vs `"​:" + some op`. And things that have "!" in them do not necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and it is unlikely it'll ever be used in real programs. The colonpair syntax is used across the entire language and any changes to it have large impact. It's very hard to anticipate any problematic ambiguity cases introduction of `?` into colon syntax might have. And given lack of technical benefits of this feature, I do not think we should accept the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

@p6rt
Copy link
Author

p6rt commented Jul 22, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 22, 2017

From @AlexDaniel

Eh. The effort required to implement the feature is much less than having discussions *like this*. I'll try to be quick.

“there's large possibility of introducing some unwanted ambiguity somewhere”

A good thing to keep in mind indeed.

I don't really like these discussions before actual PRs, but if we think about it a little bit…

<colonpair> panics if it finds :! but then fails to find <identifier> ( https://github.com/rakudo/rakudo/blob/fb7ecb60f006b5738bfe7a234535e07344268b31/src/Perl6/Grammar.nqp#L1892 ), so if there is any ambiguity introduced, then it's not bigger than what we have with :! already.

I've tried :​:!CLASS and it complains about private method !CLASS.

:?foo itself says “Confused … expecting any of​: colon pair”, so it expects a colon pair anyway.

Maybe you have some good examples, but *so far* looks ok.

“complex syntax feature”

Let's make this complex feature strangely consistent.

“OP came up[^1] with this idea while trying to think of more cases to add to the catalog of colon uses in Rakudo”

Why does this sound so bad? :) Does it really matter at what point I noticed that the feature that I always thought was implemented actually isn't? I don't use colonpairs as often, truthy or falsy, so never noticed before.

However, even the fact that :!foo does not align vertically with :bar is enough to convince me regarding the usefulness of the proposed feature.

“But if we follow that logic, it'd mean​:”

What I meant was that we can make it strangely consistent in a useful way. Then you extrapolated it to unbelievable extents.

Then there are examples that are totally unrelated to the ticket. Even ?? !! is not in any way strangely consistent (you can't write else { } if { }).

I like this definition a lot​:

<masak> "strangely consistent" is all about using loose connections people have in their brains, so that a feature feels syntactically vaguely right for various reasons.

This ticket is not about making colonpairs accept prefix operators. It is also not about being able to syntactically put ? anywhere you can put !. And let's also not bring unrelated stuff here (like colonpairs only accepting natural numbers with *no sign* whatsoever). What kind of derailing kung fu is this anyway?

On 2017-07-22 09​:12​:31, cpan@​zoffix.com wrote​:

On Sat, 22 Jul 2017 07​:53​:26 -0700, alex.jakimenko@​gmail.com wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's large
possibility of introducing some unwanted ambiguity somewhere and it's
hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax feature of
the language, requiring beginners to learn a wealth of syntax to
understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend their syntax to
carry large benefits, however, the proposal offers literally zero
practical use and the OP came up[^1] with this idea while trying to
think of more cases to add to the catalog of colon uses in Rakudo. The
`?` prefix op at least coerces the already-true arg to Bool (e.g.
`?"foo" === True`) but in the case of the colonpair, there's nothing
to coerce, so there's absolutely no point in typing the extra `?` and
it's unlikely anyone would want to type it.
4) The OP makes the case that this syntax should exist solely for the
sake of consistency, by interpreting the `!` in `​:!foo` syntax to mean
the `!` op, and there exists the `?` op. But if we follow that logic,
it'd mean​:
*) `!! ??` should be allowed too, to mean reverse ternary
*) `​::!CLASS` should mean `anything but :​:?CLASS`
*) `has $?foo` should be an alternative to `has $!foo`
*) `self?foo` should be an alternative to `self!foo`
*) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"` not `"​:"`
vs `"​:" + some op`. And things that have "!" in them do not
necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and it is
unlikely it'll ever be used in real programs. The colonpair syntax is
used across the entire language and any changes to it have large
impact. It's very hard to anticipate any problematic ambiguity cases
introduction of `?` into colon syntax might have. And given lack of
technical benefits of this feature, I do not think we should accept
the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

@p6rt
Copy link
Author

p6rt commented Jul 22, 2017

From @AlexDaniel

sub foo($bar!) { say $bar }; foo(42)

On 2017-07-22 11​:19​:41, alex.jakimenko@​gmail.com wrote​:

Eh. The effort required to implement the feature is much less than
having
discussions *like this*. I'll try to be quick.

“there's large possibility of introducing some unwanted ambiguity
somewhere”

A good thing to keep in mind indeed.

I don't really like these discussions before actual PRs, but if we
think about
it a little bit…

<colonpair> panics if it finds :! but then fails to find <identifier>
(
https://github.com/rakudo/rakudo/blob/fb7ecb60f006b5738bfe7a234535e07344268b31/src/Perl6/Grammar.nqp#L1892
), so if there is any ambiguity introduced, then it's not bigger than
what we
have with :! already.

I've tried :​:!CLASS and it complains about private method !CLASS.

:?foo itself says “Confused … expecting any of​: colon pair”, so it
expects a
colon pair anyway.

Maybe you have some good examples, but *so far* looks ok.

“complex syntax feature”

Let's make this complex feature strangely consistent.

“OP came up[^1] with this idea while trying to think of more cases to
add to
the catalog of colon uses in Rakudo”

Why does this sound so bad? :) Does it really matter at what point I
noticed
that the feature that I always thought was implemented actually isn't?
I don't
use colonpairs as often, truthy or falsy, so never noticed before.

However, even the fact that :!foo does not align vertically with :bar
is enough
to convince me regarding the usefulness of the proposed feature.

“But if we follow that logic, it'd mean​:”

What I meant was that we can make it strangely consistent in a useful
way. Then
you extrapolated it to unbelievable extents.

Then there are examples that are totally unrelated to the ticket. Even
?? !! is
not in any way strangely consistent (you can't write else { } if { }).

I like this definition a lot​:

<masak> "strangely consistent" is all about using loose connections
people have
in their brains, so that a feature feels syntactically vaguely right
for
various reasons.

This ticket is not about making colonpairs accept prefix operators. It
is also
not about being able to syntactically put ? anywhere you can put !.
And let's
also not bring unrelated stuff here (like colonpairs only accepting
natural
numbers with *no sign* whatsoever). What kind of derailing kung fu is
this
anyway?

On 2017-07-22 09​:12​:31, cpan@​zoffix.com wrote​:

On Sat, 22 Jul 2017 07​:53​:26 -0700, alex.jakimenko@​gmail.com wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's large
possibility of introducing some unwanted ambiguity somewhere and it's
hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax feature of
the language, requiring beginners to learn a wealth of syntax to
understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend their syntax
to
carry large benefits, however, the proposal offers literally zero
practical use and the OP came up[^1] with this idea while trying to
think of more cases to add to the catalog of colon uses in Rakudo.
The
`?` prefix op at least coerces the already-true arg to Bool (e.g.
`?"foo" === True`) but in the case of the colonpair, there's nothing
to coerce, so there's absolutely no point in typing the extra `?` and
it's unlikely anyone would want to type it.
4) The OP makes the case that this syntax should exist solely for the
sake of consistency, by interpreting the `!` in `​:!foo` syntax to
mean
the `!` op, and there exists the `?` op. But if we follow that logic,
it'd mean​:
*) `!! ??` should be allowed too, to mean reverse ternary
*) `​::!CLASS` should mean `anything but :​:?CLASS`
*) `has $?foo` should be an alternative to `has $!foo`
*) `self?foo` should be an alternative to `self!foo`
*) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"` not `"​:"`
vs `"​:" + some op`. And things that have "!" in them do not
necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and it is
unlikely it'll ever be used in real programs. The colonpair syntax is
used across the entire language and any changes to it have large
impact. It's very hard to anticipate any problematic ambiguity cases
introduction of `?` into colon syntax might have. And given lack of
technical benefits of this feature, I do not think we should accept
the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

@p6rt
Copy link
Author

p6rt commented Jul 23, 2017

From @LLFourn

Sorry for being think but what is
say (​:?foo);
meant to do? The OP just says it should "work".

On Sun, Jul 23, 2017 at 6​:05 AM Aleks-Daniel Jakimenko-Aleksejev via RT <
perl6-bugs-followup@​perl.org> wrote​:

sub foo($bar!) { say $bar }; foo(42)

On 2017-07-22 11​:19​:41, alex.jakimenko@​gmail.com wrote​:

Eh. The effort required to implement the feature is much less than
having
discussions *like this*. I'll try to be quick.

“there's large possibility of introducing some unwanted ambiguity
somewhere”

A good thing to keep in mind indeed.

I don't really like these discussions before actual PRs, but if we
think about
it a little bit…

<colonpair> panics if it finds :! but then fails to find <identifier>
(

https://github.com/rakudo/rakudo/blob/fb7ecb60f006b5738bfe7a234535e07344268b31/src/Perl6/Grammar.nqp#L1892

), so if there is any ambiguity introduced, then it's not bigger than
what we
have with :! already.

I've tried :​:!CLASS and it complains about private method !CLASS.

:?foo itself says “Confused … expecting any of​: colon pair”, so it
expects a
colon pair anyway.

Maybe you have some good examples, but *so far* looks ok.

“complex syntax feature”

Let's make this complex feature strangely consistent.

“OP came up[^1] with this idea while trying to think of more cases to
add to
the catalog of colon uses in Rakudo”

Why does this sound so bad? :) Does it really matter at what point I
noticed
that the feature that I always thought was implemented actually isn't?
I don't
use colonpairs as often, truthy or falsy, so never noticed before.

However, even the fact that :!foo does not align vertically with :bar
is enough
to convince me regarding the usefulness of the proposed feature.

“But if we follow that logic, it'd mean​:”

What I meant was that we can make it strangely consistent in a useful
way. Then
you extrapolated it to unbelievable extents.

Then there are examples that are totally unrelated to the ticket. Even
?? !! is
not in any way strangely consistent (you can't write else { } if { }).

I like this definition a lot​:

<masak> "strangely consistent" is all about using loose connections
people have
in their brains, so that a feature feels syntactically vaguely right
for
various reasons.

This ticket is not about making colonpairs accept prefix operators. It
is also
not about being able to syntactically put ? anywhere you can put !.
And let's
also not bring unrelated stuff here (like colonpairs only accepting
natural
numbers with *no sign* whatsoever). What kind of derailing kung fu is
this
anyway?

On 2017-07-22 09​:12​:31, cpan@​zoffix.com wrote​:

On Sat, 22 Jul 2017 07​:53​:26 -0700, alex.jakimenko@​gmail.com wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's large
possibility of introducing some unwanted ambiguity somewhere and it's
hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax feature of
the language, requiring beginners to learn a wealth of syntax to
understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend their syntax
to
carry large benefits, however, the proposal offers literally zero
practical use and the OP came up[^1] with this idea while trying to
think of more cases to add to the catalog of colon uses in Rakudo.
The
`?` prefix op at least coerces the already-true arg to Bool (e.g.
`?"foo" === True`) but in the case of the colonpair, there's nothing
to coerce, so there's absolutely no point in typing the extra `?` and
it's unlikely anyone would want to type it.
4) The OP makes the case that this syntax should exist solely for the
sake of consistency, by interpreting the `!` in `​:!foo` syntax to
mean
the `!` op, and there exists the `?` op. But if we follow that logic,
it'd mean​:
*) `!! ??` should be allowed too, to mean reverse ternary
*) `​::!CLASS` should mean `anything but :​:?CLASS`
*) `has $?foo` should be an alternative to `has $!foo`
*) `self?foo` should be an alternative to `self!foo`
*) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"` not `"​:"`
vs `"​:" + some op`. And things that have "!" in them do not
necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and it is
unlikely it'll ever be used in real programs. The colonpair syntax is
used across the entire language and any changes to it have large
impact. It's very hard to anticipate any problematic ambiguity cases
introduction of `?` into colon syntax might have. And given lack of
technical benefits of this feature, I do not think we should accept
the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

@p6rt
Copy link
Author

p6rt commented Jul 23, 2017

From @AlexDaniel

Yes, I should have been more clear.

Basically, it should work like (​:foo) does, which is construct foo => True pair.

On 2017-07-22 19​:25​:19, lloyd.fourn@​gmail.com wrote​:

Sorry for being think but what is
say (​:?foo);
meant to do? The OP just says it should "work".

On Sun, Jul 23, 2017 at 6​:05 AM Aleks-Daniel Jakimenko-Aleksejev via
RT <
perl6-bugs-followup@​perl.org> wrote​:

sub foo($bar!) { say $bar }; foo(42)

On 2017-07-22 11​:19​:41, alex.jakimenko@​gmail.com wrote​:

Eh. The effort required to implement the feature is much less than
having
discussions *like this*. I'll try to be quick.

“there's large possibility of introducing some unwanted ambiguity
somewhere”

A good thing to keep in mind indeed.

I don't really like these discussions before actual PRs, but if we
think about
it a little bit…

<colonpair> panics if it finds :! but then fails to find
<identifier>
(

https://github.com/rakudo/rakudo/blob/fb7ecb60f006b5738bfe7a234535e07344268b31/src/Perl6/Grammar.nqp#L1892

), so if there is any ambiguity introduced, then it's not bigger
than
what we
have with :! already.

I've tried :​:!CLASS and it complains about private method !CLASS.

:?foo itself says “Confused … expecting any of​: colon pair”, so it
expects a
colon pair anyway.

Maybe you have some good examples, but *so far* looks ok.

“complex syntax feature”

Let's make this complex feature strangely consistent.

“OP came up[^1] with this idea while trying to think of more cases
to
add to
the catalog of colon uses in Rakudo”

Why does this sound so bad? :) Does it really matter at what point
I
noticed
that the feature that I always thought was implemented actually
isn't?
I don't
use colonpairs as often, truthy or falsy, so never noticed before.

However, even the fact that :!foo does not align vertically with
:bar
is enough
to convince me regarding the usefulness of the proposed feature.

“But if we follow that logic, it'd mean​:”

What I meant was that we can make it strangely consistent in a
useful
way. Then
you extrapolated it to unbelievable extents.

Then there are examples that are totally unrelated to the ticket.
Even
?? !! is
not in any way strangely consistent (you can't write else { } if {
}).

I like this definition a lot​:

<masak> "strangely consistent" is all about using loose connections
people have
in their brains, so that a feature feels syntactically vaguely
right
for
various reasons.

This ticket is not about making colonpairs accept prefix operators.
It
is also
not about being able to syntactically put ? anywhere you can put !.
And let's
also not bring unrelated stuff here (like colonpairs only accepting
natural
numbers with *no sign* whatsoever). What kind of derailing kung fu
is
this
anyway?

On 2017-07-22 09​:12​:31, cpan@​zoffix.com wrote​:

On Sat, 22 Jul 2017 07​:53​:26 -0700, alex.jakimenko@​gmail.com
wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's large
possibility of introducing some unwanted ambiguity somewhere and
it's
hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax feature
of
the language, requiring beginners to learn a wealth of syntax to
understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend their
syntax
to
carry large benefits, however, the proposal offers literally zero
practical use and the OP came up[^1] with this idea while trying
to
think of more cases to add to the catalog of colon uses in
Rakudo.
The
`?` prefix op at least coerces the already-true arg to Bool (e.g.
`?"foo" === True`) but in the case of the colonpair, there's
nothing
to coerce, so there's absolutely no point in typing the extra `?`
and
it's unlikely anyone would want to type it.
4) The OP makes the case that this syntax should exist solely for
the
sake of consistency, by interpreting the `!` in `​:!foo` syntax to
mean
the `!` op, and there exists the `?` op. But if we follow that
logic,
it'd mean​:
*) `!! ??` should be allowed too, to mean reverse ternary
*) `​::!CLASS` should mean `anything but :​:?CLASS`
*) `has $?foo` should be an alternative to `has $!foo`
*) `self?foo` should be an alternative to `self!foo`
*) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"` not
`"​:"`
vs `"​:" + some op`. And things that have "!" in them do not
necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and it is
unlikely it'll ever be used in real programs. The colonpair
syntax is
used across the entire language and any changes to it have large
impact. It's very hard to anticipate any problematic ambiguity
cases
introduction of `?` into colon syntax might have. And given lack
of
technical benefits of this feature, I do not think we should
accept
the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

@p6rt
Copy link
Author

p6rt commented Jul 23, 2017

From @LLFourn

2¢​:
? doesn't imply truth it implies a question. The ? prefix asks an
expression whether it's True or False. When used as a sigil like $?FILE
it's asking the compiler about something.

‘​:foo’ sets foo to True. ‘​:!foo’ sets it to False. ‘​:?foo’ looks like it's
trying to ask something a question, but I'm not sure about what.

On Sun, Jul 23, 2017 at 12​:41 PM Aleks-Daniel Jakimenko-Aleksejev via RT <
perl6-bugs-followup@​perl.org> wrote​:

Yes, I should have been more clear.

Basically, it should work like (​:foo) does, which is construct foo => True
pair.

On 2017-07-22 19​:25​:19, lloyd.fourn@​gmail.com wrote​:

Sorry for being think but what is
say (​:?foo);
meant to do? The OP just says it should "work".

On Sun, Jul 23, 2017 at 6​:05 AM Aleks-Daniel Jakimenko-Aleksejev via
RT <
perl6-bugs-followup@​perl.org> wrote​:

sub foo($bar!) { say $bar }; foo(42)

On 2017-07-22 11​:19​:41, alex.jakimenko@​gmail.com wrote​:

Eh. The effort required to implement the feature is much less than
having
discussions *like this*. I'll try to be quick.

“there's large possibility of introducing some unwanted ambiguity
somewhere”

A good thing to keep in mind indeed.

I don't really like these discussions before actual PRs, but if we
think about
it a little bit…

<colonpair> panics if it finds :! but then fails to find
<identifier>
(

https://github.com/rakudo/rakudo/blob/fb7ecb60f006b5738bfe7a234535e07344268b31/src/Perl6/Grammar.nqp#L1892

), so if there is any ambiguity introduced, then it's not bigger
than
what we
have with :! already.

I've tried :​:!CLASS and it complains about private method !CLASS.

:?foo itself says “Confused … expecting any of​: colon pair”, so it
expects a
colon pair anyway.

Maybe you have some good examples, but *so far* looks ok.

“complex syntax feature”

Let's make this complex feature strangely consistent.

“OP came up[^1] with this idea while trying to think of more cases
to
add to
the catalog of colon uses in Rakudo”

Why does this sound so bad? :) Does it really matter at what point
I
noticed
that the feature that I always thought was implemented actually
isn't?
I don't
use colonpairs as often, truthy or falsy, so never noticed before.

However, even the fact that :!foo does not align vertically with
:bar
is enough
to convince me regarding the usefulness of the proposed feature.

“But if we follow that logic, it'd mean​:”

What I meant was that we can make it strangely consistent in a
useful
way. Then
you extrapolated it to unbelievable extents.

Then there are examples that are totally unrelated to the ticket.
Even
?? !! is
not in any way strangely consistent (you can't write else { } if {
}).

I like this definition a lot​:

<masak> "strangely consistent" is all about using loose connections
people have
in their brains, so that a feature feels syntactically vaguely
right
for
various reasons.

This ticket is not about making colonpairs accept prefix operators.
It
is also
not about being able to syntactically put ? anywhere you can put !.
And let's
also not bring unrelated stuff here (like colonpairs only accepting
natural
numbers with *no sign* whatsoever). What kind of derailing kung fu
is
this
anyway?

On 2017-07-22 09​:12​:31, cpan@​zoffix.com wrote​:

On Sat, 22 Jul 2017 07​:53​:26 -0700, alex.jakimenko@​gmail.com
wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's large
possibility of introducing some unwanted ambiguity somewhere and
it's
hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax feature
of
the language, requiring beginners to learn a wealth of syntax to
understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend their
syntax
to
carry large benefits, however, the proposal offers literally zero
practical use and the OP came up[^1] with this idea while trying
to
think of more cases to add to the catalog of colon uses in
Rakudo.
The
`?` prefix op at least coerces the already-true arg to Bool (e.g.
`?"foo" === True`) but in the case of the colonpair, there's
nothing
to coerce, so there's absolutely no point in typing the extra `?`
and
it's unlikely anyone would want to type it.
4) The OP makes the case that this syntax should exist solely for
the
sake of consistency, by interpreting the `!` in `​:!foo` syntax to
mean
the `!` op, and there exists the `?` op. But if we follow that
logic,
it'd mean​:
*) `!! ??` should be allowed too, to mean reverse ternary
*) `​::!CLASS` should mean `anything but :​:?CLASS`
*) `has $?foo` should be an alternative to `has $!foo`
*) `self?foo` should be an alternative to `self!foo`
*) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"` not
`"​:"`
vs `"​:" + some op`. And things that have "!" in them do not
necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and it is
unlikely it'll ever be used in real programs. The colonpair
syntax is
used across the entire language and any changes to it have large
impact. It's very hard to anticipate any problematic ambiguity
cases
introduction of `?` into colon syntax might have. And given lack
of
technical benefits of this feature, I do not think we should
accept
the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

@p6rt
Copy link
Author

p6rt commented Jul 23, 2017

From @perlpilot

The OP said :?foo should work because :foo and :!foo work. I don't follow
the logic. How are those things related? Why should :foo and :!foo imply
:?foo? (In my head it makes as much sense as "​:foo and :!foo implies
:*foo", which is to say, none.)

I don't see any benefit to adding a :?foo syntax that means exactly the
same thing as :foo. I also don't see how it increases or improves
consistency (strangely or otherwise). That it could be implemented quickly
or easily is irrelevant.

So ... -1 for me too.

-Scott

On Sat, Jul 22, 2017 at 10​:11 PM, Lloyd Fournier via RT <
perl6-bugs-followup@​perl.org> wrote​:

2¢​:
? doesn't imply truth it implies a question. The ? prefix asks an
expression whether it's True or False. When used as a sigil like $?FILE
it's asking the compiler about something.

‘​:foo’ sets foo to True. ‘​:!foo’ sets it to False. ‘​:?foo’ looks like it's
trying to ask something a question, but I'm not sure about what.

On Sun, Jul 23, 2017 at 12​:41 PM Aleks-Daniel Jakimenko-Aleksejev via RT <
perl6-bugs-followup@​perl.org> wrote​:

Yes, I should have been more clear.

Basically, it should work like (​:foo) does, which is construct foo =>
True
pair.

On 2017-07-22 19​:25​:19, lloyd.fourn@​gmail.com wrote​:

Sorry for being think but what is
say (​:?foo);
meant to do? The OP just says it should "work".

On Sun, Jul 23, 2017 at 6​:05 AM Aleks-Daniel Jakimenko-Aleksejev via
RT <
perl6-bugs-followup@​perl.org> wrote​:

sub foo($bar!) { say $bar }; foo(42)

On 2017-07-22 11​:19​:41, alex.jakimenko@​gmail.com wrote​:

Eh. The effort required to implement the feature is much less than
having
discussions *like this*. I'll try to be quick.

“there's large possibility of introducing some unwanted ambiguity
somewhere”

A good thing to keep in mind indeed.

I don't really like these discussions before actual PRs, but if we
think about
it a little bit…

<colonpair> panics if it finds :! but then fails to find
<identifier>
(

https://github.com/rakudo/rakudo/blob/fb7ecb60f006b5738bfe7a234535e0
7344268b31/src/Perl6/Grammar.nqp#L1892

), so if there is any ambiguity introduced, then it's not bigger
than
what we
have with :! already.

I've tried :​:!CLASS and it complains about private method !CLASS.

:?foo itself says “Confused … expecting any of​: colon pair”, so it
expects a
colon pair anyway.

Maybe you have some good examples, but *so far* looks ok.

“complex syntax feature”

Let's make this complex feature strangely consistent.

“OP came up[^1] with this idea while trying to think of more cases
to
add to
the catalog of colon uses in Rakudo”

Why does this sound so bad? :) Does it really matter at what point
I
noticed
that the feature that I always thought was implemented actually
isn't?
I don't
use colonpairs as often, truthy or falsy, so never noticed before.

However, even the fact that :!foo does not align vertically with
:bar
is enough
to convince me regarding the usefulness of the proposed feature.

“But if we follow that logic, it'd mean​:”

What I meant was that we can make it strangely consistent in a
useful
way. Then
you extrapolated it to unbelievable extents.

Then there are examples that are totally unrelated to the ticket.
Even
?? !! is
not in any way strangely consistent (you can't write else { } if {
}).

I like this definition a lot​:

<masak> "strangely consistent" is all about using loose connections
people have
in their brains, so that a feature feels syntactically vaguely
right
for
various reasons.

This ticket is not about making colonpairs accept prefix operators.
It
is also
not about being able to syntactically put ? anywhere you can put !.
And let's
also not bring unrelated stuff here (like colonpairs only accepting
natural
numbers with *no sign* whatsoever). What kind of derailing kung fu
is
this
anyway?

On 2017-07-22 09​:12​:31, cpan@​zoffix.com wrote​:

On Sat, 22 Jul 2017 07​:53​:26 -0700, alex.jakimenko@​gmail.com
wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's large
possibility of introducing some unwanted ambiguity somewhere and
it's
hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax feature
of
the language, requiring beginners to learn a wealth of syntax to
understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend their
syntax
to
carry large benefits, however, the proposal offers literally zero
practical use and the OP came up[^1] with this idea while trying
to
think of more cases to add to the catalog of colon uses in
Rakudo.
The
`?` prefix op at least coerces the already-true arg to Bool (e.g.
`?"foo" === True`) but in the case of the colonpair, there's
nothing
to coerce, so there's absolutely no point in typing the extra `?`
and
it's unlikely anyone would want to type it.
4) The OP makes the case that this syntax should exist solely for
the
sake of consistency, by interpreting the `!` in `​:!foo` syntax to
mean
the `!` op, and there exists the `?` op. But if we follow that
logic,
it'd mean​:
*) `!! ??` should be allowed too, to mean reverse ternary
*) `​::!CLASS` should mean `anything but :​:?CLASS`
*) `has $?foo` should be an alternative to `has $!foo`
*) `self?foo` should be an alternative to `self!foo`
*) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"` not
`"​:"`
vs `"​:" + some op`. And things that have "!" in them do not
necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and it is
unlikely it'll ever be used in real programs. The colonpair
syntax is
used across the entire language and any changes to it have large
impact. It's very hard to anticipate any problematic ambiguity
cases
introduction of `?` into colon syntax might have. And given lack
of
technical benefits of this feature, I do not think we should
accept
the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

@p6rt
Copy link
Author

p6rt commented Jul 23, 2017

From @AlexDaniel

I wouldn't be so eager to judge the proposal based on the original post. Sometimes I submit tickets fast, and sometimes ideas are not conveyed as clearly as I assumed.

“How are those things related?”
These were the examples of the pair syntax (what works and what doesn't). Now, ?↔! pattern is strangely established by at least two precedents​:
* ? and ! prefix ops (e.g. !42 or ?42)
* Optional and required parameters (e.g. $foo?, $bar!, :$baz?, :$cat!)

Check out irc logs for more discussion.

On 2017-07-22 21​:50​:58, duff wrote​:

The OP said :?foo should work because :foo and :!foo work. I don't
follow
the logic. How are those things related? Why should :foo and :!foo
imply
:?foo? (In my head it makes as much sense as "​:foo and :!foo implies
:*foo", which is to say, none.)

I don't see any benefit to adding a :?foo syntax that means exactly
the
same thing as :foo. I also don't see how it increases or improves
consistency (strangely or otherwise). That it could be implemented
quickly
or easily is irrelevant.

So ... -1 for me too.

-Scott

On Sat, Jul 22, 2017 at 10​:11 PM, Lloyd Fournier via RT <
perl6-bugs-followup@​perl.org> wrote​:

2¢​:
? doesn't imply truth it implies a question. The ? prefix asks an
expression whether it's True or False. When used as a sigil like
$?FILE
it's asking the compiler about something.

‘​:foo’ sets foo to True. ‘​:!foo’ sets it to False. ‘​:?foo’ looks like
it's
trying to ask something a question, but I'm not sure about what.

On Sun, Jul 23, 2017 at 12​:41 PM Aleks-Daniel Jakimenko-Aleksejev via
RT <
perl6-bugs-followup@​perl.org> wrote​:

Yes, I should have been more clear.

Basically, it should work like (​:foo) does, which is construct foo
=>
True
pair.

On 2017-07-22 19​:25​:19, lloyd.fourn@​gmail.com wrote​:

Sorry for being think but what is
say (​:?foo);
meant to do? The OP just says it should "work".

On Sun, Jul 23, 2017 at 6​:05 AM Aleks-Daniel Jakimenko-Aleksejev
via
RT <
perl6-bugs-followup@​perl.org> wrote​:

sub foo($bar!) { say $bar }; foo(42)

On 2017-07-22 11​:19​:41, alex.jakimenko@​gmail.com wrote​:

Eh. The effort required to implement the feature is much less
than
having
discussions *like this*. I'll try to be quick.

“there's large possibility of introducing some unwanted
ambiguity
somewhere”

A good thing to keep in mind indeed.

I don't really like these discussions before actual PRs, but
if we
think about
it a little bit…

<colonpair> panics if it finds :! but then fails to find
<identifier>
(

https://github.com/rakudo/rakudo/blob/fb7ecb60f006b5738bfe7a234535e0
7344268b31/src/Perl6/Grammar.nqp#L1892

), so if there is any ambiguity introduced, then it's not
bigger
than
what we
have with :! already.

I've tried :​:!CLASS and it complains about private method
!CLASS.

:?foo itself says “Confused … expecting any of​: colon pair”,
so it
expects a
colon pair anyway.

Maybe you have some good examples, but *so far* looks ok.

“complex syntax feature”

Let's make this complex feature strangely consistent.

“OP came up[^1] with this idea while trying to think of more
cases
to
add to
the catalog of colon uses in Rakudo”

Why does this sound so bad? :) Does it really matter at what
point
I
noticed
that the feature that I always thought was implemented
actually
isn't?
I don't
use colonpairs as often, truthy or falsy, so never noticed
before.

However, even the fact that :!foo does not align vertically
with
:bar
is enough
to convince me regarding the usefulness of the proposed
feature.

“But if we follow that logic, it'd mean​:”

What I meant was that we can make it strangely consistent in
a
useful
way. Then
you extrapolated it to unbelievable extents.

Then there are examples that are totally unrelated to the
ticket.
Even
?? !! is
not in any way strangely consistent (you can't write else { }
if {
}).

I like this definition a lot​:

<masak> "strangely consistent" is all about using loose
connections
people have
in their brains, so that a feature feels syntactically
vaguely
right
for
various reasons.

This ticket is not about making colonpairs accept prefix
operators.
It
is also
not about being able to syntactically put ? anywhere you can
put !.
And let's
also not bring unrelated stuff here (like colonpairs only
accepting
natural
numbers with *no sign* whatsoever). What kind of derailing
kung fu
is
this
anyway?

On 2017-07-22 09​:12​:31, cpan@​zoffix.com wrote​:

On Sat, 22 Jul 2017 07​:53​:26 -0700,
alex.jakimenko@​gmail.com
wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's
large
possibility of introducing some unwanted ambiguity
somewhere and
it's
hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax
feature
of
the language, requiring beginners to learn a wealth of
syntax to
understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend
their
syntax
to
carry large benefits, however, the proposal offers
literally zero
practical use and the OP came up[^1] with this idea while
trying
to
think of more cases to add to the catalog of colon uses in
Rakudo.
The
`?` prefix op at least coerces the already-true arg to Bool
(e.g.
`?"foo" === True`) but in the case of the colonpair,
there's
nothing
to coerce, so there's absolutely no point in typing the
extra `?`
and
it's unlikely anyone would want to type it.
4) The OP makes the case that this syntax should exist
solely for
the
sake of consistency, by interpreting the `!` in `​:!foo`
syntax to
mean
the `!` op, and there exists the `?` op. But if we follow
that
logic,
it'd mean​:
*) `!! ??` should be allowed too, to mean reverse ternary
*) `​::!CLASS` should mean `anything but :​:?CLASS`
*) `has $?foo` should be an alternative to `has $!foo`
*) `self?foo` should be an alternative to `self!foo`
*) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"`
not
`"​:"`
vs `"​:" + some op`. And things that have "!" in them do not
necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and
it is
unlikely it'll ever be used in real programs. The colonpair
syntax is
used across the entire language and any changes to it have
large
impact. It's very hard to anticipate any problematic
ambiguity
cases
introduction of `?` into colon syntax might have. And given
lack
of
technical benefits of this feature, I do not think we
should
accept
the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

@p6rt
Copy link
Author

p6rt commented Jul 23, 2017

From @AlexDaniel

For those reading this on RT, here's the previous comment in a readable way​:

I wouldn't be so eager to judge the proposal based on the original post.
Sometimes I submit tickets fast, and sometimes ideas are not conveyed as clearly as I assumed.

“How are those things related?”
These were the examples of the pair syntax (what works and what doesn't). Now, ?↔! pattern is strangely established by at least two precedents​:
* ? and ! prefix ops (e.g. !42 or ?42)
* Optional and required parameters (e.g. $foo?, $bar!, :$baz?, :$cat!)

Check out irc logs for more discussion.

@p6rt
Copy link
Author

p6rt commented Jul 23, 2017

From @AlexDaniel

“? doesn't imply truth it implies a question”

This is an interesting point actually. pmurias++ expressed the same idea.

I find it hard to understand this fully, but I guess I'll have to accept that there are different ways to think about it :)

For example​:
“The ? prefix asks an expression whether it's True or False”
If “?” asks a question, then what about “!” ? Well, let's say it aggressively disagrees. Then we have optional and required parameters. ? is doubt and ! is a demand? Ok. And then we have​:
“‘​:foo’ sets foo to True. ‘​:!foo’ sets it to False”
Well, these are kinda arbitrary, and ! doesn't really follow the ideas mentioned above.

And then we also have ?? !!, where again we have ? as kinda an opposite of !.

I think no matter which way you think about it, the emerging pattern seems to be rather clear. And it does help to learn the language, at least it does help me.

I mean, previously I said that we have only two precedents of ?↔!, but now looking at ?? !! I think it follows the same pattern. Note, however, that I am not saying that ? should be replaceable by ! anywhere, which the first answer here implied for some reason. I'm mainly just saying that there is pattern and the lack of :?foo syntax is an exception rather than a rule. From this many other benefits can be derived, if needed.

I hope this clarifies it a bit.

On 2017-07-22 20​:11​:35, lloyd.fourn@​gmail.com wrote​:

2¢​:
? doesn't imply truth it implies a question. The ? prefix asks an
expression whether it's True or False. When used as a sigil like
$?FILE
it's asking the compiler about something.

‘​:foo’ sets foo to True. ‘​:!foo’ sets it to False. ‘​:?foo’ looks like
it's
trying to ask something a question, but I'm not sure about what.

On Sun, Jul 23, 2017 at 12​:41 PM Aleks-Daniel Jakimenko-Aleksejev via
RT <
perl6-bugs-followup@​perl.org> wrote​:

@p6rt
Copy link
Author

p6rt commented Jul 23, 2017

From @AlexDaniel

For those who don't agree that there is a connection between ? and !… Actually, there are some other places where ?↔! connection is implied. In fact, I will probably never list all of them.

In regexes​:
* <?> always succeeds, <!> always fails (and no question implied)
* <?{ … }> <!{ … }> tests for truthy and falsey values. Note that <{}> does something completely different.
* a+? is for non-greedy, a+! for greedy (again no question implied)
* <before>, <?before>, <!before> (note that all three are supported, same goes for <after>)

I would also do the job for the other side and provide some counter examples​:
* There is a ! metaop but no ? metaop (e.g. !== but no ?==). If there was one, it would practically be a noop because you wouldn't be able to use it on anything non-iffy anyway. That said, it's still a weird case.
* There is [foo]? in regexes but no [foo]! . At first I thought that this is intentional, given that ! may be needed for something else eventually, but knowing that a+! works I'm no longer sure.

This raises a question​: well… should we implement these too? Maybe this​: “If you’re gonna generalize, do it harder, but not too hard.”[^1] is relevant here, but maybe not.

Bonus​:
* In some cases the use of ? or ! is not related to this issue at all. e.g. private methods (if we allow some things to have no opposites, why bother at all?)

Anyway, that's some good food for thought I think.

[1] https://perl6advent.wordpress.com/2014/12/24/day-24-seeing-wrong-right/

@p6rt
Copy link
Author

p6rt commented Jul 24, 2017

From @AlexDaniel

Another interesting thing is that if this is implemented, then it will make it possible to use ? in other places where <colonpair> is used. For example, it will allow %h<x>​:?exists . It seems that it will also affect character classes (e.g. <​:?Ll>). Some of these totally make sense, some not so much. But we already have :!delete and nobody seems to be complaining :)

There's also <quotepair> which has very similar logic, it does support ! but does not support ? (e.g. m​:!i/ … / but no m​:?i/ … /). I wonder, if <colonpair> is ever touched, should the same thing be done with <quotepair> also?

On 2017-07-22 23​:40​:53, alex.jakimenko@​gmail.com wrote​:

For those who don't agree that there is a connection between ? and !…
Actually,
there are some other places where ?↔! connection is implied. In fact,
I will
probably never list all of them.

In regexes​:
* <?> always succeeds, <!> always fails (and no question implied)
* <?{ … }> <!{ … }> tests for truthy and falsey values. Note that <{}>
does
something completely different.
* a+? is for non-greedy, a+! for greedy (again no question implied)
* <before>, <?before>, <!before> (note that all three are supported,
same goes
for <after>)

I would also do the job for the other side and provide some counter
examples​:
* There is a ! metaop but no ? metaop (e.g. !== but no ?==). If there
was one,
it would practically be a noop because you wouldn't be able to use it
on
anything non-iffy anyway. That said, it's still a weird case.
* There is [foo]? in regexes but no [foo]! . At first I thought that
this is
intentional, given that ! may be needed for something else eventually,
but
knowing that a+! works I'm no longer sure.

This raises a question​: well… should we implement these too? Maybe
this​: “If
you’re gonna generalize, do it harder, but not too hard.”[^1] is
relevant here,
but maybe not.

Bonus​:
* In some cases the use of ? or ! is not related to this issue at all.
e.g.
private methods (if we allow some things to have no opposites, why
bother at
all?)

Anyway, that's some good food for thought I think.

[1] https://perl6advent.wordpress.com/2014/12/24/day-24-seeing-wrong-
right/

@p6rt
Copy link
Author

p6rt commented Jul 24, 2017

From @coke

On Sat, 22 Jul 2017 09​:12​:31 -0700, cpan@​zoffix.com wrote​:

On Sat, 22 Jul 2017 07​:53​:26 -0700, alex.jakimenko@​gmail.com wrote​:

This should work​:

Code​:
say (​:?foo);

Result​:
===SORRY!=== Error while compiling -e
Bogus statement
at -e​:1
------> say (​:⏏?foo);
expecting any of​:
colon pair

Because these work​:

Code​:
say (​:foo);
say (​:!foo);

Result​:
foo => True
foo => False

-1 from me​:

1) Colonpairs are ubiquitous in the language, so there's large
possibility of introducing some unwanted ambiguity somewhere and it's
hard to predict where it might occur
2) Colonpairs are already one of the most complex syntax feature of
the language, requiring beginners to learn a wealth of syntax to
understand most of the common code.
3) Given (1) and (2), I'd expect any changes to extend their syntax to
carry large benefits, however, the proposal offers literally zero
practical use and the OP came up[^1] with this idea while trying to
think of more cases to add to the catalog of colon uses in Rakudo. The
`?` prefix op at least coerces the already-true arg to Bool (e.g.
`?"foo" === True`) but in the case of the colonpair, there's nothing
to coerce, so there's absolutely no point in typing the extra `?` and
it's unlikely anyone would want to type it.

-1 from me as well, I agree with these first three points.

4) The OP makes the case that this syntax should exist solely for the
sake of consistency, by interpreting the `!` in `​:!foo` syntax to mean
the `!` op, and there exists the `?` op. But if we follow that logic,
it'd mean​:
*) `!! ??` should be allowed too, to mean reverse ternary
*) `​::!CLASS` should mean `anything but :​:?CLASS`
*) `has $?foo` should be an alternative to `has $!foo`
*) `self?foo` should be an alternative to `self!foo`
*) `​:-42foo` should parse just as `​:42foo` parses
The point being that the current syntax is `"​:"` vs `"​:!"` not `"​:"`
vs `"​:" + some op`. And things that have "!" in them do not
necessarily need to have a "?" alternative.

In summation, there's no practical use of this feature and it is
unlikely it'll ever be used in real programs. The colonpair syntax is
used across the entire language and any changes to it have large
impact. It's very hard to anticipate any problematic ambiguity cases
introduction of `?` into colon syntax might have. And given lack of
technical benefits of this feature, I do not think we should accept
the risks.

[1] https://irclog.perlgeek.de/perl6/2017-07-22#i_14907647

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 25, 2017

From @zoffixznet

Based on the tally of the opinions, I'm rejecting this ticket​:

  AlexDaniel​: +1
  Zoffix​: -1
  Jonathan Scott Duff​: -1
  Coke​: -1

Sorry for being think but what is say (​:?foo); meant to do? The OP just says it should "work".

I think that's pretty good evidence the extra syntax doesn't offer any additional clarity.

If “?” asks a question, then what about “!”

"!" ubiquitously means "not" in programming. If "​:foo" is True, "​:!foo" is "not True"

And then we also have ?? !!, where again we have ? as kinda an opposite of !.

There `??` asks the question and the `!!` segment is the "not" portion of the answer.

This raises a question​: well… should we implement these too?
[...] For example, it will allow %h<x>​:?exists
[...] make it possible to use ? in other places
[...] It seems that it will also affect character classes

That may have been a question 3 years ago, but I think after the stable language release it's a bit too late to make sweeping proposals that alter the entire syntax landscape. You yourself aren't even sure of all the bits that will be affected, much less of what unwanted interactions this new syntax will introduce.

All design changes—especially ones this large—carry risk with them of designing yourself into a corner. Usually, there's pay off for the risk taken. However, this proposal offers none. Not only does it offer no extra functionality, it's not even a beneficial (more concise, easier to remember, etc.) alternative to existing syntax. The only pro argument is consistency, but based on the previous replies, it appears there's quite a lot of disagreement even on that.

The effort required to implement the feature is much less than having discussions *like this*

Discussions like this is how we avoid making a mistake we'll have to pay for for the next decade or longer. It's not the first time you complain about discussions taking longer than implementation and I wish for once you'd realize that implementation time is insignificant; it's the support of the feature for the next decade that matters.

@p6rt p6rt closed this as completed Jul 25, 2017
@p6rt
Copy link
Author

p6rt commented Jul 25, 2017

@zoffixznet - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant