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

Example is incorrect #2636

Closed
manwar opened this issue Feb 26, 2019 · 7 comments
Closed

Example is incorrect #2636

manwar opened this issue Feb 26, 2019 · 7 comments

Comments

@manwar
Copy link

manwar commented Feb 26, 2019

The problem

One of the example

say q:raw/:raw (no interpolation) even backslash has no special meaning: \ /;

in the page below

https://examples.perl6.org/categories/cookbook/01strings/01-00introduction.html

is throwing following error

Unrecognized adverb: :raw
at /home/manwar/github/perl6-cookbook/strings/t.pl:3
------> say q:raw⏏/:raw (no interpolation) even backslash
Couldn't find terminator / (corresponding / was at line 3)
at /home/manwar/github/perl6-cookbook/strings/t.pl:4
------> ⏏
expecting any of:
/

Suggestions

I don't know enough to suggest any solution. I am just learning from the examples.

@jnthn
Copy link
Contributor

jnthn commented Feb 26, 2019

Curious; I've never heard of :raw. That thing it describes is spelled Q/.../, which is the base quoting construct that doesn't do backslashes or anything else except the standard terminator-seeking behavior.

@manwar
Copy link
Author

manwar commented Feb 26, 2019

Even this one is not working?

say q:0/:0 (no interpolation) even backslash has no special meaning: \ /;

===SORRY!=== Error while compiling /home/manwar/github/perl6-cookbook/strings/t.pl
Colons may not be used to delimit quoting constructs
at /home/manwar/github/perl6-cookbook/strings/t.pl:3
------> say q:⏏0/:0 (no interpolation) even backslash h
expecting any of:
colon pair (restricted)

@jnthn
Copy link
Contributor

jnthn commented Feb 26, 2019

Ah, it's not in the docs, but in the examples repository. But no, there's no :0, :1, :2, etc. https://docs.perl6.org/language/quoting is part of the docs, and looks accurate. I'm not sure whether this issue belongs here or on the examples repository; I wasn't even aware that contained documentation-ish stuff. Maybe somebody more involved with the docs can say; I can only confirm it's wrong.

@manwar
Copy link
Author

manwar commented Feb 26, 2019

Shall I submit PR to cleanup the example to respect the official document?

@jnthn
Copy link
Contributor

jnthn commented Feb 26, 2019

@manwar That would be wonderful. It'll be in https://github.com/perl6/perl6-examples rather than this repo.

@manwar
Copy link
Author

manwar commented Feb 26, 2019

I will do that tomorrow and that will be my first ever PR for Perl 6.

@JJ
Copy link
Contributor

JJ commented Feb 27, 2019

Since this has been fixed by the OP, I'm closing it. Thanks @manwar

@JJ JJ closed this as completed Feb 27, 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

3 participants