emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving kbd to subr.el


From: Eli Zaretskii
Subject: Re: Moving kbd to subr.el
Date: Fri, 15 Oct 2021 14:10:07 +0300

> Date: Fri, 15 Oct 2021 14:05:36 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: stefankangas@gmail.com, emacs-devel@gnu.org
> 
> > > (if (and (not need-vector)
> > >          (cl-loop for ch across res
> > >                   always (and (characterp ch)
> > >                               (let ((ch2 (logand ch (lognot ?\M-\^@))))
> > >                                 (and (>= ch2 0) (<= ch2 127))))))
> > >     (concat (cl-loop for ch across res
> > >                      collect (if (= (logand ch ?\M-\^@) 0)
> > >                                  ch (+ ch 128))))
> > >   res)
> > 
> > Yeah, my eyes glazed over when reading that code the first few times.
> > :-) 
> > 
> > > But that is equivalent to:
> > >
> > >     (<= 0 ch 127)
> > 
> > I think...  you're totally right.  It looks like a very convoluted way
> > to write (<= 0 ch 127).
> 
> I don't read CL-ish very well, so I cannot help you here.  (Read: I
> have no idea what this code does.)

Actually, I have to disagree with the conclusion that this is a
complicated way of saying

  (<= 0 ch 127)

That's because 'ch' can include modifier bits set, and the above code
resets them before comparing against 127.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]