[Cuis-dev] On ArrayedCollection >> incrementFraction
Juan Vuletich
juan at cuis.st
Mon May 11 12:12:22 PDT 2026
Hi Ezequiel,
(inline)
On 2026-05-03 1:48 AM, Ezequiel Birman via Cuis-dev wrote:
> 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.
This makes a lot of sense. I've just added your method with selector
#successiveRatios and your author initials. Thanks!
>
> Neither `derivative` nor `incrementFraction` nor `Integral` have
> senders. Juan, maybe you remember why or under which circumstances you
> added them in 2024?
I'd guess they are older than that. They are there because they are
ilustrative and could be of use. It is nice to have this kind of stuff
in the image. I believe it shows general Smalltalk-fu.
> Are there any efforts / packages for numeric or data analysis?
Not specifically for that, but a good place for it would be
https://github.com/Cuis-Smalltalk/Numerics
Cheers,
>
> --
> Eze
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260511/7d5ffe18/attachment.htm>
More information about the Cuis-dev
mailing list