William James
7/28/2015 6:28:00 AM
Paul Rubin wrote:
> > Scheme
> > (define vector-fill!
> > (lambda (v x)
> > (let ((n (vector-length v)))
> > (do ((i 0 (+ i 1)))
> > ((= i n))
> > (vector-set! v i x)))))
>
> I think you could write the scheme code like this:
>
> (define vector-fill! (v x)
> (let ((i 0))
> (while (< i (length v))
> (vector-set! v i x)
> (set! i (1+ i)))))
Gauche Scheme:
(let1 v #(0 0 0 0)
(vector-fill! v 88)
v)
===>
#(88 88 88 88)
Another way:
(let1 v #(0 0 0 0)
(vector-map! (^x 88) v)
v)
--
The struggle of our time is to concentrate, not to dissipate: to renew our
association with traditional wisdom: to re-establish a vital connection between
the individual and the race. It is, in a word, a struggle against Liberalism.
--- T. S. Elliot