Re: Arrays
Chris Angelico <[email protected]> Tue, 19 Oct 2021 09:26:34 +1100
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CAPTjJmq7OHY_jGM2BW+17tedLNSR3UGkvz3QSG_58fBJGeU+rA@mail.gmail.com> |
On Tue, Oct 19, 2021 at 9:19 AM Duke Normandin <[email protected]> wrote: > > Pike v8.0 release 702 running Hilfe v3.5 (Incremental Pike Frontend) > > > array(string) flat = ({"this", "that", "the", "other"}); > > flat[1];(4) Result: "that" > > > flat[1]=3; > (5) Result: 3 > > > flat[1]; > (6) Result: 3 > > I was under the impression that array(string) would exclude any > other data types but strings. > > What's going on? It doesn't work in Hilfe, but "#pragma strict_types" will flag a script as wanting more stringent type checking, and will flag assignments like that. ChrisA