1. [SOLVED] inversion

Is there a standard routine that will convert {1,2,3,4} to {{1},{2},{3},{4}}?

Stupid me, I just needed an extra level of nesting:

?columnize({{1,2,3,4}}) 

Thanks tom, it is just for init on a silly little rosettacode task.

new topic     » topic index » view message » categorize

2. Re: inversion

no standard function that I know of

sequence s = { 1, 2, 3, 4 } 
 
sequence x = {} 
for i = 1  to length(s)  do 
    x = append(x, { s[ i ]} ) 
end for 
 
? x 
 
--{ 
--  {1}, 
--  {2}, 
--  {3}, 
--  {4} 
--} 

what is the value of this routine?

_tom

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu