next up previous contents index
Next: Differences to Prolog Up: Syntax Previous: Compound terms   Contents   Index

String interpolation

single-quoted strings are never interpolated. Double quoted strings are partially interpolated: variables are substituted with their values (must be bound); prefix functions are evaluated, infix functions are not evaluated unless their are enclosed in brackets. Backquoted strings (which by default executes the results on the shell) are treated like double quoted strings.

'hello X' => 'X'
"hello X" => ERROR: unbound variable
"hello X" where {X=fred} => 'hello fred'
"hello 'X'" => 'hello X'
"1+2"  => '1+2'
"1+X" where (X=2}  => '1+2'
"(1+2)"  => 3
"-1"  => '-1'
"(-1)"  => -1



chris mungall 2006-02-09