Skip to content

Details ~ Transformation Description

Vlad Ureche edited this page Jun 11, 2015 · 10 revisions

If you haven't read the [[introduction|Tutorial--Introduction]] and [[first example|Tutorial--Example-(Part-1)]] already, it's a good time to do so, as this advanced discussion assumes familiarity with the ildl-plugin.

In this section we will show some tricks for creating transformation objects. There are five sections:

  • Transformation Objects
  • Writing Coercions
  • Handling Generics
  • Intercepting Methods
  • Annotations

All of the API mentioned in this part lives in the ildl-plugin repository, in the components/runtime/src directory. If you have imported the ildl-* projects in the Scala IDE, you can find the classes under the ildl-runtime project, in the src directory.

Transformation Objects

There are two types of transformation objects:

The difference comes from the ability to target generic data types: flexible transformations can target any generic type while rigid transformations can only target monomorphic types.

**It is important to distinguish between targeting generics and targeting inside generics. Current ildl transformations can target generic types such as forall T. List[T] and transform it to LazyList[T] but, under the current generics compilation scheme, they cannot target inside generics, for example targeting BigInt inside List[BigInt].

This is why, in the efficient collections benchmark, we had to create two objects: BigIntToLong and QueueOfBigIntToFunnyQueue. This will be further discussed [[later|

From here:

Frog Work Ahead: Some of the pages of this wiki are in flux. If you can't find what you are looking for, please [file a bug](https://github.com/miniboxing/ildl-plugin/issues).
Clone this wiki locally