Uploaded image for project: 'ClojureScript'
  1. CLJS-993

binding macro returns non-nil with empty body

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: None
    • Fix versions: None
    • Labels:
    • Environment:

      Ubuntu Linux 12.04
      Clojurescript 0.0-2740

      Description

      In Clojure the binding macro returns nil when called with an empty body. In Clojurescript it returns a non empty object.

      In this repository
      https://github.com/stepugnetti/binding-issue
      I've put a simple project in which the two behaviors are compared. The same code

      (defn foo []
        (if (= nil (binding [*test-var* 1]))
          (.log js/console "Ok!")
          (.log js/console "Too bad!")))
      

      can be run with
      1) Clojure: lein run
      2) Clojurescript: lein cljsbuild once main && node target/binding-issue.js

      I was expecting the same result (nil)...

      See discussion at https://groups.google.com/forum/#!topic/clojurescript/anbDq9pjvEs

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: