RDM=Raul, DoJ=Dictionary of J, DJB=me
RDM> Of course a gerund is a noun.
Of course, but the DoJ says:
DoJ> 2. The explicit result is the result of the last
DoJ> non-test block sentence executed; that result
DoJ> must be a noun in the 3 : and 4 : cases.
If the last non-test block sentence is, for example, + , then the result
of that sentence is a verb. A verb is not a noun.
Even if you added the phrase "if an explicit verb attempts to return a verb
f , then the result of the explicit verb will be the atomic representation
of f ", the result of that last non-test block sentence is still a verb
(which is then converted to a noun). A verb is not a noun, which the quote
above requires.
RDM> That said, these parts of the dictionary would
RDM> probably need to be revised, to avoid confusion
As I showed, they would have to be revised to avoid contradiction, not
confusion.
Well, I guess that's only true of the first quote. I suppose by adding the
(presently non-existent) phrase above, there would be a way to interpret the
"syntax error" description such that 3 :'+' would not be a syntax error.
However, this minimal change would not resolve the contradiction with the
first quote. Further, just because 3 :'+' isn't a syntax error wouldn't
guaruntee, for example, that it wasn't a domain error.
RDM> My example was intended as motivation more
RDM> than justification.
Motivation is a rung in the ladder of justification.
RDM> Justification requires agreeing that constructing
RDM> gerunds based on data would be useful.
Not only useful, but useful enough to offset the cost of the change. I'm
not a J conservative (cf Roger Hui). I ask for changes all the time. And I
do some weird things with J. But I've never wanted to do this. Can you
provide a more compelling example?
RDM> That would eliminate the trailing `'''' from explicit verbs like
RDM> 3 :'+/,([-.-.)&y`'''''&>
DJB> You could achieve the same result now, without the quote characters:
DJB> 3 : '+/,([-.-.)&y`(i.0)' NB. Or $~0 or ;a: etc.
RDM> These are equivalent, though more verbose. ($0) would be equivalent
but no more verbose.
Cool. Does this suffice then?
DJB> 3 : '+/,{.([-.-.)&y`]'
RDM> This is not equivalent. This results in a gerund list of
RDM> length 2, where the earlier expressions resulted in a
RDM> single gerund.
You're right that it's not equivalent, but for the wrong reason. I think
you missed the {. . However, what I should've written was:
3 : '+/,}:([-.-.)&y`]'
(Actually, I had originally written that, but I mistakenly though +`''
would produce an atom, not a 1-element list, so I erroneously changed }:
to {. )
Demonstration of equivalence:
(+`'') -: }:+`[
1
I note that }:+`] is only one character longer than +`'' and that
embedded in a literal, given the quote-duplication issue, it is actually one
character shorter:
a =. '+`'''''
b =. '}:+`]'
(#@".&> ,: #@(5!:5)) ;:'a b'
4 5
8 7
So, how often do you need a verb to return the atomic representation of
(derived) verb, how often do you write such verbs using literals instead of
:0 scripts, and how badly do you want to save yourself 4 characters in
those cases?
-Dan
--
View this message in context:
http://www.nabble.com/gerunds-from-explicit-verb-results--tf4772014s24193.html#a13656732
Sent from the J General mailing list archive at Nabble.com.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm