3 ms·
It would be more correct to say that they can be coerced to a function with a special purposes (e.g. using a set as a function is an alias for checking whether
by stingraycharles 8y ago
It would be more correct to say that they can be coerced to a function with a special purposes (e.g. using a set as a function is an alias for checking whether an item exists).
To say they are functions would be incorrect. By the same logic, a keyword is would be a function.
- jffry 8y agoThey're callable as functions, i.e. they implement clojure.lang.IFn. So unless you want to shave hairs on what it means to say they're not "functions", they _are_ functions. Sets, vecs, maps, keywords, and IIRC symbols are all IFn Oh and (#{1 2} 3) is equivalent to (get #{1 2} 3) not (contains? #{1 2} 3)
- stingraycharles 8y agoI think that it depends upon what you interpret it when you say “it’s a function”; it’s data as well. Which, now that I reconsider it, was kind of the point that the parent was trying to make, that they’re also very much unified. So point taken.