fuzzball-muck/fuzzball

array_put_proplist operates in a non-standard way

Closed this issue · 1 comments

array_put_proplist stores the list count number as type integer instead of type string:

@muf me @ "testing" { "1" "2" "3" }list array_put_proplist

results in:

- int /testing#/:3

If you create a list with 'lsedit', it will store the list count number as a string instead. This is, traditionally, how lists have worked and there's a lot of MUF code that does like:

me @ "whatever#" getpropstr atoi

to get list counts. Running 'atoi' on an integer will return 0. The integer count works for MPI's list macro and lsedit seems to understand it okay, but not all MUF code is compatible with int props here.

I see three options:

  1. Not care, because relatively few programs use array_put_proplist and also interact with lists in an old-school way (however, my PDTC program does, which is how I found this)

  2. Make 'atoi' not turn integers into 0. This is really stupid behavior IMO but it might break something somewhere? I dunno. I think atoi should just ignore integers on the stack.

  3. Make array_put_proplist store the list count as a string.

array_put_proplist now stores a string count if the array is made up of only strings.