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

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

Re: Is there any difference between `equal' and `string=' for strings?


From: Emanuel Berg
Subject: Re: Is there any difference between `equal' and `string=' for strings?
Date: Sat, 21 Aug 2021 02:30:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> (type-of 'type-of)  ; not function, symbol, well, OK
> (type-of #'type-of) ; still not function, symbol

So functions don't have type, they are symbols with their
`symbol-function' set to some function? Hm, "they" are
symbols ...

Wasn't it SML who had a type inference system so even tho the
formal parameters didn't have explicit type (maybe that was
optional) it could infere the types, and the whole inferred
prototype would be the type of the function?

So for the equivalent of

  (defun add-two-terms (a b)
    (+ a b) )

the inferred type would be (not in SML's notation)

  f(R, R) -> R 

So what happens then, you could have a second function that
would take an argument that had that type, and then that
function would have the type

  f'(f(R, R) -> R , something else) -> ... etc

To have a static type check in Lisp, how would that work, the
functions would come with metadata or publish their interface
somewhere to show for which types they are defined?

Also I remember from SML, Haskell, and Erlang, was the focus
on pattern matching. More of a syntax thing, maybe? Should be
possible in Lisp as well, right?

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




reply via email to

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