On Sat, Jul 30, 2011 at 08:23:11PM -0300, TC-Rucho wrote:
> If it's about checking single characters, why not just:
> 
>    (de sub? (Ch Str)
>       (member Ch (chop Str) )
> 
> so rewriting this:
> 
>    (or (= X ",") (= X ".") (= X "?"))
> 
> as
> 
>    (sub? X ",.?")
> 
> would work just fine.

Tight, this would work in the current situation.


However, I would not use this as a general implemenation of 'sub?' for
miniPicoLisp, as it is not equivalent to the other versions.

For the current problem, a simple inline replacement of

   (or (= X ",") (= X ".") (= X "?"))

with

   (member X '("," "." "?"))

would be the best.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to