[Ironruby-core] handling ruby types and CallSiteStorage in std library
Tomas.Matousek at microsoft.com
Fri Nov 27 17:38:18 EST 2009
It depends whether the method is supposed to invoke Digest's methods dynamically or not. Does pkcs5_keyivgen method accept any Ruby object that implements the methods pkcs5_keyivgen calls? Or does it need to be an instance of Digest class?
If the former is true than you need to use "object" as the parameter type and use dynamic call sites to invoke those methods. An example of such dynamic behavior would be MutableStringOps.Compare. If the latter is true you can just type the parameter to Digest CLR type and call its methods directly.
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Dylan McClung
Sent: Friday, November 27, 2009 9:34 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] handling ruby types and CallSiteStorage in std library
I'm working on adding code to the OpenSSL extension of the standard library and I need to understand the design for invoking and typing Ruby code. I read the 'Modifying the sources' github page and it mentions using CallSiteStorage to call into Ruby code.
Specifically, the Cipher ruby class has a dependency on the Digest ruby classes for the pkcs5_keyivgen method. An optional parameter for this method is an instance of the Ruby class Digest::Base. How would the type look, maybe Digest.Digest.Base digest/*optional*/? Or would it be an object and I'd also need to pass in CallSiteStorage to call methods on the object?
An example in the standard library of such behavior would be much appreciated, thanks for any help.
Posted via http://www.ruby-forum.com/.
Ironruby-core mailing list
Ironruby-core at rubyforge.org
More information about the Ironruby-core