-
Notifications
You must be signed in to change notification settings - Fork 24
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
Typechecking Example Request #40
Comments
Sounds like a good example. I won't have time for a bit to do this, but I welcome pull requests! ;) |
I would be happy to generate one if you could give me an outline of how to start. Aspects are much harder than simple monkey patches. You have to keep the original method intact while adding a proxy method around it. I'm still digging into aquarium's internals to see how you did it. |
Sure thing. Thanks for taking an interest. You could start with this class ServiceTracer 2 http://aquarium.rubyforge.org/#n2 include Note that the "names" variable is constructed using the joinpoint If you haven't seen it, the case gem is a nice tool for "pattern matching" Finally, if you use this in real code, be sure to prototype the performance Good luck! dean On Thu, Jan 30, 2014 at 4:13 PM, Chad Brewbaker notifications@github.comwrote:
Dean Wampler, Ph.D. |
I just wanted to log type mismatches on assignment operators. Not something you would run in production, just as a testing tool. I'll try out your suggestion. The approach I had thought out was inserting a proxy into BasicObject that caught the := and :[]= operators, but I got stuck on the details of exactly how to do that. |
Could you add an example that adds a join point upon entering an assignment operator that does a typecheck? This would be very useful even if it only worked on specific classes like String and Fixnum.
The text was updated successfully, but these errors were encountered: