Re: [stack] Re: Some thoughts on Object Cat
"Christopher Diggins" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
Hi Manfrred,
> > I solved the "dup apply" (or "dup i", god I hate using "i" to mean
> > application) problem by reintroducing "self" types.
>
> In Joy at least, the i combinator does not mean application. Joy is a
> concatenative language, not an applicative language.
>
> The applicative
> languages are the lambda calculus and the combinatory calculus,
> together with their descendents just about all programming languages
> descend from the lambda calculus. All applicative languages have an
> apply operation: apply this function to those arguments, but mostly there
> is no explicit symbol for that operation. Joy does not have such an
> operation neither explicit nor implicit.
Joy does not have an "implicit" apply operation, but "i" most
definitely is the explicit "apply" operation, if we are to consider
expressions as functions from stacks to stacks. This is because "i"
takes a stack-to-stack function off of the stack and applies it to the
rest of the stack.
> The i combinator in Joy is pretty much the same as the eval function in
> Lisp. It undoes what the the (pseudo-) function quote does.
That's not quote correct. (eval (quote (1 2 3))) is meaningless in Lisp
Anyway, this is where the confusion slips in, you are using the model
of quotes are expressions, and then quotes are functions. Depending on
what model you want to use to explain the semantics of Joy, it makes a
big difference. If you continued throughout with the understanding
that a quote is a function I think it would be quite clear, that
"dequoting" is really applying the function to the stack.
> In Lisp this
> is true about expressions X (which denote objects):
>
> > (eval(quote(X)) = X
>
> And in Joy this is true about expressions X (which denote
> stack-to-stack functions)
>
> > [X] i = X
>
> so the i combinator undoes what the quotation brackets do.
Another way of understanding what is happening is that you are
applying the stack-to-stack transform function to the stack.
> Lisp¹s eval
> and Joy¹s i are sometimes called dequotation operators.
This is the jargon of the Lisp programmer though, and is not
represenative of the actual mathematics being performed. Using the
term "dequotation" is distracting, because it implies something that
is happening differently than function application. My point is that
you can't say "X is a function from a stack to stack", but then say we
"eval it". This is because "eval" has no well-defined sense in
mathematics when it comes to functions.
> But they are
> quite different from application. (Many books on Lisp have an example
> program which is a Lisp interpreter written in Lisp. The two principal
> parts are eval and apply ‹ and they are very different.)
>
> All other Joy combinators are variations on the eval-theme. Some
> enterprising Lisp programmer might write variations on the eval-theme
> in Lisp at least for those combinators that do not depend on Joy¹s
> stack semantics. One example would be a map-eval, quite different
> from the (second order) map function which many books will give as
> examples.
>
> - Manfred
- Christopher Diggins
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/concatenative/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/concatenative/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/