What are Aspects? (Re: How can I make my assertions smarter?)

Evan Simpson evan at tokenexchange.com
Thu Nov 11 13:14:08 EST 1999


<disclaimer>All I know about Aspects I learning in a half-hour of
browsing</disclaimer>

I think that this depends on the language in which you write your Aspects (I
don't mean C/Python/etc, I mean the special Aspect-specification language).
In the examples I looked at, pattern-matching on the class, method, and
method arguments determined where each part of an Aspect would be applied.
Effectively, you could say thing like:

o Insert this code before the start of all methods of every class
o Put this code in a try...finally wrapped around the body of any method
named "foo" in any class
o Insert this code after the end of all constructors of classes "Fee",
"Fie", and "Foe"

It all looks very interesting and powerful, but I haven't the faintest idea
how it could be applied to a dynamic language like Python.  From what I
could tell, the existing implementation depends on all classes and methods
being defined and fixed at compile time.

Aahz Maruch <aahz at netcom.com> wrote in message
news:80eocf$8rc$1 at nntp5.atl.mindspring.net...
> I feel like I'm still missing something.  What if you only want half of
> your classes to get ref-counting?  Or are you saying that aspects are by
> definition applied across *all* code, and that they're more like hooks
> into the Python interpreter?

Cheers,

Evan @ 4-am






More information about the Python-list mailing list