BUG[?]: ΣLIST, ΠLIST with verrrry short lists
|
12-24-2015, 08:10 AM
(This post was last modified: 12-25-2015 02:38 PM by StephenG1CMZ.)
Post: #3
|
|||
|
|||
RE: BUG[?]: ΣLIST, ΠLIST with verrrry short lists
To me, that the summation of a list of strings should concatenate them is not clear - speaking mathematically, I have always thought of summation returning a number rather than a string. Though of course in languages like PPL that concatenate using "+" I can see some logic in the parser considering that option. Not all languages use + to concatenate: Should those languages still concatenate when summing lists of strings (implying summation must behave differently to + for those languages).
If one does restrict summation to summing numbers, when given a string perhaps a language should sum the string lengths, although then it would consistent to use some other concatenation syntax, rather than "+". Speaking practically, what does a summation of an empty list mean??? If I have a simple program listing how many presents I got from Santa from each friend, it would be convenient to have that program treat an empty list as a 0 (which will hopefully change soon), without having to add a check that the list is nonempty. Code: EXPORT SANTA() (Update: Actually, it depends on the data you are expecting: If you expect a 1 in the data stream for each detection, an empty list represents 0 meteors. If you expect the data stream to ccontainthe number of meteors each minute, an empty list represents either an equipment fault or you haven't yet run it for a minute) So in practical terms, its not clear what summation of an empty list should return. But it should return a sensible value like 0 or NaN or NULL LIST or NULL STRING, not " Invalid dimension" , which sounds like a program or spacetime failure, not a simple data collection delay in a working program. Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)