We use names for the symbols to talk about them, and to list orally a
sequence of them. The symbols are fine on paper, but not adequate for verbal
communication. The symbols have names for non-J users which may have no
relationship to their use in J. If we are talking about J using the
dictionary names is a simple basic approach, even if it does create two
names which are synonyms for one symbol, and some of them may have other
connotations which we think are inappropriate. We can of course use the
other conventional names for the symbols too.
The 'primitives' script provides some tools to go in both directions using
the dictionary names. Another script by Don Guin is in the Wiki. The
objective of the script is to provide a tool for the many who are happy
using words and get frightened off a bit by a set of symbols.
Your example and Roger's variant illustrate one of the strengths of J, it is
a great tool for manipulating data containing symbols. It provides a very
simple way of naming them in a way which aids the users interpretation, and
it enables using names for both the data containing symbols and the possibly
very complex sequence of symbols specifying an operation on the data.
----- Original Message -----
From: "Devon McCormick" <devon...@gmail.com>
To: "J-programming forum" <programm...@jsoftware.com>
Sent: Monday, January 20, 2014 7:08 AM
Subject: Re: [Jprogramming] J talk in NYC 1/21 - examples welcome
The more I think about it, the more I think that naming things to avoid
symbols is a mistake - names can have unintended connotations and they
hide
relationships between things.
However, using them for occasional pedagogic illustration can be useful.
On Sun, Jan 19, 2014 at 12:37 AM, Steven Taylor <tayl...@gmail.com> wrote:
I mean a push button translation a bit like the inverse of flatten f.,
but
for teaching purposes.
On 19 Jan 2014, at 05:34, Steven Taylor <tayl...@gmail.com> wrote:
> Is it worthwhile to have a translation to/from a long form? Would this
help with adoption?
>
>
> scan=:\
> insert=:/
> sum=:+
> til=:i.
> scan=.\
> NB. same as +/\i.20
> sum insert scan til 20
>
> NB. but what about special forms?
> scan3=:\&3
> sum insert scan3 til 20
>
>
> On 17 Jan 2014, at 17:01, Devon McCormick <devon...@gmail.com> wrote:
>
>> Thanks for the tips.
>>
>> I will attempt to emphasize the practical values of 1) being able to
hold
>> an entire solution in one's head
>> at once, and 2) time-to-completion as a good metric of efficiency, not
>> "how quickly code runs".
>>
>> For the parens example, I'm thinking of showing it something like
>> this:
>>
>> phrase=. '0{11{22{333}222}1}0'
>> +/\ 1 _1 0 {~ '{}' i. phrase
>>
>> Then backing up to explain successive sub-expressions in order of
>> evaluation. I may further elaborate by assigning the verb to a name
>> and
>> generalizing this to take a left argument of the paren pair to use.
This
>> will allow me to introduce the tacit/explicit distinction as well.
>>
>> I think my basic problem is to avoid trying to cover too much, so I'm
now
>> thinking of showing a few other variants of scan, then maybe "cut" or
the
>> "power" conjunction.
>>
>>
>>
>> On Fri, Jan 17, 2014 at 11:24 AM, Roger Hui <rogerhui.can...@gmail.com
>wrote:
>>
>>> Suggestion: Make more of a distinction between the data and the
>>> code.
>>> Thus:
>>>
>>> x=: '@{ foo; if (abc) { if (q) { m; } } }'
>>>
>>> +/\ 1 _1 0 {~ '{}' i. x
>>>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm