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

bag/set related issues #4389

Closed
p6rt opened this issue Jul 9, 2015 · 6 comments
Closed

bag/set related issues #4389

p6rt opened this issue Jul 9, 2015 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jul 9, 2015

Migrated from rt.perl.org#125580 (status was 'resolved')

Searchable as RT125580$

@p6rt
Copy link
Author

p6rt commented Jul 9, 2015

From liukan@360.cn

15​:20 < kanl> my $a = bag( -Inf .. Inf ); my $b = bag( 1 .. 3 ); my $c = bag();
  say $a(+)$b(+)$c; ## this won't work
15​:21 < kanl> 1. Inf is not properly guarded
15​:21 < kanl> 2. the (whatever) operator requires leading whitespaces.
15​:21 < kanl> 3. can't mix the operators without grouping ()
15​:23 < kanl> m​: my $a = bag( 1 .. 4 ); my $b = bag( 1 .. 3 ); say $a(+)$b;
15​:23 < kanl> m​: my $a = bag( 1 .. 4 ); my $b = bag( 1 .. 3 ); my $c = bag();
  say $a (+) $b (-) $c;
15​:23 <+camelia> rakudo-moar 377672​: OUTPUT«===SORRY!=== Error while compiling
  /tmp/hlD7eRLLzWâ�¤Prefix + requires an argument, but no valid
  term foundâ�¤at /tmp/hlD7eRLLzW​:1â�¤------> .. 4 ); my $b = bag(
  1 .. 3 ); say $a(+â��)$b;â�¤ expecting any of​:â�¤ prefixâ�¤Â»
15​:24 <+camelia> rakudo-moar 377672​: OUTPUT«===SORRY!=== Error while compiling
  /tmp/YpB9DyyE64â�¤Operators '(+)' and '(-)' are non-associative
  and require parenthesesâ�¤at /tmp/YpB9DyyE64​:1â�¤------> ( 1 .. 3
  ); my $c = bag(); say $a (+) $bâ�� (-) $c;â�¤ expecting any
  of​:â�¤ iâ�¦Â»

@p6rt
Copy link
Author

p6rt commented Oct 2, 2017

From @AlexDaniel

1. I think it is properly guarded now. (error message​: Cannot coerce a lazy list onto a Bag)
2. That's OK. A lot of things require whitespace in 6lang (another example here​: https://docs.6lang.org/language/traps#Less_than_vs._Word_quoting/Associative_indexing ). If you insist on no whitespace you're free to use â��.
3. Here's the current error message​: “Only identical operators may be list associative; since '(+)' and '(-)' differ, they are non-associative and you need to clarify with parentheses”. I'm not sure if (+) and (-) should work without parens.

I think we need a test for the first issue, second issue can be rejected and 3rd has to be separated into a separate RFC ticket.

Therefore TESTNEEDED. Whoever writes a test can decide whether 3rd issue should be rejected or separated into another ticket :)

On 2015-07-09 02​:27​:18, liukan@​360.cn wrote​:

15​:20 < kanl> my $a = bag( -Inf .. Inf ); my $b = bag( 1 .. 3 ); my $c
= bag();
say $a(+)$b(+)$c; ## this won't work
15​:21 < kanl> 1. Inf is not properly guarded
15​:21 < kanl> 2. the (whatever) operator requires leading whitespaces.
15​:21 < kanl> 3. can't mix the operators without grouping ()
15​:23 < kanl> m​: my $a = bag( 1 .. 4 ); my $b = bag( 1 .. 3 ); say
$a(+)$b;
15​:23 < kanl> m​: my $a = bag( 1 .. 4 ); my $b = bag( 1 .. 3 ); my $c =
bag();
say $a (+) $b (-) $c;
15​:23 <+camelia> rakudo-moar 377672​: OUTPUT«===SORRY!=== Error while
compiling
/tmp/hlD7eRLLzW�Prefix + requires an argument, but no
valid
term foundâ�¤at /tmp/hlD7eRLLzW​:1â�¤------> .. 4 ); my
$b = bag(
1 .. 3 ); say $a(+â��)$b;â�¤ expecting any of​:â�¤
prefixâ�¤»
15​:24 <+camelia> rakudo-moar 377672​: OUTPUT«===SORRY!=== Error while
compiling
/tmp/YpB9DyyE64�Operators '(+)' and '(-)' are non-
associative
and require parenthesesâ�¤at /tmp/YpB9DyyE64​:1â�¤------>
( 1 .. 3
); my $c = bag(); say $a (+) $b� (-) $c;�
expecting any
of​:â�¤ i…»

