Naren
Naren

Reputation: 148

how to convert a symbol into a string and vice versa in CLIPS

how to convert a symbol into a string and vice versa in CLIPS, I tried looking into the documentation but did not help.

Also are there any functions to convert strings to integers?

Are the set of functions to convert between data types in CLIPS?

Upvotes: 1

Views: 2054

Answers (1)

Gary Riley
Gary Riley

Reputation: 10757

CLIPS> (str-cat red)
"red"
CLIPS> (sym-cat "red")
red
CLIPS> (str-cat 17)
"17"
CLIPS> (string-to-field "17")
17
CLIPS> (integer 17.3)
17
CLIPS> (float 17)
17.0
CLIPS> (round 17.3)
17
CLIPS> (explode$ "a b c")
(a b c)
CLIPS> (implode$ (create$ a b c))
"a b c"
CLIPS> 

Upvotes: 7

Related Questions