Skip to content

Conversation

@jemc
Copy link
Member

@jemc jemc commented Feb 8, 2015

Add the try_find_const_fast instruction,
which returns undefined instead of raising NameError when the constant is not found.

This can be helpful for other languages on the Rubinius VM, trying to implement different constant lookup semantics, but still want to benefit from the ConstantCaches.

which returns undefined instead of raising NameError when the constant is not found.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace here shouldn't be needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was copied verbatim from the find_const_fast visit above.

@jemc
Copy link
Member Author

jemc commented Feb 9, 2015

I guess this will fail on Travis until https://github.com/rubinius/rubinius-compiler/pull/3 is added and released.

@jemc
Copy link
Member Author

jemc commented Apr 18, 2015

I've decided to take a different approach with constant lookup using Rubinius.global_serial, so this is not needed for me with Myco anymore, although I think that doing this for Titanius is a good long term goal. Returning undefined instead of raising an exception for missing constants is an easier-to-use operation. Something similar for instance variables would be nice too. Returning undefined instead of nil for missing instance variables is easier to use as well.

I'm closing for now, but we can discuss this more as Titanius begins to take shape.

@jemc jemc closed this Apr 18, 2015
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.

2 participants