Conversation
Notices
-
Machismo (zerglingman@freespeechextremist.com)'s status on Wednesday, 17-Jan-2024 21:17:42 JST Machismo @MK2boogaloo @Suiseiseki @anonymous https://thelo.ca/php.txt -
menherahair (menherahair@eientei.org)'s status on Wednesday, 17-Jan-2024 21:48:21 JST menherahair @Zerglingman @Suiseiseki @anonymous @MK2boogaloo
>mt_rand - Generate a better random value.
...what did they use before mt?Machismo repeated this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Wednesday, 17-Jan-2024 21:48:44 JST Machismo @menherahair @anonymous @Suiseiseki @MK2boogaloo All this time they've been generating old and inferior. -
menherahair (menherahair@eientei.org)'s status on Wednesday, 17-Jan-2024 21:56:48 JST menherahair @Zerglingman @Suiseiseki @anonymous @MK2boogaloo IT WAS TIME WASN'T IT -
Yukkuri (iamtakingiteasy@eientei.org)'s status on Wednesday, 17-Jan-2024 22:39:56 JST Yukkuri @menherahair @Zerglingman @MK2boogaloo @Suiseiseki @anonymous -
menherahair (menherahair@eientei.org)'s status on Wednesday, 17-Jan-2024 22:41:21 JST menherahair @Zerglingman @Suiseiseki @anonymous @MK2boogaloo
> "$a && $b || $c" is not the same as "$a AND $b || $c". They are respectively equivalent to "(a and b) or c" and "a and (b or c)". Because || has a higher precedence than AND, but lower than &&.
this isn't that weird, in fact it's smart if it's implemented like in perl
&& and || have very high precedence, you use them for short-circuits
`and` and `or` have very low precedence, you use them for control flow
so you may write stuff like this:
`$x += $pizza || die # dies if $pizza is 0`
`$x += $pizza or die # dies if $x+$pizza is 0`
additionally operators force scalar context, and while every perlistani loves contexts, they may be tricky to weave, at which point precendence comes in handy. from perlop:
`@info = stat($file) || die; # oops, scalar sense of stat!`
`@info = stat($file) or die; # better, now @info gets its due`Machismo likes this.
-