Parsing / some comments 
Author Message
 Parsing / some comments

Hi Alan!


at 14:20 on 07.04.1996 to comp.lang.apl about "Re: Parsing":
-----------------------------

Quote:
>...
>So, the interpretation of function strands A B C D is 1-Hook and 1-Fork.
>Is it A B (C D), or (A B) C D, or A (B C) D?
>...

I don't understand you.  
If you don't know the interpretation of trains of verbs, why don't you just
type it in to the J interpreter and experiment with it, or just look again in
the
great J Dictionary by Ken Iverson, which you have alredy read, as you
pointed out at the end of your posting from 7.4.96
There is nothing cryptic concerning trains of verbs!!!
Why do you insert artificial parentheses in your  A B C D train?
Quote:
>Is it A B (C D), or (A B) C D, or A (B C) D?

There are trains of 3 verbs, called FORKS, an trains of 2 verbs,called
HOOKS. The interpeter starts from the right. It finds four verbs.
The first three verbs (from the right)complete a fork (B C D),
which is the right part of the hook A (B C D), composed by the remaining
verb A and the resulting verb from the fork (B C D).
That's simple.(I hope I expressed it correctly in English.)

Step by Step: A B C D
The interpreter finds D; is there still a verb on the left? Oh yes, there
is C, now we would have a the hook (C D), but there is still the verb B on
the left side, what completes the fork (B C D), now we know that there is
certanly the fork (B C D), because we haven't defined a train with 4 verbs,
which would build a new entity from four verbs; but there is still the verb
A on the left, which results in a train of the two verbs, A and (B C D),
which is a hook.

Quote:
>>...
>>I would be interested in seeing such a definition, and in seeing how
>>phrases such as  mean=:+/ * #  would look in your definition of fork.
>No problem:
>   mean:+/ tine * fork #
>...

If would have to work in practice with this definition of a fork,
I think, you would soon condemn it.

Generally I have made the experience, that APL looks very old
since I know and work with J. And that the definitions and concepts
of J charm me again and again, because they are simple and consistent,
without needless complexity. J is exactly the solution to that,
what disturbed me while working with (especially nested) APL.

Quote:
>...
>No, I do not take an extreme minimalistic approach --- or I'd like Pascal
>that does not even have power!
>J and original APL\360 have too many primitives.

Why do you think that J has to many primitives?
I think that J primitives are _onomatopoetic_,
  in respect to their visual representation and functionality.
Why don't you state that English has to many words (or verbs)?

Quote:
>To understand and debug an APL (or J) program written by
>someone else, I need to know Domino, Inner, and Outer products even if I
>don't care about Linear Algebra.
>...

1.) Otherwise you would have to understand, the programs, which do the work
    of DOMINO, INNER ...; written in different ways by more than one "someone
else".
2.) DOMINO is very rare, and in these rare cases you could reference a
    dictionary.
3.) In my opinion INNER and OUTER are not only in the domain of
    mathematical Linear Algebra. So it's no problem to understand it,
    even if don't like math.

Greetings from Styria
JoHo :-)
----------------------------
Joachim Hoffmann

http://www.*-*-*.com/
--- OffRoad 1.9o unregistered



Thu, 24 Sep 1998 04:00:00 GMT  
 Parsing / some comments
Joachim,

Thanks for your comments. Here are some responses ...

Quote:
> If would have to work in practice with this definition of a fork,
> I think, you would soon condemn it.

> Generally I have made the experience, that APL looks very old
> since I know and work with J. And that the definitions and concepts
> of J charm me again and again, because they are simple and consistent,
> without needless complexity. J is exactly the solution to that,
> what disturbed me while working with (especially nested) APL.

I agree, even APL2 looks very old to me.
Zero has several J-like primitives and tacit definition.

Quote:
> There are trains of 3 verbs, called FORKS, an trains of 2 verbs,called
> HOOKS. The interpeter starts from the right. It finds four verbs.
> The first three verbs (from the right)complete a fork (B C D),
> which is the right part of the hook A (B C D), composed by the remaining
> verb A and the resulting verb from the fork (B C D).
> That's simple.(I hope I expressed it correctly in English.)

> Step by Step: A B C D
> The interpreter finds D; is there still a verb on the left? Oh yes, there
> is C, now we would have a the hook (C D), but there is still the verb B on
> the left side, what completes the fork (B C D), now we know that there is
> certanly the fork (B C D), because we haven't defined a train with 4 verbs,
> which would build a new entity from four verbs; but there is still the verb
> A on the left, which results in a train of the two verbs, A and (B C D),
> which is a hook.

Thanks for the nice explanation of trains.

I think adding syntax to support an important new "function" (verb, adverb, conjunction,
operator, higher-level function, program, ... from now on I call them all just functions!)
is arrogant and stupid.

- Show quoted text -

Quote:

> Why do you think that J has to many primitives?
> I think that J primitives are _onomatopoetic_,
>   in respect to their visual representation and functionality.
> Why don't you state that English has to many words (or verbs)?

> >To understand and debug an APL (or J) program written by
> >someone else, I need to know Domino, Inner, and Outer products even if I
> >don't care about Linear Algebra.
> >...

> 1.) Otherwise you would have to understand, the programs, which do the work
>     of DOMINO, INNER ...; written in different ways by more than one "someone
> else".
> 2.) DOMINO is very rare, and in these rare cases you could reference a
>     dictionary.
> 3.) In my opinion INNER and OUTER are not only in the domain of
>     mathematical Linear Algebra. So it's no problem to understand it,
>     even if don't like math.

You have convinced me. Thanks.
It is better to have a lot of well-designed primitive functions then to force the programmer to
design "new" functions for standard concepts.

K seems to have too few primitives. Arthur has to find a single ASCII character, make up a new
_name, or overload one of the symbols he already has.

APL also has this desperate "what symbol can we spare?" problem. Look at the circle function to
see desparation at work. I forget, sinh is that 4o or 5o ? Yuk!

Zero (a simplification of APL2) has an ASCII spelling for all primitives
Some examples: _i for iota, _t for take/first, and _d for drop/last.
The transcendental functions are: _sin, _cos, _tan, with inverses _sin_1, _cos_1, _tan_1.

You can program Zero in ASCII but I don't.
Zero uses the ISO standard Unicode character set which has all of the APL symbols.
Given a Unicode text file: Zero translates the APL characters to the above ASCII strings and
then hands the result to the Zero compiler.
Zero has additional standard single Unicode characters associated with primitives.
The root function is attached to the root symbol.
If the input is ASCII, it has no APL characters, so no translation.
Like original APL\360, if there is a standard mathematical symbol I use it.

It is much nicer to program with a rich set of standard symbols.

Alan



Mon, 05 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Parsing stack comments

2. parsing out comments (config file)

3. Bug or Feature: Parsing of commented lines

4. Comments, Please: a script to parse plain text lyrics to HTML

5. Parsing out C/C++ comments ?

6. Ignoring comments - Parsing input file

7. Any method easily parse comment...

8. How to find/parse 'C' Comments

9. Tcl Comment Parsing Bug?

10. Is comments parsed ???

11. Parsing comments with braces

12. Comments not parsed correctly?

 

 
Powered by phpBB® Forum Software