Understood. … but shouldn't it be a standardized constant for the whole community to use to avoid any interoperability issues and many reinvented wheels?
The concept of no-value versus nil is a pretty basic one - there must be better solutions (re)invented many times over ;-) -FS. On Jan 14, 2013, at 5:23 PM, Timothy Baldridge <tbaldri...@gmail.com> wrote: > It's fairly common in situations like this to use a namespaced keyword. For > instance ::unknown (which is short for my.namespace/unknown). > > > On Mon, Jan 14, 2013 at 6:06 PM, Frank Siebenlist > <frank.siebenl...@gmail.com> wrote: > I'm using those watcher-fns that get called when the watched ref changes, and > the watcher-fn gets passed the old-value and the new-value. > > Now, nil is a proper value for a key-value and well as a val-value in a map, > so passing nil does not give you the info whether or not an old-value existed > or not, or whether a new-value is nil or no-value. > > With the getter fn: (get m k no-value-here), you have the option to pass this > no-value-here argument which gets returned if there was no value - this > allows you to distinguish nil from "no-value". However, in the watcher-fn you > cannot pass such a no-value argument. > > One possible solution would be to define a well-know URI for the value of > "no-value" - something like for example: > "uri:http://clojure.org/uri/no-value", or some other standardized constant. > > Any other/better suggestions? > > Thanks, FrankS. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > > > > -- > “One of the main causes of the fall of the Roman Empire was that–lacking > zero–they had no way to indicate successful termination of their C programs.” > (Robert Firth) > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en