Thanks, Bill.

...I've just recalled Gilles answered part of my question in
Endnote[7] of http://www.jsoftware.com/jwiki/Doc/Articles/Play194

So...
suits =: 4 u: 9827 9830 9829 9824

But It would be nice to hear alternate suggestions for entering
(chosen) unicode symbols.

It would be good too to show it in hex, because
http://unicode.org/charts/ expects hex in its lookup field, viz 2663
not 9827.

How do you get '2663' from 9827? I can't find a hex integer conversion
primitive or user-defined verb, and there doesn't seem to be a "hex"
integer representation. Must I use something like?:

hfd=: ({&'0123456789abcdef')@(16 16 16 16&#:)


Ian


On Sun, Sep 6, 2009 at 2:07 AM, Ian Clark<[email protected]> wrote:
> Edn 2 (draft) of APWJ by Eugene McDonnell (p280) invites readers to
> enter the expression:
>
> suits=:  7&u: '♣♦♥♠'
>
> For readers of the ebook version, this expression copy/pastes nicely
> into the J session and behaves as expected.
>
> But novice readers of the paperback version may wonder how they can be
> expected to type ♣♦♥♠ without having keytops labelled ♣, ♦, ♥ and ♠.
> Short of directing readers to http://unicode.org/charts/ and inviting
> them to hunt/copy/paste ♣ etc (and I wouldn't know where to start
> looking... what alphabet is it, please?), I don't know how to answer
> this
> (a) succintly in the present example, eg to assign (suits=:...) using
> only ascii,
> (b) in general.
>
> Suggestions please?
>
> Another thing. The novice may well ask, why not: (suits=:  '♣♦♥♠')?
>
> A footnote with a brief but clear explanation of why ($'♣♦♥♠') is not
> 4 but 12 would be helpful. (I don't consider the one-word answer utf8
> to be an "explanation".)
>
> And has anyone written a unicode browser in J (the simpler the better)
> to insert a chosen char into the J window which works a bit like Menu
>> Insert > Symbol... in MSWord? If we have a Wiki page for it, it
> would be a courtesy to have a footnote directing readers there.
>
> Ian Clark
> for Vector Books.
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to