RE: [stack] various questions
wtanksley@bigfoot.com — 2000-05-11 16:38:01
From:
peter_easthope@...
>Sorren, why are you creating a new language and
>writing the compiler? If you have explained already
>perhaps you can just point me back to the message.
I couldn't say why he's doing it, but I am first because I want to
understand more about this new
>Have any of you folks used J? The concatination here
>is reminiscent of J.
Used it, loved it. It's not in the least concatenative. It is, however,
combinative, and all concatenative languages I know of are also combinative.
>wtanksley@... said,
>wt> the syntax I used depended on strings, while
>wt> yours depends on "symbols".
>I know what a string is. What is a "symbol"?
Doesn't really matter. A symbol is a way of economically and quickly
expressing a token which is similar to the ones which the language uses for
identifying functions. In Postscript, you express a symbol by preceding it
by a backslash.
>Brent Kirby mentioned,
>bk> Count upward, beginning at 0, skipping multiples of five
>Sorren replied,
>sr> 0 [dup 5 % 0 = [dup puti] [] if 1 +] spin
>In case anyone is interested, this is it in J without division.
>J evaluates each line from right to left. (OK, it wasn't my
>choice.)
It's a brilliant convention. It allows the programmer to know exactly what
order things are going to happen in without making parsing hard.
>wt> ... more thinking about continuations.
>What is a continuation?
Well, think of how a function gets called and later on returns to its
caller. Suppose instead of always returning to its caller, it was possible
to return to something else. That's a continuation; it's the ability to
formally change the return address.
>Thanks, Peter E.
-Billy
wtanksley@bigfoot.com — 2000-05-11 16:44:12
From:
wtanksley@... [mailto:
wtanksley@...]
>From: peter_easthope@...
>>Sorren, why are you creating a new language and
>>writing the compiler? If you have explained already
>>perhaps you can just point me back to the message.
>I couldn't say why he's doing it, but I am first because I want to
>understand more about this new
...theory of language. I've always liked Forth, and always wondered why
such a functionally impure language was so easy to code in, almost as though
it were functionally pure.
Now, thanks to the Joy pages, I discover that there _is_ a functional theory
which explains Forth.
-Billy
peter_easthope@gulfnet.pinc.com — 2000-05-11 18:04:19
Billy said,
wt> It's [J is] not in the least concatenative. It is, however,
combinative, and all concatenative languages I know of are also combinative.
Why do you call (+/ @ *:) combination rather than
concatenation of "sum over" and square?
Thanks, Peter E.
peter_easthope@... 48.7689d N, 123.3017d W, 30 m
Recommended reading:
http://www.naturalstep.org/
wtanksley@bigfoot.com — 2000-05-11 19:28:48
From:
peter_easthope@...
>Billy said,
>wt> It's [J is] not in the least concatenative. It is, however,
>wt> combinative, and all concatenative languages I know of are
>wt> also combinative.
>Why do you call (+/ @ *:) combination rather than
>concatenation of "sum over" and square?
A language may use and provide concatenation without being concatenative.
For example, C provides strcat. Lisp provides cons (and concat). Yet none
of these are in the least concatenative languages, because none of these
languages operate by treating concatenation of functions as their
composition.
Monadic functions in J behave in a concatenative manner, using an array
rather than a stack, although the language still behaves applicatively and
therefore requires a parser. Dyadic functions do not behave
concatenatively.
>Thanks, Peter E.
-Billy
peter_easthope@gulfnet.pinc.com — 2000-05-11 20:19:29
Billy said,
wt> It's [J is] not in the least concatenative. It is, however,
combinative, and all concatenative languages I know of are also combinative.
Why do you call (+/ @ *:) combination rather than
concatenation of "sum over" and square?
Thanks, Peter E.
peter_easthope@... 48.7689d N, 123.3017d W, 30 m
Recommended reading:
http://www.naturalstep.org/
wtanksley@bigfoot.com — 2000-05-11 20:57:36
From:
peter_easthope@...
>Billy said,
>wt> It's [J is] not in the least concatenative. It is, however,
>wt> combinative, and all concatenative languages I know of are
>wt> also combinative.
>Why do you call (+/ @ *:) combination rather than
>concatenation of "sum over" and square?
(I just recieved this for the second time -- I'm not sure why.)
By the way, I don't call that "combination". you misunderstood my use of the
overloaded word "combinative". In this context that does not talk about a
specific operation which combines two things, nor about the branch of
mathematics which counts the number of combinations of things, but rather
about the class of functions which act by taking more than one item of data
and producing a new arrangement of that data.
For example, SWAP is a combinator; it takes two parameters and produces two
parameters in a different order. DROP is also a combinator, although a
special one (since it destroys data). (Joy calls this function "pop", but I
find that name abyssimally hard to remember, partly out of old habit and
partly because that implies to me that the data is being preserved
somewhere.)
>Thanks, Peter E.
-Billy