help-gnu-emacs
[Top][All Lists]
Advanced

[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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]