1. Kink Programming Language
  2. Untitled project
  3. kink
  4. Issues
Issue #491 resolved

Implicit conversion between Kink values and Java objects

Taku Miyakawa
created an issue

It is not desirable to wrap all possible container types to be able to contain Kink values. Thus it might be good to provide a mechanism for implicit conversion between Kink values and Java objects.

Comments (3)

  1. Taku Miyakawa reporter

    Draft

    Add a new class ImplicitMeta { value: Value }.

    Operations

    Pass an argument to a Java method

    When the static argument type is Object, the default .into function and .can_into? function wraps the value in ImplicitMeta.

    Get a result from a Java method

    If the static type is Object and the real type is ImplicitMeta, the interpreter unwraps and returns it.

    Get an argument in a proxy function

    If the static type is Object, and the real type is ImplicitMeta, the interpreter unwraps it and passes it.

    Return a result from a proxy function

    When the static result type is Object, the default .into function and .can_into? function wraps the value in ImplicitMeta.

  2. Log in to comment