Skip to content
Prev 167672 / 398502 Next

tclarray with embedded spaces in data

Ruth M. Ripley wrote:
(Didn't anyone tell you to cook up a selfcontained example?)

This is a right-honourable pain with Tcl, and it took me quite some time 
to reconstruct what I did several years ago on this matter. The short 
answer is that you need to assign things like

as.tclObj("foo bar   baz", drop=TRUE)

into your array. The longer story involves the ambiguity in Tcl between 
lists of words separated by whitespace and strings with spaces inside. I 
suspect that the sciviews approach doesn't actually cover all cases, 
paste()'ing raw tcl commands together usually leaves you burning in 
Quoting Hell.