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

Segmentation fault on invoking oddly defined procedure. #35

Open
zigggit opened this issue May 5, 2020 · 1 comment
Open

Segmentation fault on invoking oddly defined procedure. #35

zigggit opened this issue May 5, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@zigggit
Copy link

zigggit commented May 5, 2020

If a procedure similar to the following is defined

to stuff [ 1 ]
print [Any Logo you like here]
end

then UCB Logo exits with a segmentation fault as soon as the procedure is invoked.

Is this even a valid thing to define? My knowledge isn't good enough to be certain, but I suspect it might not be. Perhaps such a definition should be rejected in the first place.

@brianharvey
Copy link
Collaborator

Indeed, that's not a well-formed TO form. It should error rather than segfaulting, of course.

My guess is that TO is treating the [1] as if it were [:foo], i.e., using 1 as the variable name for a rest argument. So when STUFF is invoked, it's trying to set the value of 1 to a list of inputs (in this case an empty list, but if it were (STUFF A B C) the list would be [A B C].

You can have a variable named 1, by saying MAKE 1 [some value]. Then
? print 1
1
? print :1
some value

@jrincayc jrincayc added the bug Something isn't working label Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants