Skip to content

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

@zoffixznet

Description

@zoffixznet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFERequest for enhancement. Try to use alternative wording that explain the concept more clearlybigIssue consisting of many subissuesdocsDocumentation issue (primary issue type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions