This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: annotations for Kawa


On 12/05/2010 12:32 PM, Helmut Eller wrote:
* Per Bothner [2010-12-05 20:01] writes:
Is the @ new lexical syntax or just a naming convention?

It's a naming convention - I don't intend to change the reader. Instead, this would be "recognized" by Scheme.checkDefaultBinding - the same place where we also recognize TypeName? and quantities.

So @AnnotationType denotes the annotation AnnotationType like<FOO> denotes the type named FOO.

Yes. (Though the angle brackets are semi-deprecated. The symbol FOO dnotes the type FOO if there is no lexical name FOO or FOO in the current environment *and* there is a class FOO.)

Can macros expand to annotations? E.g. in

(define (a) (b) (c))

could b be a macro that expands to (@Deprecated) ?

A macro could expand to an annotation value - i.e. a instance of a class that implements java.lang.Annotation and some annotation type.

The question is whether macro expansion if (b) would happen in time for
the 'define' to see that it's an annotation.  I hope so, but I'm not sure.
It might be somewhat fragile - there are of course a number of issue
when you have multiple "phases" doing things.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]