[882] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: code

daemon@ATHENA.MIT.EDU (Mon Jan 8 12:15:39 1996 )

Date: Mon, 8 Jan 1996 09:48:39 +0000 ()
From: Brandon Gillespie <brandon@tombstone.sunrem.com>
To: Mike Zaphod Wilson <mwilson@vt.edu>
cc: coldstuff@tombstone.sunrem.com
In-Reply-To: <199601080452.XAA29283@sable.cc.vt.edu>

> >arg l , [dummy];
> >var x,y,temp;
> >
> >if (type(l) != 'list){
> >   throw (~type, "Must be list of strings");}
> >for x in (substitutions)
> >    if (.find_method(x[2]))
> >        for y in [1 .. l.length()]  {
> >             temp = tosym(x[2]);
> >             temp =  (| .(temp)() |);
> >             l[y] = $string.replace(l[y],x[1],temp) ;
----------------^^^^
> >}
> >return l;

To keep code readable, ColdC does _not_ allow assignments to subranges, 
so that line would have to read:

                l = l.replace(y, l[y].replace(x[1], temp));

(of course, this may not be any more readable, ;)

-Brandon