Question: Probllem with member() and table()

  1. The member() function doesn't find the value in a table if that value is associated with the key (aka index)  '0'
  2. Doesn't seem to matter if the table is created explicitly (ie by calling table()) or implicitly (ie by simple indexed assignment)
  3. member() doesn't seem to have the same issue with a zero-based Array()
  4. I'm pretty sure that this is a bug, but I'd like some opinions before I report it
  5. This behaviour has been around for a while: same thing happens all the way back to Maple 18. (I can't check anything earlier)

Check the ouput of member(10,t1) in the attached

  restart:

  interface(version);

`Standard Worksheet Interface, Maple 2019.1, Windows 7, May 21 2019 Build ID 1399874`

(1)

#
# Explicit table creation: same thing
# happens if table is created "implicitly"
#
  t1:=table([0=10, 1=12]);
  member(10,t1);
  member(12,t1);

table( [( 0 ) = 10, ( 1 ) = 12 ] )

 

false

 

true

(2)

#
# Zero-based Array
#
  A:=Array(0..1, [10, 12]);
  member(10,A);
  member(12,A);

Array(%id = 18446744074528920750)

 

true

 

true

(3)

 

Download memberProp.mw

Please Wait...