Raku / Raku/doc

Docs on Whatever curry could be clearer / don't cover everything

Open
#2,017 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

big docs RFE
Dominant language
Raku
Stars
308
Forks
288
Avg merge
3d 49m
Merged PRs (30d)
2

Description

Glancing at the intro section on https://docs.perl6.org/type/Whatever I notice a couple of problems.

  1. Roughly the second half of the section is probably not clear enough for the average reader. The section even introduces the term "stored *" only to backtrack on it and try to explain that curry already happened before it.
  2. The information doesn't give all the details when curry happens. Especially when it comes to chained Whatever stars, such as * ≥ * ≥ *, *.uc ~~ *, *.uc xx *.abs etc. In code form (and should already be fairly covered by spec) the list of what decisions are made is encoded here. I think this full information can replace the current second portion of the description.
  3. The section should probably mention that HyperWhatever exists, considering how close the two constructs are.

Update with a couple more comments on the subject: http://colabti.org/irclogger/irclogger_log/perl6?date=2018-09-26


00:54 | Zoffix | vrurg: it's a hardcoded list of things: https://github.com/rakudo/rakudo/blob/da646aa2ee6e3064bdef905f5c0b54b4bd0b2797/src/Perl6/Actions.nqp#L9634-L9665 there's a yet-to-be-fixed docs Issues on the topic D#2017
00:54 | synopsebot | D#2017 [open] : https://github.com/perl6/doc/issues/2017 [docs] Docs on Whatever curry could be clearer / don't cover everything
00:58 | Zoffix | `*` is "Whatever" in those comments, and an already-closurised thing is a "WhateverCode". So, for example in `*.uc.lc` => `*` Whatever => the `.uc` is a `callmethod` op, and so we make a WhateverCode => we now get to `.lc`, since `callmethod` op is level `3` in that list, we continue closing over it and make `{.uc.lc}`-equivalent closure (without the new scope). But `&infix:<~~>` is level 1, so with `*.all ~~
00:58 | Zoffix | Blah` => `.all` is callmethod op, we curry it => we get to `~~` op with WhateverCode in hands, and since `~~` is level 1, we don't curry anymore. But with `* ~~ Blah` we have a Whatever, not WhateverCode, on LHS, so we do curry the level 1 `~~` op

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Whatever page's intro section and compare its explanation with the linked Rakudo Actions.nqp lines 9641–9665. Review the referenced IRC discussion for the curry rules and examples, then update the section so it clearly covers chained Whatever stars and mentions HyperWhatever.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.