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

Implement etl #27

Merged
merged 7 commits into from Nov 8, 2015
Merged

Implement etl #27

merged 7 commits into from Nov 8, 2015

Conversation

@sturmer
Copy link

@sturmer sturmer commented Oct 18, 2015

No description provided.

sturmer added 3 commits Oct 17, 2015
The example should be working, I need to fix the tests.
@sturmer
Copy link
Author

@sturmer sturmer commented Oct 18, 2015

Hi everyone, I've just submitted an implementation for ETL. As usual, any comment is welcome.

Loading

@sturmer
Copy link
Author

@sturmer sturmer commented Oct 25, 2015

Dear @yurrriq, @arguello, @bennn, when/if you have time I could use your input on this.

Loading


(test-case
"mixed case input"
(let ([actual (etl mixed-case-input)])
Copy link
Contributor

@bennn bennn Oct 25, 2015

Choose a reason for hiding this comment

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

Could also assert (check-equal? (hash-count actual) (hash-count expected))

Loading

Copy link
Author

@sturmer sturmer Oct 26, 2015

Choose a reason for hiding this comment

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

Good idea, will do.

Loading

sturmer added 2 commits Oct 27, 2015
There is some reasoning to be done about the contract in the example,
but the code should be fine.
The input is now checked in tests. To check the output, one can just
change the last line of the example implementation by removing the
application of the function string-downcase to see the contract
failing spectacularly.
@sturmer
Copy link
Author

@sturmer sturmer commented Oct 28, 2015

@bennn Made some honest contracts working. What do you think?

Loading

@bennn
Copy link
Contributor

@bennn bennn commented Oct 28, 2015

They're good!

Loading

(check-equal? (hash-ref actual k)
(hash-ref expected k))))

(test-true
Copy link
Contributor

@bennn bennn Oct 28, 2015

Choose a reason for hiding this comment

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

A shorter way is

(test-exn
  "test bad input: negative keys"
  exn:fail:contract?
  (lambda () (etl negative-keys input)))

Loading

Copy link
Author

@sturmer sturmer Oct 28, 2015

Choose a reason for hiding this comment

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

Thanks for the comments @bennn. That would also get rid of the (lambda _ #t) which I didn't love --- I'll admit it. I am going to make those changes tomorrow.

Loading

@sturmer
Copy link
Author

@sturmer sturmer commented Oct 29, 2015

The contract testing part is now more concise, thanks again to @bennn.

Loading

@sturmer
Copy link
Author

@sturmer sturmer commented Nov 3, 2015

If this is considered good, could anyone please merge it? I think @arguello was so kind to do it last time? Please let me know if there is anything else I can do on my side.

Loading

(define (etl h)
(for*/hash ([(score letter*) (in-hash h)]
[letter (in-list letter*)])
;(printf "~a: ~a\n" letter score)
Copy link
Member

@yurrriq yurrriq Nov 3, 2015

Choose a reason for hiding this comment

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

I might suggest deleting this line.

Loading

Copy link
Author

@sturmer sturmer Nov 3, 2015

Choose a reason for hiding this comment

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

Approved!

Loading

@yurrriq
Copy link
Member

@yurrriq yurrriq commented Nov 3, 2015

After a quick once over it LGTM. Dig the contracts.

Loading

It was a leftover of debugging mode. Thanks @yurrriq for the tip.
@sturmer
Copy link
Author

@sturmer sturmer commented Nov 3, 2015

@yurrriq Commented line removed. Thanks for digging the contracts :)

Loading

@sturmer
Copy link
Author

@sturmer sturmer commented Nov 8, 2015

@yurrriq Lest this might escape your radar, a small reminder.

Loading

arguello added a commit that referenced this issue Nov 8, 2015
@arguello arguello merged commit 8c1f129 into exercism:master Nov 8, 2015
1 check passed
Loading
@sturmer
Copy link
Author

@sturmer sturmer commented Nov 8, 2015

Thank you @arguello!

Loading

@arguello
Copy link
Contributor

@arguello arguello commented Nov 8, 2015

Thank you :)

Loading

@yurrriq
Copy link
Member

@yurrriq yurrriq commented Nov 8, 2015

Thanks, guys.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants