ClojureScript

Need to enforce "Can't have fixed arity function with more params than variadic function"

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

Description

In Clojure:

> (defn f
([a] :one])
([& many] :many))
CompilerException...Can't have fixed arity function with more params than variadic function

In ClojureScript:
> (defn f
([a] :one])
([& many] :many))
[ succeeds ]
> (f 1)
:many
> (f 1 2)
:many

ClojureScript should throw an error like Clojure.

  1. cljs-627-20131104.diff
    04/Nov/13 1:18 PM
    3 kB
    Travis Thieman
  2. cljs-627-20131104-2.diff
    04/Nov/13 3:58 PM
    3 kB
    Travis Thieman
  3. fixed-arity-20131021.diff
    21/Oct/13 10:01 AM
    2 kB
    Travis Thieman

Activity

Travis Thieman made changes -
Field Original Value New Value
Attachment fixed-arity-20131021.diff [ 12348 ]
Travis Thieman made changes -
Attachment cljs-627-20131104.diff [ 12431 ]
Travis Thieman made changes -
Attachment cljs-627-20131104-2.diff [ 12433 ]
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: