Subject: weaver=traversal.scm
From: Gregor Kiczales (gregor@cs.ubc.ca)
Date: Mon Apr 01 2002 - 18:31:45 EST

Attached is a revised version of the compilation into AspectJ of the simple

In this version, everything that is interesting is in Total.java. None of
the other classes has either source or intermediate compiled code for the

 - The complete source code for the traversal and the pointcuts is there

 - The semantics of declare traversal salaryTraversal ... is that it
   defines a static method of the enclosing aspect named salaryTraversal.
   We should look at that some more.

 - The complete expansion into AspectJ is there

    - we are using private open class declarations to define all the
      expansion of the traversal itself

    - this allows us to give the traversal a short name (TRAVERSAL$1)
      and not run into name conflicts. In the old version, the name
      t was sure to run into name problems

But we think we've found a problem with the design of the crossing pointcut.
What exact semantics did you intend for it? And for traversal? The problem
seems to be that traversal will match 'arrive' points in the traversal, and
'crossing' will match crossing of fields. But && those two together will
be null. We think the way to fix it is to make crossing take two arguments,
a traversal name and a field name. That would make the source code for the
crossingAdmin pointcut be:

    pointcut crossingAdmin(Company c, Object ad):
        && crossing(salaryTraversal admin) // we follow a field named 'admin'
        && this(c) // in a Company
        && target(ad); // that holds a value of any type

BTW, the implementation of all this in Aspect SandBox is looking to be about 100
lines of code. Yay!

This archive was generated by hypermail 2b28 : Mon Apr 01 2002 - 18:29:33 EST