I agree.  The booleans have an immediate, obvious use (like dealing with RGB
arrays using less memory, possibly cryptography, and more compact use of
booleans
encoded as character).  As for these other proposed extensions, neither
their
usefulness nor implementation seems apparent.  For instance, in the examples
proposed by
the estimable Mr. Niemiec, why would
  >:'abc'
be  "def" and not "bcd"?  Why would the result of
   'xyz'-'a'
be numeric and not something else?  Especially if you would give a domain
error on
   'a'+'a'
why allow the preceding case?

Implementing the booleans only has enough complication to digest when you
consider
multi-byte characters versus single-byte characters but the immediate
benefit is clear.

On 10/4/07, John Baker <[EMAIL PROTECTED]> wrote:
>
> Please resist the urge to introduce anything like 'a' + i.3.  Such
> features
> are close to useless and would
> lead to confusing behavior in extant code.
>
> Extending b. is an entirely different proposition and may well be
> worthwhile.
>
> On 10/4/07, Mark D. Niemiec <[EMAIL PROTECTED]> wrote:
> >
> > Roger Hui <[EMAIL PROTECTED]> wrote:
> >
> > > I propose to extend the bitwise operations   m b.   for   m e. 16+i.19
> > > to work on character (8-bit or 16-bit) arguments. e.g.
> > >
> > >    'abc' 23 b. '321'
> > > srs
> >
> > This sounds like a good idea.
> >
> > In this vein, perhaps it would also be good to extend certain arithmetic
> > verbs as well?
> >
> >    'a' + i.3
> > abc
> >    'c' - i.3
> > cba
> >    'xyz' - 'a'
> > 24 25 26
> >    >: 'abc'
> > def
> >    <: 'xyz'
> > wxy
> >    'ace' >. 'bad'
> > bce
> >    'ace' <. 'bad'
> > aad
> >
> > Of course, domain errors on things like 'a'+'a', 0-'a', 'a'>.0 etc.
> > as well as anything involving anything more complicated than addition,
> > like 'a'*2, 'a'^2, %:'a', !'a', etc.
> >
> > -- Mark D. Niemiec <[EMAIL PROTECTED]>
> >
> > ----------------------------------------------------------------------
> > 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
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to