1. Re: listed subscripting
- Posted by "codepilot Gmail Account" <codepilot at gmail.com> Apr 23, 2006
- 481 views
Also subscripted functions would be cool such as variable=function[2]() --same as temp=function() variable=temp[2] delete(temp) variable=function[2,5,6,10]() --same as temp=function() variable={temp[2],temp[5],temp[6],temp[10]} delete(temp) effectivly throws away anything but the subscript(s) wanted, and you could use it for inline swizzling and reordering. Just plain cool, I could have used this a million times if it were there On 4/22/06, codepilot Gmail Account <codepilot at gmail.com> wrote: > variable={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"} > puts(1,variable[8,12,16,20]) > --is the same as > puts(1,{variable[8],variable[12],variable[16],variable[20]}) > > just an idea, real easy to implement I think > even allow > > ? variable[8,12,16,20..26] or more complex subscriptings > --same as > ? {variable[8],variable[12],variable[16],variable[20..26]} > > use if for swizzled assigns as well, man I would really love this > > variable[1,5,9,13]={1,2,3,4} > --same as > variable[1]=1 > variable[5]=2 > variable[9]=3 > variable[13]=4 > > much cleaner code, I like it >