[Cuis-dev] On ArrayedCollection >> incrementFraction

Ezequiel Birman ebirman77 at gmail.com
Sat May 2 21:48:30 PDT 2026


Hi!,

I want to collect the successive ratios in a collection of numbers in order
to appreciate how “fast” they grow. I noticed that the image already
implements ArrayedCollection >> incrementFraction, which is almost equal to
ArrayedCollection >> derivative:

incrementFraction
> "
> #(10 12.5 15 20) incrementFraction
> "
> | displaced answer |
> displaced := self class new: self size.
> displaced replaceFrom: 2 to: self size with: self startingAt: 1.
> displaced at: 1 put: self first.
> answer := self copy.
> answer -= displaced.

^answer / displaced


derivative
> | displaced answer |
> displaced := self class new: self size.
> displaced replaceFrom: 2 to: self size with: self startingAt: 1.
> displaced at: 1 put: self first - self first. "Some reasonable zero"
> answer := self copy.
> answer -= displaced.
> ^answer


I think I want something similar, except for the subtraction:

> myThing
>
> | displaced answer |
> displaced := self class new: self size.
> displaced replaceFrom: 2 to: self size with: self startingAt: 1.
> displaced at: 1 put: self first.
> answer := self copy.

^answer / displaced


I'll probably need both, since I'm doing exploratory analysis. And while
`myThing`, (which could be named `successiveRatios` or something along
those lines) can answer if there is a constant or varying growth,
`incrementFraction` measures the rate at which the growth itself is scaling.

Neither `derivative` nor `incrementFraction` nor `Integral` have senders.
Juan, maybe you remember why or under which circumstances you added them in
2024? Are there any efforts / packages for numeric or data analysis?

-- 
Eze
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260503/f9a400af/attachment.htm>


More information about the Cuis-dev mailing list