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

things we should maybe export in 0.2 #4531

Closed
StefanKarpinski opened this issue Oct 15, 2013 · 10 comments
Closed

things we should maybe export in 0.2 #4531

StefanKarpinski opened this issue Oct 15, 2013 · 10 comments
Labels
needs decision A decision on this change is needed
Milestone

Comments

@StefanKarpinski
Copy link
Member

There are a few useful things that we should probably polish up the interfaces of, document, and export as part of 0.2. source_path is one (#4530), but there are some others, including with_env, warn_once, and maybe tty_rows and tty_cols. There are probable others. For with_env I was considering using the keyword varargs facility to make the interface something like this:

with_env(FOO="BAR", BAZ="QUX") do
  # FOO and BAR temporarily changed in environment
end

but thought that might be a bit too cute. I was considering rolling warn_once into warn via a once keyword that defaults false.

@staticfloat
Copy link
Member

I like the idea of warn having a once keyword. That feels pretty natural.

Perhaps a slightly less cute version would be:

var_name = "BAZ"
with_env({"FOO"=>"BAR", var_name=>"QUX"}) do
  # FOO and BAR temporarily changed in environment
end

That way, you can still have variables containing both keys and values without having to resort to metaprogramming.

EDIT: Too much python in my blood, s/:/=>/g

@StefanKarpinski
Copy link
Member Author

It's also unclear to me whether you really ever need to use this for more than a single environment variable at a time, in which case the current with_env(fun,key,val) API is sufficient.

@JeffBezanson
Copy link
Member

-1 to exporting tty_rows and tty_cols. This API seems likely to change, and using this information at all is a bit suspicious.

@JeffBezanson
Copy link
Member

I kind of like the keyword args for with_env. What's the downside?

@StefanKarpinski
Copy link
Member Author

I like it too. The only downside is that it doesn't allow the key to be an expression, so there would need to be another version of the function that allows you to have that as well.

@staticfloat
Copy link
Member

This reminds me of the desire for a dictsplat function that came up on the
mailing list recently
On Oct 15, 2013 3:12 PM, "Stefan Karpinski" [email protected]
wrote:

I like it too. The only downside is that it doesn't allow the key to be an
expression, so there would need to be another version of the function that
allows you to have that as well.


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

@StefanKarpinski
Copy link
Member Author

Oh yeah. This plus dictsplat would totally work – and of course dictsplat is generally useful. Reminds me that I also want mapsplat.

@JeffBezanson
Copy link
Member

I'm ok with adding warn_once to warn via a keyword argument.
I'm neutral on source_path; it would be ok to add since people do want to use it.
with_env is just a new feature so I vote no on that.

@ViralBShah
Copy link
Member

I would also like to export the BLAS and LAPACK module names, so that the routines within them are easier to get to.

@JeffBezanson
Copy link
Member

I'm ok with that too. 2 dots (LinAlg.BLAS.f) is just too many.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs decision A decision on this change is needed
Projects
None yet
Development

No branches or pull requests

4 participants