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

Already on GitHub? Sign in to your account

[PATCH] add a getenv variant with default value #267

fperrad opened this Issue Jan 8, 2011 · 5 comments


None yet
4 participants

nddrylliog commented Jan 9, 2011

Nice addition, but isn't getenv handling the implicit conversion from String to CString already? (Because it's an extern function and there are "implicit as" definitions between String and CString and vice versa)


duckinator commented Nov 28, 2011

@nddrylliog this hasn't been fixed.

This may work, as you said:

    get: static func ~withDefault (variableName, defaultValue: String) -> String {
        x := getenv(variableName)
        x != null ? x toString() : defaultValue



nddrylliog commented Dec 13, 2012

@shamanas This is.. way overdue, but we could merge that anyway, right?


shamanas commented Dec 14, 2012

I'll take care of it when I'm back from university


nddrylliog commented Nov 2, 2013

@shamanas bumpy bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment