@jfbastien 459.67.
I'd make a joke about doing a for loop over floats, but I've been doing a lot of graphics dev lately...
@jfbastien ASCII is Imperial*, makes sense 🤔
* Printable codes start from 32 / 0x20
@jfbastien Makes about as much sense as arbitrarily assigning temperature scales to water freezing and boiling points.
Of course... that would also mean that if you're at 1,500m elevation your index would have to be a float since water boils at 95.06º C
$[ = 1 is a runtime error now)@dakkar @cstross @beka_valentine @jfbastien
FMTYEWTK about the history of $[:
1987-12-18: perl 1.0 is released, featuring the $[ special global variable that lets you change the array base index whenever you want. (Mainly, I suspect, to make life easier for a2p, the awk-to-perl translator also included in the release, because array indices start at 1 in awk.)
1994-10-17: perl 5.0 is released. It still supports $[ (and a2p), but the semantics of $[ have changed: It is no longer a real variable; instead, assignment to $[ is treated as a compiler directive that affects the current file only. Now module authors don't have to worry about someone else changing $[ at runtime. The documentation describes its use as "discouraged".
2000-03-22: perl 5.6.0 is released. No real change to $[, but its documentation now calls it "highly discouraged".
2007-12-18: perl 5.10.0 is released. The semantics of $[ are tightened further: Assignment to $[ only affects the current lexical scope, not the whole file it is in, bringing it in line with other compiler pragmas (use strict, use warnings, etc).
2010-04-12: perl 5.12.0 is released. $[ is formally deprecated (it was only "highly discouraged" before). a2p no longer generates code that sets $[.
2012-05-20: perl 5.16.0 is released. The implementation of $[ has been pulled out of the perl core proper; it is now provided by the arybase extension module. Also, any code that does use v5.16 (to both require at least perl version 5.16 and opt into all the new features provided by perl 5.16) no longer has access to $[: Reading from it always returns 0; assigning a non-zero value to it is a compiler error.
2015-06-01: perl 5.22.0 is released. It no longer includes a2p, which has been moved to its own CPAN distribution (App::a2p).
2019-05-22: perl 5.30.0 is released. 25 years after its use was "(highly) discouraged" and 9 years after its formal deprecation, $[ has been effectively removed. (The use v5.16 semantics of $[ are now always on: Assigning 0 to $[ has no effect; assigning anything else is a compiler error.) The arybase module no longer exists.
"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration." — Stan Kelly-Bootle
Allegato: 1 immagine #programming #meme #software #computerscience
@jfbastien Everyone talks about off-by-one errors but nobody talks about the off-by-thirty-two errors.
And whatever happened to F++ ??