Re: Doubt about compiler error of `has_value` with arrays
William Welliver <[email protected]> Fri, 14 Mar 2025 00:06:38 -0400
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
Hmm. I=E2=80=99m not sure where I fall on this. I can appreciate that the h= aystack may have a type and you might want to restrict the type over the ope= rand in some situations but it seems like a method like has_value should be l= enient with respect to the value being searched for.=20 Sent from my iPhone > On Mar 13, 2025, at 1:13=E2=80=AFPM, Chris Angelico <[email protected]> wro= te: >=20 > =EF=BB=BFOn Fri, 14 Mar 2025 at 03:31, Marcos Cruz <[email protected]= et> wrote: >> So somehow the problem happens when the array argument is a literal, >> both in hilfe and in a file. >=20 > When you use literals, yes, has_value expects that the argument makes > sense. But normally you'll be using a variable for one or both of its > arguments, so the expectation of the function will match your mental > expectation and it should be more reasonable. >=20 > ChrisA >=20