MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: Interesting code...



Kipp the Kidd drew these hieroglyphs:
> 
> > lst = args[1];
> > lst[1] = "";	/* get rid of leading percent-sign */
> > lst = $string_utils:strip_chars(lst," ");
> > lst = strsub(lst, ",", "\",\"");
> > return $no_one:eval_d(lst);
> 
> I forgot to tell you that the code is not in a LambdaCore, and the words 
> in the list CAN contain spaces... :)  The the letters a-i could represent 
> anything except `%{', `,' and `}'  Which means they can contain quotes.
> 

fine, add this line:
lst = strsub(lst, "\"", "\\\""); /* escape embedded quotes */

This is assuming your quotes aren't already escaped.  If they are,
don't bother.

As for your core not being lambdacore, too bad.  There's only so much
I'll do to help, and re-inventing the wheel isn't part of it.


Follow-Ups: References:

Home | Subject Index | Thread Index