Re: [julia-users] using in try catch block

2016-07-03 Thread Tony Kelman
Be aware that doing this kind of thing in combination with precompilation is brittle and error prone (precompiled results will not match the actual status of available packages if that changes). Optional dependencies are better supported by moving code that depends on both other packages into

Re: [julia-users] using in try catch block

2016-07-03 Thread Jeffrey Sarnoff
Re: Pkg.is_installed(_), Pkg.is_missing(_) Pkg.has(_) On Monday, June 27, 2016 at 1:48:41 PM UTC-4, Yichao Yu wrote: > > On Mon, Jun 27, 2016 at 1:43 PM, Cameron McBride > wrote: > > > > > > On Mon, Jun 27, 2016 at 1:02 PM, Yichao Yu > wrote: >

Re: [julia-users] using in try catch block

2016-06-27 Thread Yichao Yu
On Mon, Jun 27, 2016 at 1:43 PM, Cameron McBride wrote: > > > On Mon, Jun 27, 2016 at 1:02 PM, Yichao Yu wrote: >> >> On Jun 27, 2016 12:58 PM, "Tom Breloff" wrote: >> > >> > Yichao: is there an alternative "is_installed"

Re: [julia-users] using in try catch block

2016-06-27 Thread Cameron McBride
On Mon, Jun 27, 2016 at 1:02 PM, Yichao Yu wrote: > > On Jun 27, 2016 12:58 PM, "Tom Breloff" wrote: > > > > Yichao: is there an alternative "is_installed" definition that would check the load path? Lets assume I don't actually want to import it, just check.

Re: [julia-users] using in try catch block

2016-06-27 Thread Yichao Yu
On Jun 27, 2016 12:58 PM, "Tom Breloff" wrote: > > Yichao: is there an alternative "is_installed" definition that would check the load path? Lets assume I don't actually want to import it, just check. No. > > On Mon, Jun 27, 2016 at 12:48 PM, Yichao Yu

Re: [julia-users] using in try catch block

2016-06-27 Thread Tom Breloff
Yichao: is there an alternative "is_installed" definition that would check the load path? Lets assume I don't actually want to import it, just check. On Mon, Jun 27, 2016 at 12:48 PM, Yichao Yu wrote: > > On Jun 27, 2016 12:20 PM, "Tom Breloff" wrote: > >

RE: [julia-users] using in try catch block

2016-06-27 Thread David Anthoff
Perfect, that is exactly the kind of thing I was looking for! Thanks, David From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Yichao Yu Sent: Monday, June 27, 2016 9:49 AM To: Julia Users <julia-users@googlegroups.com> Subject: Re: [julia-users]

Re: [julia-users] using in try catch block

2016-06-27 Thread Yichao Yu
On Jun 27, 2016 12:20 PM, "Tom Breloff" wrote: > > Here is what I use for this sort of logic: > > function is_installed(pkgstr::AbstractString) > try > Pkg.installed(pkgstr) === nothing ? false: true Dont do this since this will miss package in load path. Just eval

Re: [julia-users] using in try catch block

2016-06-27 Thread Tom Breloff
Here is what I use for this sort of logic: function is_installed(pkgstr::AbstractString) try Pkg.installed(pkgstr) === nothing ? false: true catch false end end On Mon, Jun 27, 2016 at 12:12 PM, David Anthoff wrote: > I’m trying to use