[graalvm-users] RC6 to_s behavior changed

Rodrigo Botafogo rodrigo.a.botafogo at gmail.com
Thu Sep 13 18:38:25 PDT 2018


Hi Chris,

Yes, I've read the Interop log, but I didn't quite realize the
consequence.  Anyway, this is not really critical, as I can send the
Interop back to R for printing.  I don't have yet an idea what the contract
should be...

Thanks,



On Thu, Sep 13, 2018 at 12:54 PM Chris Seaton <chris.seaton at oracle.com>
wrote:

> Hello Rodrigo,
>
> The old behaviour worked because to_s called Java’s toString. We changed
> that to call Ruby’s inspect instead. It was decided across all Truffle
> languages that we shouldn’t be relying on Java’s toString behaviour,
> because there’s no contract on what that should be for Truffle languages.
>
> I think this change was part of the proposed interop change log I sent you
> on the 24th for your opinions, but I wouldn’t blame you for missing it as
> it was a long list and it’s hard to see how they all apply to your codebase.
>
> What we need is a proper Truffle contract for converting values to strings.
>
> Let us know what you think it should be.
>
> Chris
>
> > On 13 Sep 2018, at 16:36, Rodrigo Botafogo <rodrigo.a.botafogo at gmail.com>
> wrote:
> >
> > Hello...
> >
> > In rc5 with the following code:
> >
> > p1 = Polyglot.eval("R", 'as.formula').call("medv ~ lstat + age")
> > p p1
> > p p1.to_s
> >
> > I get the following result:
> >
> > #<Truffle::Interop::Foreign at 2a984952>
> > "language(medv ~ lstat + age)"
> >
> > in rc6, the same code prints:
> >
> > #<Foreign [#<Foreign:0x49d979c4>, #<Foreign:0x3ba5c4dd>, #<Foreign
> [#<Foreign:0x47fca3cc>, #<Foreign:0x55746340>, #<Foreign:0x6a0c7af6>]>]>
> > "#<Foreign [#<Foreign:0x49d979c4>, #<Foreign:0x3ba5c4dd>, #<Foreign
> [#<Foreign:0x47fca3cc>, #<Foreign:0x55746340>, #<Foreign:0x6a0c7af6>]>]>"
> >
> > The old behavior is preferred, if possible.
> >
> >
> > Thanks
> > --
> > Rodrigo Botafogo
> >
> > _______________________________________________
> > GraalVM-Users mailing list
> > GraalVM-Users at oss.oracle.com
> > https://oss.oracle.com/mailman/listinfo/graalvm-users
>
>

-- 
Rodrigo Botafogo
Integrando TI ao seu negócio
21-3010-4802/11-3010-1802
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20180913/1cb0000d/attachment.html 


More information about the GraalVM-Users mailing list