@p6rt
Copy link
Author

p6rt commented Oct 2, 2017

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

@p6rt
Copy link
Author

p6rt commented Oct 3, 2017

From @AlexDaniel

Bisected. First issue was resolved in rakudo/rakudo@11f27a3

On 2017-10-01 23​:59​:39, alex.jakimenko@​gmail.com wrote​:

1. I think it is properly guarded now. (error message​: Cannot coerce a
lazy
list onto a Bag)
2. That's OK. A lot of things require whitespace in 6lang (another
example
here​:
https://docs.6lang.org/language/traps#Less_than_vs._Word_quoting/Associative_indexing
). If you insist on no whitespace you're free to use �.
3. Here's the current error message​: “Only identical operators may be
list
associative; since '(+)' and '(-)' differ, they are non-associative
and you
need to clarify with parentheses”. I'm not sure if (+) and (-) should
work
without parens.

I think we need a test for the first issue, second issue can be
rejected and
3rd has to be separated into a separate RFC ticket.

Therefore TESTNEEDED. Whoever writes a test can decide whether 3rd
issue should
be rejected or separated into another ticket :)

On 2015-07-09 02​:27​:18, liukan@​360.cn wrote​:

15​:20 < kanl> my $a = bag( -Inf .. Inf ); my $b = bag( 1 .. 3 ); my
$c
= bag();
say $a(+)$b(+)$c; ## this won't work
15​:21 < kanl> 1. Inf is not properly guarded
15​:21 < kanl> 2. the (whatever) operator requires leading
whitespaces.
15​:21 < kanl> 3. can't mix the operators without grouping ()
15​:23 < kanl> m​: my $a = bag( 1 .. 4 ); my $b = bag( 1 .. 3 ); say
$a(+)$b;
15​:23 < kanl> m​: my $a = bag( 1 .. 4 ); my $b = bag( 1 .. 3 ); my $c

bag();
say $a (+) $b (-) $c;
15​:23 <+camelia> rakudo-moar 377672​: OUTPUT«===SORRY!=== Error while
compiling
/tmp/hlD7eRLLzW�Prefix + requires an argument, but no
valid
term foundâ�¤at /tmp/hlD7eRLLzW​:1â�¤------> .. 4 ); my
$b = bag(
1 .. 3 ); say $a(+â��)$b;â�¤ expecting any of​:â�¤
prefixâ�¤»
15​:24 <+camelia> rakudo-moar 377672​: OUTPUT«===SORRY!=== Error while
compiling
/tmp/YpB9DyyE64�Operators '(+)' and '(-)' are non-
associative
and require parenthesesâ�¤at /tmp/YpB9DyyE64​:1â�¤------>
( 1 .. 3
); my $c = bag(); say $a (+) $b� (-) $c;�
expecting any
of​:â�¤ i…»

@p6rt
Copy link
Author

p6rt commented Dec 12, 2017

From @zoffixznet

Tests​: Raku/roast@0431615286

Whoever writes a test can decide whether 3rd
issue should
be rejected or separated into another ticket :)

Rejected

@p6rt
Copy link
Author

p6rt commented Dec 12, 2017

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

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

No branches or pull requests

1 participant