johnlopez2000
Programmer
I am using TCL in a programming environment backended by an Oracle database and a middleware/PDM (engineering Product Data Mgmt) product called Matrix. TCL is the native script language in this environment.
TCL progs make calls to the underlying middleware piece via a command in this specific implementation, i.e.:
set x [mql SOME_QUERY]
The resultant can be formated within the MQL command to return lists. Sometimes the return values can be nested lists. In the event that the resultant is returned to TCL, then passed to 'lower' level procs, the nesting is increased per level on the stack.
From long ago in my LISP programming days, I remember certain functions that I could call to determine whether an element of a list was an 'atom' or a 'list' as one iterated through the content of one level of the list.
So, I wonder if there is some way in TCL to derive the same information, something like an isAtom() or isList() type functionality.
One of my lists may look like:
{a b c {d e} f {g} {h {i j}} k}
iterating through the above, I'd thought about using LLENGTH, but whether the element is:
a
or:
{g}
the return value is one.
So, if you know of a command or technique that will work to accomplish this, preferably usable in a conditional, I would appreciate the wisdom!
TCL progs make calls to the underlying middleware piece via a command in this specific implementation, i.e.:
set x [mql SOME_QUERY]
The resultant can be formated within the MQL command to return lists. Sometimes the return values can be nested lists. In the event that the resultant is returned to TCL, then passed to 'lower' level procs, the nesting is increased per level on the stack.
From long ago in my LISP programming days, I remember certain functions that I could call to determine whether an element of a list was an 'atom' or a 'list' as one iterated through the content of one level of the list.
So, I wonder if there is some way in TCL to derive the same information, something like an isAtom() or isList() type functionality.
One of my lists may look like:
{a b c {d e} f {g} {h {i j}} k}
iterating through the above, I'd thought about using LLENGTH, but whether the element is:
a
or:
{g}
the return value is one.
So, if you know of a command or technique that will work to accomplish this, preferably usable in a conditional, I would appreciate the wisdom!