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

Add an "Any" type to Scheme interpreter #4

Closed
nlfiedler opened this issue Mar 23, 2013 · 4 comments
Closed

Add an "Any" type to Scheme interpreter #4

nlfiedler opened this issue Mar 23, 2013 · 4 comments
Assignees
Labels

Comments

@nlfiedler
Copy link
Owner

This is a design issue with the Scheme interpreter, in that it is using Go's interface{} meta type everywhere. Really need to create a basic "anything" type that supports a small number of common operations for Scheme objects. Make Atom implement this new type. Then seek out all the occurrences of interface{} and determine if they would be better represented as Any.

@ghost ghost assigned nlfiedler Mar 23, 2013
@nlfiedler
Copy link
Owner Author

Started to do this but seems rather difficult. Will look into it further at anther time.

@ghost ghost assigned nlfiedler Apr 2, 2013
@nlfiedler
Copy link
Owner Author

Okay, will need this for the error location reporting work, so that an Any implementation can hold the original token (or at least the file/row/col where the token was encountered). The key is that the Any type offers String() and Eval() methods, and all of the parser and interpreter code works with these Any instances, and ultimately Eval() is called on the thing to produce a value.

@nlfiedler
Copy link
Owner Author

Location information issue has been resolved. The question of what purpose the Any would serve remains.

@nlfiedler
Copy link
Owner Author

Cannot figure out how this is useful at all. If there is a need to extract additional, narrowly focused, interfaces at a later time, it is pretty easy to do so with Go. For now, there's no advantage to an Any type.

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

No branches or pull requests

1 participant