Generate command to be evaluated later



I want to create a function which will gets to numbers and a variable name and return a command which evaluates which one of them is bigger and set that value to a new variable.
Lets call that function _max
So if I call:
_max(2,3,a)
It should return the following string:
"set a [max 2 3]"

I can do it using really ugly tricks with string map, but I prefer not to if I can avoid it.

This is really simple example so please no specific solutions for this example, since my actual problem is more complicated than this :<

Thanks.
.



Relevant Pages

  • Re: [PATCH] x86_64, i386: Add command line length to boot protocol
    ... It's unlikely that someone is going to have a command line ... bigger than 0xffff. ... I could imagine overflowing that. ... Describing your numa setup, ...
    (Linux-Kernel)
  • Re: executing a script file from a script file
    ... as my code is getting bigger I'd like to partition it to make it better ... What I'd like to do is to outsource parts of it in seperate ... Just like an equivalent to the "\input" command in Latex. ...
    (comp.soft-sys.matlab)
  • Re: [opensuse] Should I go 64-bit?
    ... libraries in /lib abd /lib64, I wouldn't say the sizes are ... Use the "size" command, not the file size. ... Yes, they are bigger, taking up more space on disc and more memory, ...
    (SuSE)
  • Re: Removing a char from an EXPECT log file
    ... "tr" command to translate from one to another once the file has been ... I don't have a string map command in my expect book so I'll assume this is ... "^H" "\177" to change to either a backspace or delete. ...
    (comp.lang.tcl)
  • Save as single file webpage
    ... I have a list of hyperlinked files, which, when saved as a signle file ... webpage, the user can right click and save. ... The list will become bigger and bigger as work goes on. ... I'e added a save command button to the page and recorded the following macro ...
    (microsoft.public.excel.programming)