[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:04075] unpack and "bn" with n>16

From: Pixel <pixel@...>
Date: 2000-07-17 11:37:13 UTC
List: ruby-talk #4075
There must be a good reason for the following (tested on 1.4.5, 1.4.3,
ix86/axp):

p "\0\0\0\0".unpack("b16b1b2") # -> ["0000000000000000", "0", "00"]
p "\0\0\0\0".unpack("b17b1b1") # -> ["00000000000000000", "0", ""]

I can't find it though :(


thanks, cu Pixel.


PS: it also happens in Perl, i may misunderstood something?

print join ",", unpack("b16b1b2", "\0\0\0\0"), "\n";
print join ",", unpack("b17b1b1", "\0\0\0\0"), "\n";

In This Thread

Prev Next