-
Notifications
You must be signed in to change notification settings - Fork 110
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
Game of Life in )demo? #194
Comments
It's pretty cool but I feel it's a bit too rich a concoction for the demo, which aims to show the fundamentals. |
I ran the code to see what 'box' was doing in Ivy and TryAPL use different models of boxing. In Ivy, boxing something just means creating a singleton vector containing that thing: They kind of look like the same model because the pretty-printer in TryAPL does not distinguish them. In the display below, the boxed R (⊂R) and the 1-element vector containing R (2 ↓ 1 2 R) look exactly the same, but you can distinguish them with rho.
I don't fully understand the interactions in TryAPL between boxed values and "each". I would not have expected the two features to interact at all, but empirically they do: |
@robpike can we close this? There's already a discussion in the discussion section which mentions |
With the addition of
@
, ivy now does a half decent looking GoL one liner (based on the TryAPL version, the use of box is different from the use in TryAPL, and I'm not 100% sure why).The only feature that is really missing is
⍣
(repeat
, which repeatedly applies the operator "to the power"), and there's some "binding" thing∘
which seems to bind one argument of a binary operator and then can be used with an each to repeatedly apply the resulting "unary" operator. It's easily replaced with a loop (and I guess a more direct syntax would require first class operators?). edit: The "Binding thing" is just the outer product,R∘gen¨ ⍳4
, but maybebinaryOp@ 1 2 3 4
, is producing some kind of closure?)Is this worth including in the demo?
The text was updated successfully, but these errors were encountered: