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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: this is United States calling (was: Re: [External] : Is there any di


From: Emanuel Berg
Subject: Re: this is United States calling (was: Re: [External] : Is there any difference between `equal' and `string=' for strings?)
Date: Sat, 21 Aug 2021 06:20:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Another thing with respect to functions and the formal
parameters are that in other languages, e.g. C++, one can do
function overloading where the function names are the same but
the sets of parameters differ, this amounts to two (or more)
functions with distinct "signatures".

I guess one cannot do that (easily) in Lisp since a function
is just a symbol with a set `symbol-function'.

The inferred function types of SML, expressed as mappings, were
sort of cool but the prototypes or signatures of C++ - is that
something they have because, frankly, C++ isn't good enough?

If so, interesting that it brought along the possibility of
overloading ...

Now in Lisp we have arbitrary number of arguments (&rest),
&optional arguments, default values (Common Lisp has, so
`cl-defun' for Elisp/Jean). Hm ... is the unused argument _
a convention, or is it actually impossible to use?

Anyway much better than overloading IMO.

Perhaps because of the dynamic type system it isn't needed?
One can just have one function, find out what types the
arguments are, and branch on that. Perhaps one can do that in
C++ as well in just one function, with pointers, or by
converting the int(eger) to a float ...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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