William James
1/15/2016 9:20:00 AM
WJ wrote:
> Kent M. Pitman wrote:
>
> > Mostly for your case, you'll find that
> > (loop for index from 0
> > for n in seq ; assumes seq is a list
> > for primary = (if (numberp n) (sqrt n))
> > when primary
> > return (values index primary))
> > will suffice to do the simple thing in the rare case it's needed, so it's
>
> Gauche Scheme:
>
> (any
> (^(x i) (and (number? x) (values i (sqrt x))))
> '(a b c 8 9)
> (lrange 0))
>
> ===>
> 3
> 2.8284271247461903
MatzLisp (Ruby):
n,i = [:a,:b,:c,8,9].each_with_index.find{|x,i| x.is_a? Numeric}
n and [i, Math.sqrt(n)]
===>
[3, 2.8284271247461903]
--
Elie [Wiesel] thus could have remained at Birkenau to await the Russians.
Although his father had permission to stay with him as a hospital patient or
orderly, father and son talked it over and decided to move out with the
Germans. --- Robert Faurisson