Closed igorcadelima closed 7 years ago
Hi Igor, yep we are aware :-)
createAtom does not parse the string, just creates an atom with that content … and it was useful in some particular cases.
variables can even be bind to java objects! (as is the case of ArtifactIDs).
Thanks,
Jomi
On 25 de ago de 2017, at 04:24, Igor C. A. de Lima notifications@github.com wrote:
Hi,
I've noticed that I can't have something like +uuid(ff3897bf-efd9-411d-b897-4aa882676e9e) or .term2string(U,"ff3897bf-efd9-411d-b897-4aa882676e9e") as they raise errors. Pretty consistent so far.
However, ASSyntax.createLiteral("uuid", ASSyntax.createAtom("ff3897bf-efd9-411d-b897-4aa882676e9e")) works fine. I can also turn this into an observable property and agents would perceive uuid(ff3897bf-efd9-411d-b897-4aa882676e9e). With this in the BB, agents could then do the following without any problem:
?uuid(U); +uuid_copy(U); .term2string(U,S);
Are you aware of this behaviour?
Cheers, Igor.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
-- Jomi Fred Hubner Department of Automation and Systems Engineering Federal University of Santa Catarina PO Box 476, Florianópolis, SC 88040-900 Brazil http://jomi.das.ufsc.br -- be good. be kind. be happy. (Conrad Anker)
Hi, Jomi!
As this is indeed an expected behaviour, would your suggestion be that I should treat the uuid from the example above always as a string to avoid problems and maintain consistency at application level?
Cheers, Igor.
Yes, it could be. However, I guess you will never need to write an uuid in an .asl file. So to handle it by variables unified with atoms can also work.
Thanks, Jomi!
Hi Igor, I've committed a change in the Jason parser to allow atoms enclosed by ' (as in Prolog). You can now write an atom like 'ff3897bf-efd9-411d-b897-4aa882676e9e' in a .asl file and it is equal to ASSyntax.createAtom("ff3897bf-efd9-411d-b897-4aa882676e9e").
Hi,
I've noticed that I can't have something like
+uuid(ff3897bf-efd9-411d-b897-4aa882676e9e)
or.term2string(U,"ff3897bf-efd9-411d-b897-4aa882676e9e")
as they raise errors. Pretty consistent so far.However,
ASSyntax.createLiteral("uuid", ASSyntax.createAtom("ff3897bf-efd9-411d-b897-4aa882676e9e"))
works fine. I can also turn this into an observable property and agents would perceiveuuid(ff3897bf-efd9-411d-b897-4aa882676e9e)
. With this in the BB, agents could then do the following without any problem:Are you aware of this behaviour?
Cheers, Igor.