[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] A few small performance and scrutiny warni
From: |
John Cowan |
Subject: |
Re: [Chicken-hackers] [PATCH] A few small performance and scrutiny warning improvements to assignments |
Date: |
Sun, 24 Jul 2016 11:52:16 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Peter Bex scripsit:
> It seems silly to ask the length of a vector that's statically known.
Not at all. If your program needs a vector of constants, thus:
(define pi-digits #(3 1 4 1 5 9)
then you might want to future-proof the rest of your program against
extending this constant by writing (vector-length pi-digits) rather than
the magic number 6. This more usually comes up with strings rather than
vectors, but the principle is the same.
--
John Cowan http://www.ccil.org/~cowan address@hidden
If I have not seen as far as others, it is because giants were standing
on my shoulders. --Hal Abelson