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

Add validation in map-> #7

Open
cbilson opened this issue Jan 4, 2013 · 2 comments
Open

Add validation in map-> #7

cbilson opened this issue Jan 4, 2013 · 2 comments
Milestone

Comments

@cbilson
Copy link
Owner

cbilson commented Jan 4, 2013

I often make the mistake of saying something like (get-contract-details ... { :security-type :equity }) when I should say :type :equity. I get an error message from IB, but it's not immediately obvious what's wrong.

Maybe map->, the thing that's used internally to convert from maps like the one you give for the contract parameter to get-contract-details should warn or fail if there are any keys in your map that aren't going to be translated, giving a list of the keys that will be.

I originally didn't think this would be a good idea, thinking you might want to have contract maps with extra stuff that you wanted to use to keep track of something else, but that doesn't seem that useful anymore.

Alternatively, there are a couple of common mistakes (like :type not being set or one of :symbol/:local-symbol not being set. We could just warn about these things.

@ejackson
Copy link
Collaborator

ejackson commented Jan 4, 2013

Would clj-schema help here ? https://github.com/runa-dev/clj-schema

@cbilson
Copy link
Owner Author

cbilson commented Jan 4, 2013

Yeah, good! This looks like it might be really useful.
On Jan 4, 2013 5:36 AM, "Edmund Jackson" [email protected] wrote:

Would clj-schema help here ? https://github.com/runa-dev/clj-schema


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-11882888.

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

No branches or pull requests

2 participants