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

INVESTIGATE: PWC 261p2 #39

Open
codereport opened this issue Mar 19, 2024 · 1 comment
Open

INVESTIGATE: PWC 261p2 #39

codereport opened this issue Mar 19, 2024 · 1 comment
Assignees
Labels
investigate This doesn't seem right

Comments

@codereport
Copy link
Owner

https://theweeklychallenge.org/blog/perl-weekly-challenge-261/

How to refer back to first arg at this point

image

@codereport codereport added the investigate This doesn't seem right label Mar 19, 2024
@codereport codereport self-assigned this Mar 19, 2024
@tom-huntington
Copy link

tom-huntington commented Mar 26, 2024

You need to use Φ₁ and l to get at the first argument. However, (len iota0 2 pow) * is a 2 2 chain (an ε' combinator), which means 2 2 2 (Φ₁) will shadow the ε' by Jellys resolution rules. To get around this you can use B₁/i:

> [5,3,6,1,12] 3 :: len iota0 2 pow * i pair l
                     L    Ḷ   2  *  × ¹  ,   ḷ
   L        [5,3,6,1,12] 3 ➡️  5
   LḶ       [5,3,6,1,12] 3 ➡️  [0, 1, 2, 3, 4]
   LḶ2      [5,3,6,1,12] 3 ➡️  [0, 1, 2, 3, 4]2
   LḶ2*     [5,3,6,1,12] 3 ➡️  [1, 2, 4, 8, 16]
   LḶ2*×    [5,3,6,1,12] 3 ➡️  [3, 6, 12, 24, 48]
   LḶ2*×¹   [5,3,6,1,12] 3 ➡️  [3, 6, 12, 24, 48]
   LḶ2*×¹,  [5,3,6,1,12] 3 ➡️  [[3, 6, 12, 24, 48], 3]
   LḶ2*×¹,ḷ [5,3,6,1,12] 3 ➡️  [[3, 6, 12, 24, 48], [5, 3, 6, 1, 12]]
    This is a 1-1-0-2-2-1-2-2 dyadic chain (BEₚε'B₁Φ₁)
              └┬┘   ⋮ ⋮ ⋮   ⋮
               B    ⋮ ⋮ ⋮   ⋮
               └─┬──┘ ⋮ ⋮   ⋮
                Eₚ    ⋮ ⋮   ⋮
                 └─┬──┘ ⋮   ⋮
                  ε'    ⋮   ⋮
                   └─┬──┘   ⋮
                    B₁      ⋮
                     └──┬───┘
                       Φ₁
>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants