On Wed, Jun 01, 2022 at 10:24:29PM +0200, Ralf Hemmecke wrote:
> >Yes. When request type is function type compiler calls
> >compWithMappingMode which is doing needed magic. In fact,
> >compWithMappingMode can handle old form of anonymous functions
> >with '#1', '#2', etc., but those are rejected by the parser.
> >
> >However, zero argument case still works and is used with 'delay'.
>
> If I am not wrong then it is also used for 0 and 1.
>
> MagmaWithUnit() : Category == Magma with
> --constants
> 1 : constant -> %
>
> I always get confused by that.
I do not think so: here we have normal heading used by all mappings.
> In Aldor that would simply be
>
> 1: %
>
> Aldor distinguishes between constants and nullary function of type ()->%. I
> think that makes sense, since a nullary function can stil have side effects
> whereas a constant cannot.
What can have side effect and what can not is a design decision
for a language. Of course, people associate meaning to names like
'constant' so it is better to follow natural expectations.
But there is wide spectum of things which can be called constants
and various fine aspect of associated semantics.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/20220602181120.GA29994%40fricas.math.uni.wroc.pl.