Raul's expression "<&(3&u:)" made me think of the endless complications for
character comparison once you include multi-byte representations as in
Unicode.
So this initial expression works fine but extending it beyond elements of a.
leads to ambiguity.
   'A' <&(3&u:) 'a'
1
   a. i. 'Aa'     NB. confirming the inequality
65 97
   NB. (load "define-abbrev-table.el")  NB. This allows me to enter special
characters in emacs
   'α' <&(3&u:) 'a'
0 0
   'α' <&(3&u:) 'β'           NB. So should we say alpha is only partially
less than beta?
0 1
   (<a.) i. &> 'α';'β'
206 177
206 178



On Sat, Dec 10, 2022 at 7:28 AM 'Mike Day' via Chat <c...@jsoftware.com>
wrote:

> Yes,  my suggestion was an example of using /:~ to exploit J's inbuilt
> ordering for a
> simple, quick answer;  but maybe
>    /:~ 'aA1.;'
> (eg) isn't the order relation you require,  so I agree with Raul.
>
> Mike
>
> Sent from my iPad
>
> > On 9 Dec 2022, at 19:22, Jimmy Gauvin <jimmy.gau...@gmail.com> wrote:
> >
> > Hi,
> >
> > the domain of < and others could be extended to include characters.
> >
> > Sorting with /: and \: implies there is an "order" relation between
> > characters.
> >
> >
> > J
> >
> >> On Fri, Dec 9, 2022 at 6:21 AM Donna Ydreos <dy...@sympatico.ca> wrote:
> >>
> >> The domain of < is numeric. You can create a function for letters with
> >> reference to alphabetic order or some given order including say all ASCI
> >> characters.
> >>
> >>>> On Dec 9, 2022, at 3:47 AM, Jimmy Gauvin <jimmy.gau...@gmail.com>
> wrote:
> >>>
> >>> Hi all,
> >>>
> >>> testing character data for equality works fine but testing for relative
> >>> order does not.
> >>>
> >>>  'a'<'v'
> >>>
> >>> |domain error
> >>>
> >>> |   'a'    <'v'
> >>>
> >>>  'a'='v'
> >>>
> >>> 0
> >>>
> >>> Is this explained somewhere ?
> >>>
> >>> Thanks,
> >>>
> >>> Jimmy
> >>> ----------------------------------------------------------------------
> >>> 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
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


-- 

Devon McCormick, CFA

Quantitative Consultant
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to