5 kyu
Combining predicates
200Expurple
Loading description...
Decorator
Functional Programming
Object-oriented Programming
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Fun kata! I'm always impressed at the clever things you can do with decorators.
I don't know how, but I've lost a revision with a lot of additional tests. In this published revision, test sets 2 and 3 don't even list the arguments yet and aren't used anywhere. I'll close this issue when I restore my work
Done
hi!
can you please give a hint how to solve this kata? I don't understand how to implement the syntax, as an example: "is_even & is_positive"
I have already studied the topic of predicates and bitwise operations
Hi. You need to look up "operator overloading" and "magic methods"
ty :D
I've studied the topics you've given me, but I can't figure out how a function, a class, and just a variable with the same name should be combined with themselves. Can you please suggest the structure of the solution?
I'm not sure what you mean by "combined with themselves". Can you provide a code example?
Hi,
the
Test random logical expressions
declaration needs to be adescribe
block, not ait
one (since it's not a "leaf test block")Cheers
actually, you should get rid of that block and the
test_compound_predicates
function and just run the loop isnide the "random tests" describe blocktest_compound_predicates
is actually necessary and it's called three times with different arguments, but that revision got lost somehow. After I fix that, I'll return to your issue and eliminate that non-leafit
Done
oh, yeah. I didn't read the full test suite (just saw that this block was in red in the output panel)
While the
& | ~
interface is the same, I beleive that it's not a duplicate.Readable Specification Pattern
focuses on class hacks, and this kata focuses on flexible interface not limited to 1 argument