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

Are feed operators supposed to append?? #2899

Closed
lizmat opened this issue May 14, 2019 · 5 comments
Closed

Are feed operators supposed to append?? #2899

lizmat opened this issue May 14, 2019 · 5 comments

Comments

@lizmat
Copy link
Contributor

lizmat commented May 14, 2019

$ perl6 -e 'my @a; @a <== 1,2,3; @a <== <a b c>; dd @a'
Array @a = [1, 2, 3, "a", "b", "c"]  # expected Array @a = ["a", "b", "c"]

In my mind, the pointy end of a feed operator always initializes the receiver. This seems to be supported by the specs: https://github.com/perl6/specs/blob/master/S06-routines.pod , feed operators:

It binds the (potentially lazy) list from the blunt end to the slurpy parameter(s) of the receiver on the sharp end.

which would imply that the current implementation of feed operators (which, afaik, predates the GLR) is incorrect.

@Kaiepi
Copy link
Contributor

Kaiepi commented May 14, 2019

It looks like only ==>> and <<== are supposed to append:

To append multiple sources to the next sink, double the angle:

@ugexe
Copy link
Member

ugexe commented May 14, 2019

That can be interpreted as “if you want to append multiple sources INSTEAD of appending a single source”

@lizmat
Copy link
Contributor Author

lizmat commented May 14, 2019

Perhaps this is a problem-solving issue after all :-)

@AlexDaniel
Copy link
Contributor

Perhaps this is a problem-solving issue after all :-)

I think I agree, and if we can get a few more tickets for feed operators, maybe we'll be able to fix a bunch of things in the spec at once.

@lizmat
Copy link
Contributor Author

lizmat commented May 15, 2019

Moved to Raku/problem-solving#27 , so closing issue here.

@lizmat lizmat closed this as completed May 15, 2019
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

4 participants