Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Formal language specification

 These all should be documented in the semantics document.  So in answer to
your question:

      Shall I report them in Bugzilla?
 
By all means, please do.  Just copying in your message into a docs bug
report would be good, but any cleaning up you want to do would be
appreciated.

   I think all such undefined behaviors should be defined :) 

As a schemer, I think it's valuable to have undefined behaviors to keep
programmers from using features (like the undefined argument evaluation
order for Scheme).  So I'd amend your proposal to "all such undefined
behaviors should be defined or flagged as purposely undefined" *smile*.

-erik

-----Original Message-----
From: aspectj-users-admin@xxxxxxxxxxx
[mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Lukasz Skowronski
Sent: Sunday, August 01, 2004 7:21am
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Formal language specification

Hey Adrian,

From: "Adrian Powell" <aspectj-users@xxxxxxxxxxxxxxxx>

> >    I was looking for a document which would formally describe 
> >AspectJ language grammar and its expected behaviour but couldn't find 
> >anything
like
> >
> >
> Have you looked at the Programmer's Guide off www.eclipse.org/aspectj ?
> Appendix B covers the language semantics in some depth:
>

Yes, I have. I know this guide. Ok, I admit it's not bad but it isn't
complete in my opinion.
I think that the section about context exposure lacks some important
informations.

It doesn't specify what this, target and args pointcuts collect in different
pointcut types (by pointcut types I mean call, execution, get, set and so
on)

I was a little surprised that the following advice was never executed:

after(Object o)  : call(Object+.new()) && target(o) {
    // do something with o
}

It seems that call_constructor pointcut never exposes target object and it
can't be collected by target pointcut.
Unfortunatelly I haven't seen it stated in the guide.

Another thing is collecting args by pointcut which is later used in cflow
pointcut. If that cflow is then matched more than once in given joinpoint
then which args will be exposed?

Example (not very useful in real life but simple):

public class A {
    void doSth() {
    }

    int factor(int x) {
        doSth();
        if (x <= 1) {
            return 1;
       }
        return x * factor(x-1);
    }
    public static void main(String[] args) {
        new A().factor(11);
    }
}


public aspect AAsp {
 pointcut pc(int x) : execution(* A.factor(int)) && args(x);  before(int x)
: execution(* A.doSth()) && cflow(pc(x)) {
  System.out.println(x);
 }
}

After running this example we can see that x value is always taken from the
latest cflow match. However I can't see in specification if it is a feature
and I can rely on it.


I think all such undefined behaviors should be defined :) Shall I report
them in Bugzilla?

Regards,
Luke

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top