[Jprogramming] Possible to nest
multilinenoundefinitionwithinverbdefinition?
ramacd
ramacd at nbnet.nb.ca
Thu Feb 15 12:27:39 HKT 2007
Raul;
Yes, it is a syntax error. It was an illustration of a possible future. I'm
not sure what the protocol is for specifying such.
------------------------------------------------------------------------
|\/| Randy A MacDonald | APL: If you can say it, it's done.. (ram)
|/\| ramacd at nbnet.nb.ca |
|\ | | The only real problem with APL is that
BSc(Math) UNBF'83 | it is "still ahead of its time."
Sapere Aude | - Morten Kromberg
Natural Born APL'er | Demo website: http://156.34.66.168/
-----------------------------------------------------(INTP)----{ gnat }-
----- Original Message -----
From: "Miller, Raul D" <rdmiller at usatoday.com>
To: "Programming forum" <programming at jsoftware.com>
Sent: Wednesday, February 14, 2007 11:53 AM
Subject: RE: [Jprogramming] Possible to nest
multilinenoundefinitionwithinverbdefinition?
Randy A MacDonald wrote:
> aVerb =: 3 : !. '>>' 0
This is a syntax error:
noun conjunction conjunction noun noun
It's basically the same syntax error as 0 : : 0 0
The J parsing engine never gets to the point
where the specific conjunctions or nouns involved
matter:
action queue stack
shift edge 0 : : 0 0
shift edge 0 : : 0 0
shift edge 0 : : 0 0
shift edge 0 : : 0 0
shift edge 0 : : 0 0
shift edge 0 : : 0 0
6 Bident edge 0 : : 0 0
6 Bident edge (0 :) : 0 0
In other words, J tries to combine the adjective
((0 :) in this example, (3 :) in your example)
with the conjunction ( : in my example or !. in
your example), but that's an illegal combination.
More concisely: adjectives and conjunctions
can take nouns and verbs as arguments, but cannot
take other adjectives and conjunctions as arguments.
If I needed to represent an adjective or a conjunction
to another adjective or conjunction, I'd almost always
use a noun (probably generated by 5!:1 or 5!:5).
And this entirely ignores other issues, both with
J and with perl. (Which I'd be happy to go into,
but this message is getting long.)
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list