Re: [julia-users] Re: Nothing conditional operator

2016-06-29 Thread Jeffrey Sarnoff
Good. Perhaps this is appropriate as a template for others. On Wednesday, June 29, 2016 at 6:24:35 PM UTC-4, Yaakov Borstein wrote: > > > > On Monday, March 21, 2016 at 1:56:34 AM UTC+2, Jeffrey Sarnoff wrote: >> >> Redis itself is written in C. They document GET key: >> >>> Get the value of key.

Re: [julia-users] Re: Nothing conditional operator

2016-06-29 Thread Yaakov Borstein
On Monday, March 21, 2016 at 1:56:34 AM UTC+2, Jeffrey Sarnoff wrote: > > Redis itself is written in C. They document GET key: > >> Get the value of key. If the key does not exist the special value nil is >> returned. > > An error is returned if the value stored at key is not a string, because

Re: [julia-users] Re: Nothing conditional operator

2016-06-18 Thread YB Israel
see my comment to https://github.com/jkaye2012/Redis.jl/issues/26 On Monday, March 21, 2016 at 11:40:38 AM UTC+2, Milan Bouchet-Valat wrote: > > Le dimanche 20 mars 2016 à 16:56 -0700, Jeffrey Sarnoff a écrit : > > Redis itself is written in C. They document GET key: > > > Get the value of key.

Re: [julia-users] Re: Nothing conditional operator

2016-03-21 Thread Milan Bouchet-Valat
Le dimanche 20 mars 2016 à 16:56 -0700, Jeffrey Sarnoff a écrit : > Redis itself is written in C. They document GET key: > > Get the value of key. If the key does not exist the special > > value nil is returned.  > > An error is returned if the value stored at key is not a string, > because GET 

Re: [julia-users] Re: Nothing conditional operator

2016-03-20 Thread Jeffrey Sarnoff
Redis itself is written in C. They document GET key: > Get the value of key. If the key does not exist the special value nil is > returned. An error is returned if the value stored at key is not a string, because GET only handles string values. digging

Re: [julia-users] Re: Nothing conditional operator

2016-03-20 Thread jock . lawrie
Redis.jl returns nothing when requesting a the value of a key that doesn't exist: using Redis conn = RedisConnection() r = get(conn, "non_existent_key") disconnect(conn) r == nothing# true On Sunday, March 20, 2016 at 1:31:30 AM UTC+11, Milan Bouchet-Valat wrote: > > For now I don't know

Re: [julia-users] Re: Nothing conditional operator

2016-03-19 Thread Milan Bouchet-Valat
For now I don't know of a good solution to this pattern, but there's been some discussion about it: https://github.com/JuliaLang/julia/issues/15174 You should definitely use a Nullable instead of returning nothing. Regards Le samedi 19 mars 2016 à 02:58 -0700, Jeffrey Sarnoff a écrit : > You

[julia-users] Re: Nothing conditional operator

2016-03-19 Thread Jeffrey Sarnoff
You may be misusing nothing. It is unusual that a function would return nothing some of the time and something other times. Take a look at http://docs.julialang.org/en/latest/manual/faq/#nothingness-and-missing-values If you have additional questions about this, please give an example of what