Skip to content

Conversation

note
Copy link
Collaborator

@note note commented Mar 15, 2016

I created branch macros to which I will be creating next PR's related to reimplementation of Predicates using macros. This PR is mostly for code sharing and discussion - it just reimplements Predicate1 using macro annotation.

@wheaties please take a look, I am really interested what you think about such approach. I slightly changed an API in 3 places - will add a github comments in those lines in a minute.

}

"have implicit `not` method" in new SpecExamples {
// val filtered = sampleList.filter(Predicate1.not.not(Modulo(2, 0)))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out line worked with old API. Predicate.not.not looked weird so I simply changed it to a method. Maybe I was missing something - how it was intended to be used?

@wheaties
Copy link
Owner

This reduces a lot of boilerplate. You intend to have the macro essentially generate all the variants, a la boilerplate.scala?

👍

@note
Copy link
Collaborator Author

note commented Mar 16, 2016

Yeah, I want to have macro generating all variants of Predicates.

@wheaties
Copy link
Owner

I should add, that if we ever want to get to that 2.10 cross build (yes, I know, I've been terrible about it) while also introducing macros, we should consider adding macro-compat from Miles Sabin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants