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

Convert to Java system properties #29

Open
ulsa opened this issue Mar 16, 2015 · 5 comments
Open

Convert to Java system properties #29

ulsa opened this issue Mar 16, 2015 · 5 comments

Comments

@ulsa
Copy link

ulsa commented Mar 16, 2015

Sometimes I need to convert keywords and environment variables to/from the Java system properties syntax that environ uses, eg:

:database-url -> DATABASE_URL -> database.url

Would be nice if this library had that option.

@ulsa
Copy link
Author

ulsa commented Mar 16, 2015

Workaround:

(defn ->java-system-properties-string [k]
  (clojure.string/replace (snake/->snake_case_string k) \_ \.))

@qerub
Copy link
Collaborator

qerub commented Mar 16, 2015

Would be nice if this library had that option.

Agreed.

(defn ->java-system-properties-string [k] …)

I'd prefer the name ->java.system.property.string (with ->java.system.property as the base version) to make the name mirror the output.

Is there perhaps an even better name that doesn't involve Java?

@ulsa
Copy link
Author

ulsa commented Mar 17, 2015

Actually, I tried a name with dots first, but the compiler interprets that name as a Java class. Maybe just a name involving "dots", like dotted-lowercase-string or something?

I'm actually not that happy about names with various delimiters in them. Even though Clojure is forgiving about characters in symbols, there will be clashes (as the Java thing above illustrates). I prefer dashed but descriptive names.

@qerub
Copy link
Collaborator

qerub commented Mar 19, 2015

How do you feel about the identifiers that for illustrative purposes have mixed case (e.g. camelCase and HTTP-Header-Case)?

@ulsa
Copy link
Author

ulsa commented Mar 20, 2015

I admit that they illustrate their purpose, but I think that naming style hurts my ability to make intelligent guesses about names in the library, and that forces me to look them up every time. In the end, I would prefer that they all followed the Clojure naming standard. But that's just me.

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