On Fri, May 23, 2014 at 12:58 PM, David Pérez <[email protected]> wrote: > Thanks Andrzej (it looks like a Poland name).
Yes, it is :) > I'll take a look at it carefully later. > This is my exact use case: > http://stackoverflow.com/questions/23752885/how-to-use-reflection-at-compile-time This is similar to what we do - there is short example in API docs: http://specdevs.bitbucket.org/specgine/api/0.1/#com.specdevs.specgine.macros.states.package We parse few types of fields: Needed[A], Optional[A] and All, also we parse few types of compile time annotations: AllOf[2..9], NoneOf[2..9], SomeOf[2..9], extract those fields and build logic based on them - for example, if we feed the system with Set[Component], we check if it has all the components in Needed[A], AllOf*, etc - and no components of NoneOf[...]. We build methods add and remove, that adds or removes those components to fields (because our Needed/Optional/All are actually extended HashMap's (in 0.2 they became LongMap's) - all those methods: http://specdevs.bitbucket.org/specgine/api/0.1/#com.specdevs.specgine.states.ComponentsManager - are built inside macro, and guarantee that they populates all fields from class T we give to macro with correct data. > I'm creating a DSL for simplifying access to SQLite. > When finished, I'll share via github. Good luck! Andrzej. -- You received this message because you are subscribed to the Google Groups "scala-on-android" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
