Hi Dexen,

> https://github.com/dexen/pillbox/raw/995dcc6c0d1e17b9ea6d7ec870ca05dea2724b3f/read

Without actually having tested it, here some ideas:

> (while (= "-" (car (chop (car (argv)))))
>    (case (car (argv))
>       ("-m"
>          (opt)
>          (off BailAt) )
>       ("-n"
>          (opt)
>          (setq BailAt (format (opt))) ) ) )

This could be replaced with the "command line function call" mechanism
of PicoLisp:

   (de m ()
      (off BailAt) )

   (de n ()
      (setq BailAt (format (opt))) )

This allows

   $ command -m

or

   $ command -n 10

but not

   $ command -n10


Concerning the main loop

> (in (opt)
>    (let LineNo 0
>       (until (or
>          (= LineNo BailAt)
>          (eof) )
>             (inc 'LineNo)
>             (prinl (line T)) ) ) )

Wouldn't just

   (in (opt)
      (do (or BailAt T)
         (T (eof))
         (prinl (line T)) ) )

do?

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

Reply via email to