[Jprogramming] @: and capped fork

Ric Sherlock tikkanz at gmail.com
Sat Dec 1 12:24:45 UTC 2012


You can alter the display like you could in j602 by setting the noun
DisplayForm in the base.cfg file. You can access it from the jgtk menu using
Edit|Configure|Base

As others have described in this thread, beginners come in many different
shapes & sizes which makes it pretty hard to come up with the "right" set
of tools for beginners. I know for example that it took me at least 18
months before I really started to understand tacit. I was happy and
productive without it. For others tacit J is why they're drawn to the
language.

Here's one relatively understandable way of defining the cosine rule that
might work for beginners.

require 'trig'
NB.*cosrule v Uses cosine rule to calc missing angle/side
NB. monadic result: length of missing side
NB. dyadic result: size of missing angle
NB. y is: lengths of known sides
NB. x is: size of angle opposite unknown side
NB. eg: cosrule 4.2 6.9 4
NB. eg: 31.8183 cosrule 4.2 6.9
cosrule=: 3 : 0
  'a b c'=. 3 {. y
  dfr arccos ((+/ *: a,b) - *:c) % 2*a*b
:
  'a b'=. 2 {. y
  C=. rfd x
  %: (+/ *: a,b) - 2*a*b*cos C
)



On Sun, Dec 2, 2012 at 12:15 AM, Alex Giannakopoulos <
aegean at blueyonder.co.uk> wrote:

> Thanks Ric
>
> I wasn't thinking of myself so much, I've got used to the J convention now,
> but more of what would make a good default startup for a newcomer.  I will
> look at the script though, always nice to see how others do it.
>
> As for the capped fork, yes I can live without it, just about, but I
> certainly couldn't when I stared out, especially - as I said - since this
> is the format returned by the 13 : verb.
>
> OK, here's another one:
> I have recently switched over to j701(gtk) from j602.
> On the whole, I like the new colour-coded approach to verb description, but
> sometimes, in complex cases, I really appreciated j602's boxing of the
> structure, which went a long way to make things clear.  (one of J's best
> debugging tools).  Is there a way to emulate this under 702gtk?
>
>
> On 1 December 2012 08:03, Ric Sherlock <tikkanz at gmail.com> wrote:
>
> > Hi Alex,
> > Not sure if you're aware of the trig script available as part of the
> > 'math/misc' addon, but it may contain at least some definitions you'd
> like
> > to use. If you have the addon installed then you can load the definitions
> > using:
> >    require 'trig'
> >
> > If you restrict yourself to writing explicit J then it is perfectly
> > possible to get away without using capped fork.
> >
> > Ric
> >
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


More information about the Programming mailing list