passing a prolog string to tcl and unbalanced braces 
Author Message
 passing a prolog string to tcl and unbalanced braces


I want to pass a string from prolog to tcl and I use the command:

call_log(Term) :-
    ( nonvar(String),String\==[] ->
    ; true

log::write is a tcl procedure that just inserts the argument to a text

proc log_write { msg } {
    text .t
    .t insert 0 "$msg\n\n"
    pack .t


This work fine for all cases except the one with an unbalanced curly brace
in the String (the error message 'unbalanced braces "{" at pos 10' for
I know that I could choose to enclose the String into quotes, but this will
fail for all strings with a quote, dollar or [ brace.

Of cource the error that I get is something like:

missing close-braceException during Prolog execution:
missing close-brace
    while executing
    invoked from within
"::prolog {call_log(exec_macro('o806'))}"
    ("uplevel" body line 1)

any ideas on how to make it work.


Tue, 11 May 2004 01:33:14 GMT  
 [ 1 post ] 

 Relevant Pages 

1. unbalanced braces when passing a prolog string to tcl

2. Unbalanced braces in variable names

3. BUG: [incr tcl] and commented unbalanced curly brackets

4. Brackets in brackets, braces in braces

5. Passing string from Tcl to C

6. Brackets in brackets, braces in braces

7. Braces within a string

8. Help using [ as a string character not a Command Brace

9. syntax parser in tcl8.1 - wrong usage of braces in comments or strings

10. Matching strings that contain braces

11. how to access prolog from tcl?(not using tcl/tk interface from prolog)

12. TCL evaluation curly brace that is part of my variable value


Powered by phpBB® Forum Software