On Nov 8, 2007 4:59 PM, Dan Bron <[EMAIL PROTECTED]> wrote:
> 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?
Not properly fleshed out, in the brief time I have available to write
this response,
but I have often wanted dynamically generated gerunds when working
with "inverted
tables". Here, I have some table, and I want to apply different
functions to different
columns -- perhaps based on their data type, or perhaps based on column names.
Once I have a gerund for each column, I could produce the result table.
> Cool. Does this suffice then?
Does what suffice for what?
I would say that `($0) is a valid replacement for `'''' in a string
representation
of the body of an explicit function. However, I still think automatic gerund
conversion of verbs makes more sense.
Also note that `($0) is only the same length as `'''' in the string
representation.
in a :0 definition, this same concept would be spelled `''
And there's no simple tacit way to compute gerunds dynamically
(where a gerund result depends on data). You have to build up the
underlying data structure, which gets rather verbose and is hard to
maintain (this form can quickly become hard to read). So I think
explicit definitions win, here.
> You're right that it's not equivalent, but for the wrong reason. I think
> you missed the {.
You are right -- and in fact, what I really wanted was the atom, so this
approach of yours was actually a more appropriate answer.
> 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?
About once a month, right now. Then again, I don't really write all that many
J programs in a month, as things currently stand.
And I would be saving either 3 characters or 5 characters, in most contexts.
That said, originally in the above example, I had nested 3 : definition inside
another 3 : definition and was starting to write `'''''''' when I
decided to factor
it out and use an adverb, so that's almost like saving 9 characters.
That said, I also want a single word representation of an empty
list which never requires such a long linear representation.
But my thought here is that this approach makes sense. If it doesn't make
sense to people other than me ... well, maybe I am wrong. This would not
be the first time.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm