On Sun, May 31, 2009 at 1:03 PM, Don Watson <[email protected]> wrote:
>    I want to emphasize that I am not suggesting that tacit J go - only that
> some intermediate stages be added to make each new feature incremental. It
> is explicit J that is the problem. It is inconsistent with both tacit J and
> interactive J, it is ugly, it uses unmatched parentheses - a sin that
> interactive J won't accept - it puts code in quotes and it uses "x" and "y"
> to bring in arguments. I am trying to integrate the lot into one consistent
> and incrementally separate language rather than the three disconnected
> worlds that currently exist.

I think it's important to distinguish between two three different entities in J.

One entity is a "sentence".

Another entity is a "script".

And the third entity is a "block".

In all three cases, these words have technical meanings, in
the context of J.

A "sentence", in essence, is a single line of executable code.
Sentences follow J's grammatical rules, and may be evaluated.
When evaluated, they produce either a noun, verb, adverb or
conjunction.

A "script" is the thing that you terminate with an isolated
right parenthesis.  A script is preceded by a sentence and
thus represents a noun, verb, adverb or conjunction.

   example=: 0 :0
This is an example script,
which is being used in a sentence
which produces a noun
)

Scripts which represent verbs adverbs or conjunctions must
contain legal sentences.  Since a line beginning with
a left parenthesis can not be a legal sentence, any
legal sentence may contained in a script, without
conflicting with the terminator.

A "block" is somewhere in between a sentence and a
script.  It is a sequence of sentences and is delimited
by control words (such as if. while. do. or end.)  Blocks
may be nested.  Since control words may not be a part
of a legal sentence, any legal sentence may be contained
in a block, without conflicting with any control words.

If the script terminator could be a part of a legal
sentence, we would have problems.

That said, interactive J does allow scripts to be
entered.

As for named parameters -- most languages allow
the use of named parameters.  J is not unique
here.  For example, if you paste this into your browser:
javascript:function%20f(){alert(arguments[1])}f(1,2,3)
You should get an alert box which says "2".

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to