Geoffrey Broadwell writes:

> How are the bitwise shifts defined on low level types?  In particular,
> for right shift, does high bit extension or zero fill occur?  Does the
> answer depend on whether the low level type is signed or not?
> 
> On the flip side, it seems more useful if we have both operators
> available ...

Deal with anything as low-level as bits seems to be very rare in Perl 5
programming.

Introducing more operators to the core language, especially terse
punctuationy ones, for something rarely used strikes me as a way of
making the documentation fatter and raising the barrier to entry for
little benefit.

> Perhaps having both +> and ?> operators?  Since "coerce to boolean and
> then right shift" is meaningless, ...

It's useless, rather than meaningless; you've neatly defined what the
meaning of that (useless) operator would be.

That is, at the moment there are consistent rules for being able to
correctly guess the meaning of an operator based on knowledge of other
operators.  Your suggestion would break that; just because some
combination of symbols doesn't currently have a use doesn't mean that it
makes sense to appropriate them for something else.

> this seems ripe to DWIM.

But "DWIM" is the meaning you previously defined, surely?

> (For me, DWIM here means "+> does high bit extension, ?> does zero
> fill".)

Why?  You think that somebody not knowing about this operator would
correctly infer its existence from other operators?  Even if somebody
guessed that both operators exist it looks pretty arbitrary which is
which.

For this esoteric sort of stuff can't we have named operators (short
names if you like, perhaps taken from assembly language), in a module
that can be loaded by those who need them?

Smylers

Reply via email to