<pablo_escoberg>
Is there an easy way of telling if a transient symbol consists entirely of numbers? I've tried a few things, but before resorting to `chop` etc, I thought I'd ask.
<abu[7]>
The best way is 'format"
<abu[7]>
(format "123")
<pablo_escoberg>
awesome, I'll look into it. Thanks!
chexum_ has quit [Read error: Connection reset by peer]
chexum has joined #picolisp
<fbytez>
pablo_escoberg, How about something like: `(fully '((C) (and (>= C "0") (<= C "9"))) (chop "12345"))`
<fbytez>
`format` permits leading sign and embedded "."
<abu[7]>
True
<abu[7]>
Then (fully format (chop Str))
<abu[7]>
Or, a bit simpler (fully '((C) (>= "9" C "0")) (chop ...
<abu[7]>
Calling a Lisp function is a lot slower than a built-in like 'format' though
<fbytez>
I like this from abu[7]: `(>= "9" C "0")`
<fbytez>
abu[7], What are your thoughts about why `fully` returns `T` when scanning an empty list / NIL?
<abu[7]>
yes, 'fully' is optimal
<abu[7]>
Would you return something diffent?
<fbytez>
Without any deep thought, I would've expected NIL because nothing has been matched.
<abu[7]>
yeah, it is just for the meaning of the English word "fully"
<fbytez>
Like, to me, it reads as "all elements of the list are ASCII digits", which doesn't really make sense if there were no digits due the list being empty.
<abu[7]>
I
<abu[7]>
understand
<fbytez>
Do you know anything of "newlisp"? I came across it today. I know almost nothing about it's implementation, but it seemed to me to be very close to pil.
<abu[7]>
The fully thing is also for the double negation of 'find'