is a user on mastodon.xyz. You can follow them or interact with them if you have an account anywhere in the fediverse.
If you don't, you can sign up here.
@mrtino Tu peux me dire comment tu fais un tableau en Perl qui commence pas par zéro ?
@mrtino Disons que je veux bien te croire, mais je ne vois pas comment on fait (et du coup j'ai de gros doutes ^^).
@mrtino Je crois que le Visual Basic permet de faire des tableaux qui ne commencent pas de zéro. Enfin, la doc dit que ça commence de zéro, mais il y a une fonction LBound [1] qui donne le premier index… ça serait bizarre de faire une fonction pour toujours renvoyer zéro.
[1] https://www.tutorialspoint.com/vbscript/vbscript_lbound_function.htm
Serious question Show more
Serious question Show more
Serious question Show more
Serious question Show more
Serious question Show more
Serious question Show more
@thfr @mrtino @AFresh1 hey, $[ has been discouraged since perl5 came out, became a noop in 5.16, and will become fatal in 5.30, the next release - https://metacpan.org/pod/distribution/perl/pod/perlvar.pod#$[
@mrtino actually in Star Wars 1, 2, and 3 are never found in arrays, it’s like they don’t even exist
@mrtino Arrays can start wherever?
That sounds like it would either be really useful, really frustrating, or both, based on my extremely limited knowledge of programming
@mrtino Haskell should have been in the "arrays can start wherever" group. Haskell array indexes don't even have to be numbers…
@mrtino this is absolutely perfect xD
@mrtino For those times your arrays have a Holiday Special?
@mrtino @Sir_Boops not only Perl but also Pascal, for instance
it's pretty sad I know this
@espectalll @mrtino @Sir_Boops Pascal is nice tho
@mrtino what about basic
@mrtino Technically speaking, there are no arrays in C though... 🤔
Well, the language does implement arrays, but... its in fact a pointer to a memory address in the heap... In other words, arrays in C do not start at 0, but at their specific address... Same in C++ If I recall correctly...
So... while in other languages with protected types it might start at 0 or 1, in C/C++ they would trully start at 0x1fffecd or whatever.
You can still use indexes though... but these are just multipliers.