Re: dealing with bad input ']' when reading and printing lines in a

2017-01-24 Thread dean
Hi Alex
Thank you for your example and further guidance. I'll look into all of
those suggestions.
Best Regards
Dean

On 24 January 2017 at 17:02, Alexander Burger  wrote:

> Hi Dean,
>
> > I was reading each line in an input file text file, trimming it and
> seeing
> > if it was a member of a list that I'd created. If it was I was recording
> > the list type and the number of the line in the file.
>
> OK, good. So 'str' is not useful here. 'str' tries to parse a Lisp
> expression
> from the string, possibly giving errors if it is not legal Lisp syntax.
>
> Better to operate directly on (sub)strings perhaps, e.g. with
>
>(in Pth
>   (until (eof)
>  (let? Lst (mapcar pack (split (line) " "))
> ... operate on list of strings ...
>
>
> > Some of the files split their strings (that match the list elements) over
> > multiple lines making things a bit more involved than (if (member Ln
> List)
>
> I see. Then it is perhaps better not to use 'line', but 'from' / 'till', or
> perhaps even a lower level with 'char'.
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: dealing with bad input ']' when reading and printing lines in a

2017-01-24 Thread dean
Hi Alex
> What do you want to do?
I was reading each line in an input file text file, trimming it and seeing
if it was a member of a list that I'd created. If it was I was recording
the list type and the number of the line in the file.

Some of the files split their strings (that match the list elements) over
multiple lines making things a bit more involved than (if (member Ln List)
now but I'm not sure that's significant to this problem.

Thank you for asking and best regards
Dean






On 24 January 2017 at 12:14, Alexander Burger  wrote:

> Hi Dean,
>
> > (de main (Pth)
> >(in Pth (until (eof)
> >   (setq Rec (str (line T)))
> > ...
> > The above is giving me Bad input ']'
> > I wrongly thought str would cope with this
>
> I believe that 'str' is most probably not what you need. It is a rather
> specialized parser, and normally not used.
>
> What do you want to do?
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: dealing with bad input ']' when reading and printing lines in a

2017-01-24 Thread Alexander Burger
Hi Dean,

> (de main (Pth)
>(in Pth (until (eof)
>   (setq Rec (str (line T)))
> ...
> The above is giving me Bad input ']'
> I wrongly thought str would cope with this

I believe that 'str' is most probably not what you need. It is a rather
specialized parser, and normally not used.

What do you want to do?

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


dealing with bad input ']' when reading and printing lines in a text file

2017-01-24 Thread dean
(de main (Pth)
   (in Pth (until (eof)
  (setq Rec (str (line T)))
  (prinl Rec)


The above is giving me Bad input ']'
I wrongly thought str would cope with this
Any hep much appreciated