If any #asByteArray is adopted into the trunk, I hope it'll be the one that's been in the Cryptography package since 2003 (method fileout attached) and respects Network Byte Order (e.g., big endian).  Unlike the #as: implementation, it works equally with SmallIntegers, too.

On Sun, Feb 11, 2024 at 2:36 PM <lewis@mail.msen.com> wrote:

On 2024-02-11 19:54, Eliot Miranda wrote:

Hi Dave,

On Nov 13, 2023, at 9:33 AM, lewis@mail.msen.com wrote:

A Number should not respond to #asByteArray.

 
Agreed. Ignore my previous reply which was specific to the integers.  More accurately we could say "In general, a Number should not respond to #asByteArray. But for some kinds of number, a byte array representation may make sense."

Well put, and I agree.

I don't want to ignore your previous reply with respect to integers. It makes good sense when explained that way. I do think that the general notion of Integer>>asByteArray is a bit questionable, but a good method comment might go a long way toward clearing that up :-)

Dave