Skip to content
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 opened this issue Nov 27, 2016 · 1 comment
Closed

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

mfikes opened this issue Nov 27, 2016 · 1 comment

Comments

@mfikes
Copy link
Collaborator

mfikes commented Nov 27, 2016

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"
@anmonteiro
Copy link
Owner

fixed 0c469c2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants