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

cleaned up weld a bit, it was doing uncessary homo operations #45

Closed
wants to merge 1 commit into from
Closed

cleaned up weld a bit, it was doing uncessary homo operations #45

wants to merge 1 commit into from

Conversation

ericfode
Copy link
Contributor

@ericfode ericfode commented Oct 2, 2013

No description provided.

@cgyarvin
Copy link
Contributor

cgyarvin commented Oct 2, 2013

That's a little daring for a novice Hooner! Actually, it is doing unnecessary homo operations. But this is heavy territory and the fix is not quite right. Also it doesn't really matter, as weld is jet-propelled. Alas, I am going to reject a PR for the first time. But not without an A for effort...

@cgyarvin cgyarvin closed this Oct 2, 2013
@ericfode
Copy link
Contributor Author

ericfode commented Oct 2, 2013

If you would not mind I would love to know what was wrong with it so I can improve my understanding of hoon.

@cgyarvin
Copy link
Contributor

cgyarvin commented Oct 2, 2013

It now reads:

  • => .(a (homo a), b (homo b))

It should probably read:

  • => .(a (homo a)a, b (homo b)b)

Ie, just cast it instead of actually doing it. But it's a somewhat
delicate area, doing inference at this level (even Haskell can't really do
it) and I am not terribly inclined to fix right now.

I don't think your code would compile - instead of resetting a and b, which
are there, we try to modify c and d which don't exist.

You can test your own hoon.hoon with

:reset

Be sure to :reload %batz to also get your libraries renewed.

On Wed, Oct 2, 2013 at 4:27 PM, Eric Fode notifications@github.com wrote:

If you would not mind I would love to know what was wrong with it so I can
improve my understanding of hoon.


Reply to this email directly or view it on GitHubhttps://github.com/urbit/urbit/pull/45#issuecomment-25585882
.

@ericfode
Copy link
Contributor Author

ericfode commented Oct 3, 2013

=+ does not add them to scope?

@cgyarvin
Copy link
Contributor

cgyarvin commented Oct 3, 2013

There is no scope - it's not Lisp here. =+ is just nock operator 8,
basically. =+ x replaces your subject s with [x s]. Thus, =+ foo=bar
gives you [foo=bar s]. We search the head first when looking for %foo, and
find your bar.

. is the subject itself. .(x y, z q) is the subject with the limbs x and z
modified to have the values y and q. Thus, on top of the subject you are
pushing another copy of the subject, modifying limbs in that copy that
don't actually exist. So, it may look pretty but it actually ain't...

On Wed, Oct 2, 2013 at 10:36 PM, Eric Fode notifications@github.com wrote:

=+ does not add them to scope?


Reply to this email directly or view it on GitHubhttps://github.com/urbit/urbit/pull/45#issuecomment-25599105
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants