Hi Alex, Thanks for the picolisp pointers :-) The sub? shrinks down one of the awkward bits there. Unfortunately, I didn't see sub? in miniPicoLisp. The replace seems like a better idea than using the surgical patch there - probably not a good idea to modify a list passed in as an argument like I am doing with patch.
Cheers, Doug --- On Sun, 7/24/11, Alexander Burger <[email protected]> wrote: > From: Alexander Burger <[email protected]> > Subject: Re: pilog dcg with args > To: [email protected] > Date: Sunday, July 24, 2011, 2:36 AM > Hi Doug, > > > http://victoriafamilyrobotics.net/vfr1/media/read_line.l > > Please allow me to post some minor hints: > > > When a single character is checked for a number of values > like in > > (or (= X ",") (= X ".") (= X "?")) > > then I would write instead: > > (sub? X ",.?") > > > For the modification of a list > > (patch L "," '(" " ",")) > (patch L "." '(" " ".")) > (patch L "?" '(" " "?")) > > I would use > > (replace L "," '(" " ",") "." > '(" " ".") "?" '(" " "?")) > > Note, however, that 'replace' is non-destructive, so you > need to use the > returned value in the following expression (or 'setq' it to > 'L'). > > Cheers, > - Alex > -- > UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe > -- UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
