You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Continues discussion in commit e01b3ca)
Some examples get warnings when test-compiled. Most are of this kind
WARNINGS for /home/jmerelo/Code/forks/perl6/doc/EVAL_76:
Useless use of constant string "..." in sink context (lines 4, 5)
ok 73 - doc/Language/5to6-perlfunc.pod6 chunk 12 starts with “q/.../” compiles
(You've probably realized I've added the starts with in 4eda9f8 to make the identication of said chunks easier)
This particular one relates to q/.../; # is still equivalent to using single quotes. which is a syntactically fine construct, but it's not so good according to this issue #1748 I raised some time ago: express intent with examples. My point is that warnings warn about something, and maybe we should pay some attention to them.
Besides, there are not so many, and they can be dealt with easily. It can help improve the documentation too. Probably not a priority, but useful anyway.
Another option is to add :skip-test to those pieces of code, and of course to turn warnings into errors.
The text was updated successfully, but these errors were encountered:
Each example code is not intended to be a standalone, working program. Often times we're showcasing something very specific in terms of functionality or syntax, and the examples are intended to be used as part of a larger program.
To this end, we've gone so far as to allow pre-declared code that is included when compiling the example, but is invisible when rendered to the user. (e.g. in your recent change to $list, we could declare "$list" outside the code block itself, so we didn't have to have the variable declaration in the code where we're showing lists, not variables.
So I think forcing each section to be warnings free and include the code is actually getting away from the intent; the intent is often to show a very particular thing. I agree, however, that the examples could in general stand to be reviewed; but I don't agree that making them warnings free is a goal in and of itself. (Note that we're already doing what we can to ignore many types of warnings, e.g. https://github.com/perl6/doc/blob/master/xt/examples-compilation.t#L91 and I intend to update the example compiler to ignore more of them to avoid noisy test output.
Fair enough. I'll close the issue then, unless you want to keep it open as a reminder to update the example compiler. Right now there are only two types of warnings: one is that one illustrated above and the other is Space is not significant here;
(Continues discussion in commit e01b3ca)
Some examples get warnings when test-compiled. Most are of this kind
(You've probably realized I've added the
starts with
in 4eda9f8 to make the identication of said chunks easier)This particular one relates to
q/.../; # is still equivalent to using single quotes.
which is a syntactically fine construct, but it's not so good according to this issue #1748 I raised some time ago: express intent with examples. My point is that warnings warn about something, and maybe we should pay some attention to them.Besides, there are not so many, and they can be dealt with easily. It can help improve the documentation too. Probably not a priority, but useful anyway.
Another option is to add
:skip-test
to those pieces of code, and of course to turn warnings into errors.The text was updated successfully, but these errors were encountered: