Hi, Welcome back!

Did you try (any "9")?
It will parse & return number from symbol
Try (help 'any T)
-------- Original Message --------
On 4 Dec 2018 11:28 am, Mark Probert wrote:

> Hi, all.
>
> I've been away from picolisp for a while and it is great to be back.
> Rusty though. Here is a problem where I suspect I'm missing something
> obvious. The problem is I want to get a number from the commandline so
> that I can iterate that many times, but when I parse the opts I am
> ending up with a sym, not a num, and I can't seem to find a way of
> getting from sym -> num.
>
> I suspect I'm missing something obvious.
>
> Many thanks in advance
> Here's an example:
>
> ---< code >---
>
> 8:56 (locke)$ ./args.l -n 3
> [18.11.27](tel:181127) C
> sym? -->
> num? --> 1
> setting *N
> sym? --> T
> num? -->
> *N=3? val=3 NOPE
>
> 8:56 (locke)$ cat args.l
> #! /usr/bin/env pil
> (version)
> (setq *N 1)
>
> (de chk ()
> (prinl " sym? --> " (sym? *N))
> (prinl " num? --> " (num? *N)) )
>
> (de n ()
> (prinl "setting *N")
> (setq *N (opt))
> (chk) )
>
> (chk)
> (load T)
> (prin "*N=3? val=" *N " ")
> (if (= *N 3) (prinl 'OK) (prinl 'NOPE))
> (bye)
> ---< code >---
>
> --
> UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe

Reply via email to