Re: Following up on SRFI 179
Bradley Lucier 28 Sep 2021 20:19 UTC
On 9/28/21 3:36 AM, Alex Shinn wrote:
> On Sun, Sep 26, 2021 at 1:43 AM Bradley Lucier <xxxxxx@math.purdue.edu> wrote:
>>
>> On 9/25/21 9:23 AM, Alex Shinn wrote:
>>>> 3) (array-append k a1 a2 ...)
>>>>
>>>> 4) (array-laminate k a1 a2 ...)
>>> Both of these are provided by (chibi math linalg):
>>> https://github.com/ashinn/alschemist/blob/master/chibi/math/linalg.scm
>>> For consistency with numpy, laminate is called stack, and the axis
>>> refers to the result dimension so has the more natural domain [0,
>>> res-dim).
>>> They are fairly general and I agree should be in the base library
>>> rather than a linear algebra library.
>>
>> How about this for names and signatures? Square brackets denote
>> optional arguments:
>>
>> (define (array-stack [storage-class
>> [safe? (specialized-array-default-safe?)
>> [mutable? (specialized-array-default-mutable?)]]]
>> k array . arrays)
>> )
>> (define (array-append [storage-class
>> [safe? (specialized-array-default-safe?)
>> [mutable? (specialized-array-default-mutable?)]]]
>> k array . arrays)
>> )
>>
>> So if you want to specify mutable? you need to specify both
>> storage-class and safe?.
>
> Do we need to allow overriding the parameters directly here?
> The caller can always use parameterize.
I'll remove the optional arguments for safe? and mutable?. I don't
usually use parameters in my own code, I don't think of them.
array-copy and array-list have optional safe? and mutable? arguments
that take the current parameter values of the arguments aren't given. I
don't see a need to remove these optional arguments and just rely on
parametrize.
Brad