asteroid icon indicating copy to clipboard operation
asteroid copied to clipboard

list@map documentation conflicts with behavior

Open davidhbrown-uri opened this issue 2 years ago • 0 comments

The list @map documentation currently reads, "Applies the function f to each element of the list in place. The modified list is returned." This does not match the observed behavior which does not modify the list in-place:

Asteroid 2.0.1
(c) University of Rhode Island
Type "help" for additional information
ast> let mylist = [1,2,3]
ast> mylist
[1,2,3]
ast> mylist@map (lambda with n do n+n).
[2,4,6]
ast> mylist
[1,2,3]
ast>

Hoping the actual behavior is what's intended, I suggest the following revision to the documentation: "Returns a new list formed by applying the function f to each element of the list. The original list is unchanged."

davidhbrown-uri avatar Oct 20 '23 04:10 davidhbrown-uri