Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented comparison operators (min and max) #37

Closed
wants to merge 1 commit into from

Conversation

ilijapuaca
Copy link

I implemented most of this a few days back, mostly reusing what's currently in the repo.

There is a bug with max operator with custom comparison closure, hence the test fail, but I thought I'd open up a PR and see if you guys have any ideas

The bug itself is probably pretty straight-forward to fix, I'm just having a hard time reasoning what min and max operators with custom comparison closures are supposed to do in the first place. I assume it's just a matter of somehow "inverting" the logic for min and max operators, after the custom closure is executed. The test that's failing is called testCustomMaxSendsCorrectValue.

Let me know how all of this looks, and I can address any feedback asap.

On a side note -- one thing that slowed me down quite a bit was trying to squeeze in some of the code with lengthy generic names into single lines. Is there a reason with went for 90 char/line limit? It seems pretty strict, leaving basically half of my laptop screen empty. On projects I previously worked on, the number was usually in 130-150 range. Just curious if it's open for debate or not :)

@spadafiva
Copy link
Collaborator

@ilijapuaca

I'm used to having about 120 as a reasonable size and I think 90 makes it hard to write functions that don't get very contorted, but @broadwaylamb prefers 90 so that you can fit 2 side by side on a 13" screen. FWIW, I would prefer a higher character limit.

@broadwaylamb
Copy link
Member

Thank you so much for taking this! I’m going to look through this soon.

@ilijapuaca
Copy link
Author

Any chance we can add this PR to #1 and the Project, I'd do it myself but I'm not able to. Just trying to make sure no duplicate work gets done as PRs might take a while to merge

@broadwaylamb broadwaylamb mentioned this pull request Jul 29, 2019
83 tasks
@broadwaylamb
Copy link
Member

Can you please synchronize this with the master branch?

@ilijapuaca
Copy link
Author

Done. Did you get a chance to take a look at the issue with the test I mentioned above?

I was busy this last week, hoping to get some more work done this weekend.

@broadwaylamb
Copy link
Member

Right now I'm working on #29 and #30, I'll look into this as soon as I'm done there (hope that'll be quick 🙂).

@ilijapuaca
Copy link
Author

Sounds great! I'll address any feedback as soon as you get the review done

@broadwaylamb broadwaylamb added the missing functionality This functionality is present in Apple's Combine but we don't have it yet label Aug 9, 2019
@broadwaylamb
Copy link
Member

I'm really sorry it's been so long.

I've done some refactoring that should make implementing this kind of operators trivial, and I'm currently working on it in #76. I'll definitely use the test cases that you wrote, so thank you @ilijapuaca for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing functionality This functionality is present in Apple's Combine but we don't have it yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants