Timeline for Position built-in function with "test" instead of "pattern matching"?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 20, 2017 at 21:53 | comment | added | Picaud Vincent | @AlbertRetey thanks for the constructive comment, I have updated my answer. | |
Nov 20, 2017 at 21:52 | history | edited | Picaud Vincent | CC BY-SA 3.0 |
A Retey comment
|
Nov 20, 2017 at 21:35 | comment | added | Albert Retey |
this would work equally well without the head-check, e.g.: Position[{0.,-1,5,-5.3},_?Negative] . That is probably just relevant for those cases where your entries do not all have the same head but I often use it without checking for the head, the typical test function would return false for non-matching entries anyway, cf.: OddQ["a"]
|
|
Nov 20, 2017 at 18:10 | history | edited | Picaud Vincent | CC BY-SA 3.0 |
added 73 characters in body
|
Nov 20, 2017 at 16:37 | comment | added | Picaud Vincent | @rcollyer, thanks. On my side it was not on purpose. I was annoyed by this and just found the solution I posted. | |
Nov 20, 2017 at 16:33 | comment | added | rcollyer | that's something along the lines of what I was going to suggest. :) | |
Nov 20, 2017 at 16:30 | history | answered | Picaud Vincent | CC BY-SA 3.0 |