<div dir="ltr">Hello,<div><br></div><div>Is there a way to dynamically check the type of a Truffle::Interop object?</div><div><br></div><div>For instance, in this code:</div><div><br></div><div><div># evaluate an integer in R and return the result of this evaluation</div><div># this is just an integer</div><div>var = R.eval(&quot;4&quot;)</div><div>puts (&quot;Double evaluated in R: #{var}&quot;)</div><div>p var.is_a? Integer</div><div><br></div><div>&gt;&gt; false</div><div><br></div><div># Create a list in R, that is anonymous in R but available to Ruby.</div><div># We are now using method_missing to resolve the &#39;c&#39; method.</div><div>val = R.c(1, 2, 3, 4)</div><div>p val</div><div><br></div><div>&gt;&gt; #&lt;Truffle::Interop::Foreign@299cab08&gt;</div><div><br></div><div>p val.is_a? Integer</div><div><br></div><div>will raise an exception on the val.is_a? Integer </div><div><br></div><div>Internal error occured: org.graalvm.polyglot.PolyglotException: org.truffleruby.language.control.RaiseException: Message not supported: INVOKE (UnsupportedMessageException)</div><div><br></div><div>I understand the message and why, but this kind of breaks the ability to check types dynamically and every code that does that.  </div><div><br></div><div>As a programmer, I would like to see Interop inherit from the Object Class so that it works as any other Ruby object.  Better yet, if I could identify at runtime the language the Interop pointer is referencing: Ruby, Python, etc.  Is this possible?</div><div><br></div><div>Probably I&#39;m missing something... comments?</div><div><br></div><div><br></div><div>Thanks a lot</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Rodrigo Botafogo<br></div></div></div>