lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 07/10/2014 04:05 AM, Coroutines wrote:
> On Wed, Jul 9, 2014 at 5:03 PM, Paige DePol <lual@serfnet.org> wrote:
>
>> What other strange operators have been spotted in the wild?
> The spaceship operator is my favorite ("<=>"):
> https://en.wikipedia.org/wiki/Spaceship_operator
>
How about the goatse operator, ''=()='', which forces RHS into an array
context?

Example usage:

    $a = "hello world" =~ /l/g; # $a gets 1 (or undef if the pattern
wouldn't have matched)

    $a =()= "hello world" =~ /l/g; # $a gets 3, the amount of times the
pattern matched