[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (*) -> 1
From: |
Óscar Fuentes |
Subject: |
Re: (*) -> 1 |
Date: |
Tue, 17 Jan 2023 23:01:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Óscar Fuentes <ofv@wanadoo.es> writes:
>
>> In other programming languages an expression such as "+ 2" would yield a
>> partially applied function:
>>
>> let f = + 2
>> f 5
>> -> 7
>
> The "dual" problem can also exist in this interpretation of notation,
> though:
>
> Would a partial application of `*' to no arguments result in a function
> multiplying the product of the arguments (with 1), or would it result in
> a function raising an error? What would this function applied to no
> arguments return?
The function either has all arguments satisfied (and then it is
computed) or not (and then it is a partially applied function). So `f'
in the previous example:
f
-> f
* 3
-> * 3
> What would the partial application of `-' to a number return when
> applied to no arguments? Etc.
I'm not sure I understand this question. Maybe this:
let f = - 5
f 3
-> 2
or
let f = - _ 3 ;; `_' stands for "absent argument"
f 5
-> 2
The languages that use the concept of partially applied function usually
have no support for variadic functions, so the duality problem you refer
to is not an issue.
- Re: (*) -> 1, (continued)
- Re: (*) -> 1, Jean Louis, 2023/01/17
- Re: (*) -> 1, Michael Heerdegen, 2023/01/17
- Re: (*) -> 1, Óscar Fuentes, 2023/01/17
- Re: (*) -> 1, Jean Louis, 2023/01/17
- Re: (*) -> 1, Óscar Fuentes, 2023/01/17
- Re: (*) -> 1, Jean Louis, 2023/01/18
- Re: (*) -> 1, Óscar Fuentes, 2023/01/18
- RE: [External] : Re: (*) -> 1, Drew Adams, 2023/01/18
- Re: (*) -> 1, Michael Heerdegen, 2023/01/17
- Re: (*) -> 1, Michael Heerdegen, 2023/01/17
- Re: (*) -> 1,
Óscar Fuentes <=
- Re: (*) -> 1, Michael Heerdegen, 2023/01/17
- Re: (*) -> 1, Óscar Fuentes, 2023/01/18
- Re: (*) -> 1, tomas, 2023/01/18
- Re: (*) -> 1, Óscar Fuentes, 2023/01/18
- Re: (*) -> 1, Michael Heerdegen, 2023/01/18
- Re: (*) -> 1, Óscar Fuentes, 2023/01/18
- Re: (*) -> 1, Andreas Eder, 2023/01/18
- Re: (*) -> 1, Óscar Fuentes, 2023/01/18
- Re: (*) -> 1, Jean Louis, 2023/01/17
- Re: [External] : Re: How to make M-x TAB not work on (interactive) declaration?, Emanuel Berg, 2023/01/17