-
Notifications
You must be signed in to change notification settings - Fork 1
Details ~ Transformation Description
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.
There are two types of transformation objects:
- Flexible
TransformationDescription
Objects and -
RigidTransformationDescription
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 asforall T. List[T]
and transform it toLazyList[T]
but, under the current generics compilation scheme, they cannot target inside generics, for example targetingBigInt
insideList[BigInt]
.
This is why, in the efficient collections benchmark, we had to create two objects:
BigIntToLong
andQueueOfBigIntToFunnyQueue
. This will be further discussed [[later|
- continue reading the in-depth explanation scope nesting
- get back to the home page
**Return to the main page** or **return to the OOPSLA Step by Step Guide**