ClojureScript

Multiple defn with same arity

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    clojure 1.5.1
    lein-cljsbuild 0.3.2

Description

In Clojure:

> (defn f ([x] x) ([x] (+ x 1)))
CompilerException java.lang.RuntimeException: Can't have 2 overloads with same arity, compiling:(NO_SOURCE_PATH:1:1)

ClojureScript:
> (defn f ([x] x) ([x] (+ x 1)))
[ OK ]
> (f 1)
2

Activity

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: