Ric,
> There are a number of definitions in handy.ijs that seem redundant to me in
> that there are standard utilities shipped with J.
My handy.ijs contains a lot of obsolete stuff. Or stuff there for my
own purpose, a purpose I don't want to inflict on a novice. I'm going
to give it a good spring-clean.
> Not saying it's better, but I'd normally write:
> calc_num1_button=: digit bind 1
> instead of:
> calc_num1_button=: 1&digit
> IMO it is clearer to see that digit's argument will always be 1.
Thanks to alerting me to this.
It's not just "IMO" -- you've cleared up a long-standing misconception
for me. It also allows me to sidestep the problem of explaining (&) if
used for this purpose, which (IMO) is too subtle for a novice on first
exposure.
1. The "digit"-parameter doesn't have to be the x-arg. But if you make
it the y-arg instead, then for (digit&1) to work, (digit) has to be
DYADIC, not monadic, even though x is never used nor mentioned.
2. But if bind is used instead of &, then conversely (=perversely?)
(digit) has to be MONADIC, not dyadic. (A comment in stdlib.ijs gives
a perfectly adequate explanation why)
3. A pratfall is that bind (in stdlib.ijs) is in no way equivalent to
the primitive: Bind (&) and indeed doesn't use (&) but (@). Am I the
only novice who has ever been misled by this?
> I agreed with Brian that I missed the "equals" button in the original
> calc.ijs. Now I miss the "plus" button. It seems unintuitive to press "="
> when you want to add.
Hahaha! (Can't please everybody.) Can I interest you in a more
advanced calculator? It's called J ... :-)
I'm just glad I wasn't on the design team of the original pocket
calculator. It's subtler than it looks.
Providing both '+' and '=' buttons means adding a whole row or column
of buttons or it looks untidy. I've a calc with the conventional
look'n'feel -- but IMO it's too complex to serve as a good demo.
I'm going to fudge the issue and label the button: '+='. Extending
calc to something more conventional will be "left as an exercise for
the reader".
> The current phrasing of your "blasphemous comment" has more impact but I get
> the feeling that your actual message is more like: "There is no need to get
> your head around tacit definition". The fact is that many of the button
> handlers in the calc script use tacit code! I suppose it comes down to
> whether you think that being provocative rather than reassuring will help get
> your message across best.
"Here Be Dragons..."
I meant to be reassuring by being provocative. Reassuring (to APLers)
by being (or, rather, risking being) provocative to J-ers.
De-mystifying a topic is never free from the insinuation that the
mystery is intentional: or at the very least, serving someone's
purpose. People are quite smart, you know. If a mystery serves no
purpose -- or no one's purpose -- it soon gets cleared up. It follows
that de-mystification is apt be viewed as de-bunking.
It wasn't my intention to debunk. Simply to cast some light. Maybe to
let in some fresh air.
On first encountering APL my initial response was to feel inadequate.
I should have felt humble, but instead I felt humiliated. Because at
the time I was masquerading as a "computer scientist", ie an expert.
This was back in 1973, when the industry was less fragmented. It was
"IBM and the Seven Dwarfs" -- and I was IBM.
So I looked for holes. For excuses to label APL as mad, not brilliant.
Then I'd be exposed as sane, not stupid. It reassured me to swap sly
remarks about the language, especially as others felt the same as I.
On first encountering J, I experienced the selfsame feeling I had on
first meeting APL. It largely revolved around "tacit programming".
Attempts by those who'd Seen The Light to motivate me by saying "it's
really quite easy" -- or -- "it's far better than APL doing it this
way" simply provoked hostility. And not just in me, I observed.
So there was a barrier to surmount, before I could contemplate J
equably, let alone consider using it myself for a serious task.
Tacit programming _isn't_ "really quite easy". In principle, maybe...
But in practice it's as much a strain as coding in 68000 ASM. (Yes,
done that -- and sold the result).
And that, I think, is the way to look at it. Those who can do it can
justly be proud of their skill. But nobody is ashamed of not being
able to compose 68000 machine code in their heads without computer
assistance, so why should they be when it's tacit J?
There is this difference. Machine-code is best kept beneath the
covers. But tacit J beneficially seeps out. As you observe, there's
tacit code in calc.ijs.
IMO the issue over tacit J is not whether we should banish (digit&1)
from calc.ijs, but whether we should aim to make novices ashamed of
writing:
quo=: 3 : 'Q,(":>y),Q' NB. place datum in quotes
instead of:
quo=: Q , Q ,~ [: ": >
because that, I think, has been counter-productive.
They'll do so in the end... and like as not they won't know they're doing it.
Ian
On Mon, Nov 1, 2010 at 1:51 AM, Sherlock, Ric <[email protected]> wrote:
> I wrote some of my comments based on a earlier memory of the article and see
> that some of them are no longer as relevant.
>
> * The current intro/link to stdlib.ijs is good, the only issue being that as
> stdlib.ijs changes, the wiki page describing it will need to be updated as
> well. An alternative might be to link to the Trac page with the source
> scripts that still contains the comments.
> http://www.jsoftware.com/trac/base7/browser/trunk/main/main
>
> * The current version now does a better job of separating out suggested
> customizations from the standard environment. I'd still be tempted not to use
> those customizations (e.g. "handler") in your simple app though.
>
> Some additional comments:
>
> There are a number of definitions in handy.ijs that seem redundant to me in
> that there are standard utilities shipped with J.
> nub - J has a inbuilt primitive for this ( ~. )
> there are standard names for your reset, si, stop defined in the debug
> script (open 'debug')
> reset -: dbr
> si -: dbs
> stop -: dbss
> TB - defined as TAB in stdlib
> ope - how does this differ to open ?
> listnameswithprefix - this seems to be the same as nl~
>
> Not saying it's better, but I'd normally write:
> calc_num1_button=: digit bind 1
> instead of:
> calc_num1_button=: 1&digit
> IMO it is clearer to see that digit's argument will always be 1.
>
> I agreed with Brian that I missed the "equals" button in the original
> calc.ijs. Now I miss the "plus" button. It seems unintuitive to press "="
> when you want to add.
>
> The current phrasing of your "blasphemous comment" has more impact but I get
> the feeling that your actual message is more like: "There is no need to get
> your head around tacit definition". The fact is that many of the button
> handlers in the calc script use tacit code! I suppose it comes down to
> whether you think that being provocative rather than reassuring will help get
> your message across best.
>
>
>
>> From: Sherlock, Ric
>> Sent: Monday, 1 November 2010 11:51
>>
>> I would suggest that you highlight to your reader any of the things
>> that you have found useful additions to the J environment and show them
>> how they can add them to their own installed environment, that way it
>> will be clear that these are things that they shouldn't expect to be
>> available in every J session. Alternatively you could concentrate on
>> introducing the reader to the J environment as it is and save those
>> customizations for a separate article - "Tips and tricks for
>> customizing/improving the J environment".
>>
>> I think in an earlier edition you mentioned that the words noun, verb,
>> conjunction etc were all defined in the stdlib.ijs. The J6.02 version
>> of this script contains a lot of comments and descriptions, I'd
>> recommend suggesting to the reader to open and inspect the script:
>> open '~system/main/stdlib.ijs'
>>
>> These comments are (unfortunately IMO) removed from the stdlib.ijs
>> script, and other distributed scripts in the J701 beta.
>
>>
>> Thanks again for this fine contribution to the community!
>>
>> Ric
>>
>> > From: Ian Clark
>> > Sent: Thursday, 28 October 2010 15:28
>> >
>> > http://www.jsoftware.com/jwiki/JinaDay
>> >
>> > Thanks to all for crits, and for provocative & instructive
>> > discussions. It doesn't escape me that a lot of people have really
>> > spent time to debug it.
>> >
>> > 1st draft done. Extensive edits. Most people's suggestions
>> > incorporated (I've not checked everyone's is in, but I will). Demo
>> app
>> > CALC somewhat improved, behaviour more intuitive, focus problem
>> > hopefully solved. Correct (?) use of the term "array" -- which has
>> > proved useful after all.
>> >
>> > LOBROW will need some spit&polish before final publication. Ditto
>> > handy.ijs.
>> >
>> > Haven't checked that all weblinks are actually used in the text. On
>> > the other hand there may be more that ought to be mentioned.
>> Virtually
>> > no mention of the J Primer, which IMO is an omission.
>> >
>> > Ian
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm