Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Need "replace all" semantics in lumo.repl/root-resource #49

Closed
@mfikes

Description

In the ClojureScript implementation of the root-resource, the (Clojure/Java) implementation of .replace has "all" semantics. For example:

user=> (.replace "ABCB" "B" "Z")
"AZCZ"

This becomes important in the event that namespaces has multiple dashes or dots in their name. For example:

cljs.user=> (lumo.repl/root-resource 'foo-bar-baz.boo.core)
"/foo_bar-baz/boo.core"

In the Planck copy of this code, I adjusted this slightly https://github.com/mfikes/planck/blob/d9613862bd9b54d436e439f8eb5dd94848c08ae3/planck-cljs/src/planck/repl.cljs#L1311-L1312

resulting in the needed behavior (which is what ClojureScript is doing for this case as well):

cljs.user=> (planck.repl/root-resource 'foo-bar-baz.boo.core)
"/foo_bar_baz/boo/core"

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions