Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't Evaluate Tags #23

Open
motosota opened this issue Oct 11, 2015 · 1 comment
Open

Don't Evaluate Tags #23

motosota opened this issue Oct 11, 2015 · 1 comment

Comments

@motosota
Copy link

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?

@josh-stevens
Copy link

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?

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

No branches or pull requests

2 participants