ClojureScript

Keyword invoke is inconsistent with clojure

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    CLJS 1934

Description

ClojureScript:

(deftype Empty []
  ILookup 
  (-lookup [o k] :nothing)
  (-lookup [o k not-found] not-found))

(:a (Empty.))

==> nil

Clojure:

(import clojure.lang.ILookup)
(deftype Empty []
  ILookup
  (valAt [o k] :nothing)
  (valAt [o k not-found] not-found))
(:a (Empty.))

==> :nothing

I realize that returning something other than nil for not-found is a questionable design decision but unless Clojure is changed it seems to me ClojureScript should be consistent.

Activity

David Nolen made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: