jsedn icon indicating copy to clipboard operation
jsedn copied to clipboard

Don't Evaluate Tags

Open motosota opened this issue 9 years ago • 1 comments

This:

jsedn.encode(jsedn.unify('{:uuid #uuid ?a}',{a: "ac24e310-703e-11e5-92c2-d57ad6a6c940"}))

results in

"{:uuid "ac24e310-703e-11e5-92c2-d57ad6a6c940"}"

but I'm trying to get back

"{:uuid #uuid "ac24e310-703e-11e5-92c2-d57ad6a6c940"}"

So how should I go about keeping the tag in the output?

motosota avatar Oct 11 '15 17:10 motosota

Was there no solution found to this problem? I found some strange behavior....

If I have something like this - "#{#uuid "000-000-000" #uuid "123-456-879"}"

And I parse and then re-encode, it gives ""#{"000-000-000" "123-456-879"}"

It's failing on the parse, it generates a set with two strings, rather than a set with two Tagged elements. So the encode is doing what it's supposed to, but the parse is not.

What's really weird is that if I do something like this to the string (replacing '#uuid' with '#uuidN') var counter = 0; stringToParse = stringToParse.replace(/#uuid/g, function(match) { counter++; return match + counter; });

And now I parse, the object comes out with two tagged elements in the set! And re-encoding gives

"#{#uuid1 "000-000-000" #uuid2 "123-456-879"}"

Why is it failing when the tags are the same, but succeeding when the tags are unique?

josh-stevens avatar Aug 30 '16 16:08 josh-stevens