Re: [stack] are concatenative languages applicative?

John Cowan <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
John Nowak scripsit:

> Maybe I'm not being precise enough. The type of the term '3' is 'A ->  
> A Num', just like the type of '1 2 3' is 'A -> A Num Num Num'.

That is, those are their types when they are seen as functions.  When
seen as values, their types are 'Num' and 'Num Num Num'.

> No we're not; we don't evaluate the right-hand side to figure out what  
> to bind 'foo' too.

Correct.  The declaration "foo == 3" means that as functions 'foo' and '3'
have the same function type, namely 'A -> A Int'.  (As values, they are
still different:  '3' has type Int, 'foo' has type Symbol.)

But where we differ, or did differ, is about '[1 2 3]', which I say has a
function type of 'A -> A [Num Num Num]', not 'A -> [A -> A Num Num Num]]'.
And that is because Joy lists are not inherently quotations, though they
are treated as quotations by certain functions.

-- 
Man has no body distinct from his soul,                 John Cowan
for that called body is a portion of the soul           [email protected]
discerned by the five senses,                           http://www.ccil.org
the chief inlets of the soul in this age.  --William Blake
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.