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

Repeated applications of `ns` form at the REPL are not additive

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects versions: 1.7.145
    • Fix versions: 1.9.671
    • Labels:
      None
    • Environment:

      Quick start guide with Node REPL

      Description

      In a Clojure REPL, it is possible to declare the same namespace again, without existing namespaces aliases being altered or removed:

      user=> (ns my-test-ns.core (:require [clojure.string :as string]))
      nil
      my-test-ns.core=> (def a string/blank?)
      #'my-test-ns.core/a
      my-test-ns.core=> (ns my-test-ns.core)
      nil
      my-test-ns.core=> (def a string/blank?)
      #'my-test-ns.core/a
      my-test-ns.core=>
      

      ClojureScript REPLs do not behave in the same way:

      ClojureScript:cljs.user> (ns my-test-ns.core (:require [clojure.string :as string]))
      true
      ClojureScript:my-test-ns.core> (def a string/blank?)
      #<function clojure$string$blank_QMARK_(s){
      return goog.string.isEmptySafe(s);
      }>
      ClojureScript:my-test-ns.core> (ns my-test-ns.core)
      nil
      ClojureScript:my-test-ns.core> (def a string/blank?)
      WARNING: No such namespace: string, could not locate string.cljs at line 1 <cljs repl>
      WARNING: Use of undeclared Var string/blank? at line 1 <cljs repl>
      repl:13
      throw e__3919__auto__;
            ^
      ReferenceError: string is not defined
          at repl:1:109
          at repl:9:3
          at repl:14:4
          at Object.exports.runInThisContext (vm.js:74:17)
          at Domain.<anonymous> ([stdin]:41:34)
          at Domain.run (domain.js:197:16)
          at Socket.<anonymous> ([stdin]:40:25)
          at Socket.emit (events.js:107:17)
          at readableAddChunk (_stream_readable.js:163:16)
          at Socket.Readable.push (_stream_readable.js:126:10)
      ClojureScript:my-test-ns.core> 
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cichli Michael Griffiths
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: