two (inc) calls give different result (1 and NaN) even though argument evaluates to the same value (nil)

Description

cljs.user=> (apply max [])
nil
cljs.user=> (inc nil)
1
cljs.user=> (inc (apply max []))
NaN

I expect (inc (apply max [])) to evaluate to 1, since (inc nil) evaluates to 1 and (apply max []) evaluates to nil.

Environment

Chromium Version 60.0.3112.113 (Developer Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)

Activity

Show:
David Nolen
September 11, 2017, 7:46 PM

This is not a bug. (apply max []) in Clojure throws because that's an invalid arity.

Declined

Assignee

Unassigned

Reporter

import