For what it's worth I'm quite happy with the following verb pair ( dyadic
x man y, adds text y under topic x, monad man y searches and lists man
pages), striving to have a simple description and a simple example to fit
in one line - by default iman lists only the first one.
===
mantopics =:''
mantexts =:''
man =: 3 : 0
if. '?'={.y do.
txt =. }.y
intexts =. 0
else.
txt =.y
intexts =. 1
end.
if. '+'={:y do.
txt =. }: txt
fulltxt =. 1
else.
fulltxt =. 0
end.
srch =. ([ +./@:E. [:>])"_ 0
mask =. txt srch mantopics
if. intexts do. mask =. mask +. txt srch mantexts end.
mtopics =. mask # mantopics
mtexts =. mask # mantexts
if. fulltxt
do. mtexts =. ([:>cutLF)&.> mtexts
else. mtexts =. (0{cutLF)@> mtexts end.
|: mtopics ,: mtexts
:
idx =. mantopics i. boxopen x
mantopics=: (boxopen x) idx} mantopics,a:
mantexts=: (boxopen y) idx} mantexts,a:
)
'man dyad' man (0 : 0)
x man y : adds man text y(string) to mantexts under x(string) mantopic'
ex:
'man dyad' man 'x man y : adds man text y(string) to mantexts under
x(string) mantopic'
)
'man monad' man (0 : 0)
man y : search for y(string) in the topics (always) and texts (if not
started with '?'), if ends on'+' return full texts
ex: man'man'
ex: man'?man monad+'
)
regards,
Danil
вт, 17 мая 2022 г. в 15:21, 'Viktor Grigorov' via Programming <
[email protected]>:
> Hey,
>
> Swell idea and implementation. I want to make a new or myown j90x
> reference sheet, and have on using TeX in the works. But I also wanted to
> do a html version, an ascii version, an ANSI C escape codes version, and
> possibly and md version. I also wanted to do a J verb that would spit out
> either the whole thing, or examples/definitions/etc. for whatever strings
> you give it, e.g., jhelp '<.' or just jhelp ''. They'd all have the same
> content, design only will differ.
>
> And, yes, this should be a built-in, especially for people using jconsole
> as their main way using the language. If you're interested in working on
> this shoot me an email.
>
> May 17, 2022, 15:09 by [email protected]:
>
> > Hi Everyone,
> >
> > NuVoc and the j wiki are fantastic resources but I often find myself
> > wanting a quick reference directly in the repl.
> > So, to scratch my own itch, I've put together a simple reference addon
> > inspired by the ngn/k built in reference docs.
> >
> > The repo is on github here: https://github.com/AshyIsMe/jreference
> >
> > It should be straightforward to use (works for me on macos and linux):
> > install 'github:AshyIsMe/jreference'
> > load 'ashyisme/jreference'
> > H
> > H help
> > H0 comparisons = < > _
> > H1 arithmetic, logical + * - %
> > H2 powers, uniques ^ $ ~ |
> > H3 defs, cut, ravels . : , ;
> > H4 tally, bases, insert, grades # ! / \
> > H5 left, right, head, tail [ ] { } {{ }}
> > H6 rank, do, agenda, atop " ` @ & ?
> > H7 alphabet, booleans, permutations, find, fold a A C. D. e E. f. F.
> > H8 integers, index of, complex, polynomials H. i. I. j. L. L: M. NB. o.
> p. p..
> > H9 primes, symbols, unicode, hook, fork p: q: r. s: S: t. T. u: x: Z:
> > _9: 9: (u v) (f g h) u. v.
> > H10 assert, if, for, goto, select, try catch, while
> >
> >
> > The mnemonic is H for Help.
> > H for overview, H0 for comparisons, etc
> >
> > I'm planning on adding some simple examples along the lines of the J
> > Reference Card pdf, though I'm not quite sure how to format those just
> > yet.
> >
> > (J RefCard:
> https://code.jsoftware.com/mediawiki/images/5/53/J602_RefCard_color_letter_current.pdf
> )
> >
> > I think ideally I'd prefer something like this to be built in to j but
> > hopefully this is a simple enough prototype to see if anyone else is
> > interested.
> >
> > Cheers,
> > Aaron.
> > ----------------------------------------------------------------------
> > 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