I want to write prolog that can do what this is doing:
atomic_list_concat([X,'(', Y,')'],Z).
where, in my code X is an atom localization, Y is what user answer after a read, so it's what he input (for example blabla).
The Z would be: localization(blabla)
The result of atomic_list_concat is 'localization(blabla)'
.
I would like the answer to have no quotation marks in it.
Please, help me
To create a compound term, you shoud use
Z =.. [X, Y]
instead of
atomic_list_concat([X, '(', Y, ')'], Z)
For example:
?- X = localization, Y= blabla, Z =.. [X, Y].
X = localization,
Y = blabla,
Z = localization(blabla).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.