commands that don't expand their arguments 
Author Message
 commands that don't expand their arguments

Here's my problem.

I'm writing a piece of software with a command-driven syntax.  A typical
command might be

node_cap $1I17\$1I18\ABC[7] 9.6E-12

(the backslashes are really part of the argument - they're not being used
to escape anything).

Now, I'd like to use tcl as the main interpreter, for obvious flexibility
and not-reinventing-the-round-rolling-thing reasons.

However, if I passed that command to Tcl_Eval, the first argument would
be mangled by the interpreter, due to the backslashes, brackets, and
$'s.  The users will be chasing me out of town with pitchforks and
torches if I tell them to put braces around the first argument.

In lisp, you can specify that a function doesn't evaluate one or more of
its parameters (for example, setq is just a version of set that doesn't
evaluate ["quotes"] its first argument).  Does anyone have any suggestions
for doing the same or similar in tcl?

Hacking on the main input loop in my C program is acceptable.  Hacking
on Tcl_Eval (in the library) is not.  I'd like "source" to work with the
new command type, but I could live without it.

Send mail if possible, I will summarize responses.


P.S. I'm not using tk now, but I may want to integrate it in the future.

Tue, 11 Nov 1997 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. SUMMARY: commands that don't expand their arguments

2. Using the binary command, but I don't understand one of the modifiers

3. tear off menus don't work, tk_dialog command is not recognized--THE SOLUTION

4. Object::send with expanded argument list?

5. Expand tuple into argument list?

6. TIP #157: Argument Expansion with Leading {expand}

7. command environments and command line arguments

8. Fortran command to read command line argument?

9. Dolphin Applet's don't work...

10. match works, don't match doesn't




Powered by phpBB® Forum Software