Hi,

I was thinking of fixing the character comparison by replacing them with
their numeric equivalent but I discovered what Devon just mentioned :

a. i. 'éabc'

195 169 97 98 99

0{'éabc'

�

1{'éabc'

�

0 1{'éabc'

é

$'é'

2


I'm currently reading

https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/

to see how I will deal with this.


Jimmy

On Sat, Dec 10, 2022 at 2:49 PM Devon McCormick <[email protected]> wrote:

> 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 <[email protected]>
> 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 <[email protected]> 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 <[email protected]>
> 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 <[email protected]>
> > 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
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to