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

Second case of $@ is not checked to be a cell. #6081

Open
eamsden opened this issue Nov 14, 2022 · 5 comments
Open

Second case of $@ is not checked to be a cell. #6081

eamsden opened this issue Nov 14, 2022 · 5 comments

Comments

@eamsden
Copy link
Contributor

eamsden commented Nov 14, 2022

Describe the bug
$@(%our ship) compiles

To Reproduce
Compile |% +$ wat $@(%our ship) --

Or this file

Expected behaviour
Hoon should check that the second case of $@ is a cell

Notify maintainers
If you happen to know who the appropriate maintainers are, consider mentioning them with an @ here. You may want to use git blame to see who has last touched any relevant code.

@eamsden eamsden added the bug label Nov 14, 2022
@eamsden
Copy link
Contributor Author

eamsden commented Nov 14, 2022

HT @midsum-salrux

@Fang- Fang- added the hoon label Nov 14, 2022
@joemfb
Copy link
Member

joemfb commented Nov 14, 2022

I've looked at this sort of thing a little big. $ runes (specs) are all just macros, expanded prior to type inference, so I think we'll need a natural hoon for setting gol to fix these.

@ohAitch
Copy link
Contributor

ohAitch commented Nov 15, 2022 via email

@joemfb
Copy link
Member

joemfb commented Nov 15, 2022

Unfortunately $> and $< currently assert relative to the head of a cell, limiting them to specializations of $%. I'm inclined to think they should work as you suggest.

Also, $@ shouldn't need any runtime behavior, just a nest check without a cast or assertion (which is why I'm suggesting a new hoon for gol checking).

@ohAitch
Copy link
Contributor

ohAitch commented Nov 15, 2022

I mean the way it's documented, it wants runtime behavior to ?- on @ vs ^ when molding, though I do think it expands to just $? in practice.

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

No branches or pull requests

4 participants