If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Friday, April 4, 2014

Ceylon: annotations

What is an annotation?

An annotation is a top level function that returns a subtype of ConstrainedAnnotation.

There are 2 interfaces which satisfy ConstrainedAnnotation directly:
  • OptionalAnnotation: An annotation that may occur at most once at a single program element and only on certain program elements.
  • SequencedAnnotation: An annotation that may occur multiple times at a single program element, and only on certain program elements.

Let's see the type hierarchy of ConstrainedAnnotation to get a better picture.


So what you might have thought to be reserved keywords (shared, formal, actual, ...) are in fact annotations used by the compiler.  Let's see how the DocAnnotation is implemented.

No comments:

Post a Comment