Menu

#1679 binary command and arg checking

closed-invalid
3
2002-01-03
2001-11-19
Anonymous
No

It would be nice if [binary format] would do some
argument checking, and throw errors if the value
is incompatible with the format.

For example, the following script should cause an
error:

binary format s 40000

Since the value of 16-bit signed words is -32768 to
32767, the value of 40000 is illegal.

Discussion

  • Donal K. Fellows

    • priority: 5 --> 3
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    I'm not convinced that's the right thing to do, especially
    since there may be existing code that depends on being able
    to convert (effectively) unsigned shorts into 16-bit values.

    The real stickiness comes when you start to consider what's
    going on with 32-bit systems. I think I'll put this on the
    back burner for a while...

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Review of the documentation indicates that the current behaviour (taking the low-order 16-bits of
    whatever integers are supplied) is correct. Changing this would not be backward compatible.

     
  • Donal K. Fellows

    • status: open --> closed-invalid