Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Semper Fi, dude.


devel / comp.lang.misc / Re: Functional programming is not always what it seems

SubjectAuthor
o Functional programming is not always what it seemsJames Harris

1
Re: Functional programming is not always what it seems

<ula3vu$3n876$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10004&group=comp.lang.misc#10004

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: james.ha...@gmail.com (James Harris)
Newsgroups: comp.lang.misc
Subject: Re: Functional programming is not always what it seems
Date: Tue, 12 Dec 2023 17:07:10 +0000
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <ula3vu$3n876$3@dont-email.me>
References: <tkvvpo$229ec$1@dont-email.me> <tl0hfe$23pf9$1@dont-email.me>
<tl2jut$1emj$1@gioia.aioe.org> <tl7u7h$2uf08$1@dont-email.me>
<tl80g1$1i4g$1@gioia.aioe.org> <tlg55k$3qt0v$1@dont-email.me>
<tlg7pk$1qo1$1@gioia.aioe.org> <tlgl63$3s88m$3@dont-email.me>
<tlgqc1$uo2$1@gioia.aioe.org> <tlil9m$3rr4$1@dont-email.me>
<tlipjr$13po$1@gioia.aioe.org> <tlj9qb$1v2i$1@gioia.aioe.org>
<tmhvs3$3lrh0$1@dont-email.me> <tmig7f$50s$1@gioia.aioe.org>
<tmijm0$3nbl5$1@dont-email.me> <tmimt5$19bj$1@gioia.aioe.org>
<tmiv3l$3o6t7$2@dont-email.me> <tmjagl$1lqc$1@gioia.aioe.org>
<tmls23$1juj$5@dont-email.me> <tmm25o$7dg$1@gioia.aioe.org>
<tmqfpc$jij3$3@dont-email.me> <tmqgek$uhe$1@gioia.aioe.org>
<tn55t5$201im$1@dont-email.me> <tn6vk2$1mv6$1@gioia.aioe.org>
<tn7go1$28fin$1@dont-email.me> <tn8a22$2ac1b$7@dont-email.me>
<tna0sr$2hc33$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Dec 2023 17:07:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e25f27a5e3c98805fc6686c7061945c2";
logging-data="3907814"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ASXHD7FWgw88BqSHTzw7tuo+4Rh2ZSOQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:IeU5QUDVGe1jeBp+MXMtegvzPFs=
Content-Language: en-GB
In-Reply-To: <tna0sr$2hc33$1@dont-email.me>
 by: James Harris - Tue, 12 Dec 2023 17:07 UTC

On 13/12/2022 14:06, David Brown wrote:
> On 12/12/2022 23:30, James Harris wrote:
>> On 12/12/2022 15:18, David Brown wrote:
>>> On 12/12/2022 11:26, Bart wrote:
>>>
>>>> And as David said, cube roots aren't that common. It might have a
>>>> button for it on my Casio, that might be because it's oriented
>>>> towards solving school maths problems.
>>>>
>>>
>>> I think rather than having a cube root function, perhaps an nth root
>>> function would make some sense.  Then you could write "root(x, 3)" -
>>> that's about as neat and potentially as accurate as any other solution.
>>
>> I like that! I'd have to work through issues including integers vs
>> floats but it would appear to be simple, clear, and general. I may do
>> something similar, perhaps with the root first to permit results to be
>> tuples.
>>
>>    root(3, ....)  ;cube root
>>
>> so that
>>
>>    root(3, 8) -> 2
>>    root(3, 8, 1000) -> (2, 10)
>>
>
> This last one is :
>
>     root(n, a, b) -> (a ^ 1/n, b ^ 1/n)
>
> ?

Yes, although not restricted to one or two values.

>
> Is that a general feature you have - allowing functions to take extra
> arguments and returning tuples?  If so, what is the point?  (I don't
> mean I think it is pointless, I mean I'd like to know what you think is
> the use-case!)

No, it was not meant to be any kind of proposal at this stage (or of a
functional approach such as you mentioned in text now snipped), only a
principle of including fixed parameters before any that may potentially
be repeated.

--
James Harris


devel / comp.lang.misc / Re: Functional programming is not always what it seems

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor