Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Zsh hangs sometimes?



Bart Schaefer wrote:
> } and I've tidied up the STAT_ definitions because I can't do powers of
> } two in my head well enough.
> 
> Interesting.  Not interesting that you can't do powers of two, but
> interesting that your reaction to not being able to do powers of two
> is to write out longhand the powers of two, rather than let the compiler
> figure it out by use of shift operators.  All my professors back in
> college would have said the Right Thing is what was there before, in
> which you can see plainly exactly which bit-position is set rather than
> having to convert hex to binary in your head, and in which you can add
> the next bit-position without having to first work out the next power.

Can I suggest your professors were either very weird or (more likely)
didn't do much real programming?  You're suggesting (i) that they
couldn't see from

#define THIS_DEFINITION 0x0080

that the next one is obviously

#define THAT_DEFINITION 0x0100

which I don't believe (ii) that they are happy when debugging, given a
set of bits 0x09e1 (or whatever), to deduce that this includes (1<<11),
(1<<8), (1<<7), (1<<6), (1<<5) and (1<<0)?  In that case, please could
they do more zsh debugging, because given 0x09e1 I need definitions that
separate out into 0x0800, 0x0100, 0x0080, 0x0040, 0x0020 and 0x0001 so
that I can work out what the flags are.  I wrote the latter ones out
straight away but had to think for a long time about the former ones.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author