XS Constants peculiarity

Abigail abigail at abigail.be
Thu Oct 28 13:35:59 BST 2010

On Thu, Oct 28, 2010 at 11:03:14AM +0100, Dirk Koopman wrote:
> A few years ago I put together an XS interface to an internal program  
> writing system that a company I work for occasionally uses.
> The constants are standard ones that XS generates (i.e. integers) and
>  perl -e 'use FF;  printf "0x%x\n", $_ for (LOCK, RK, RK | LOCK, RK +  
> LOCK)'
> yields:
> 0x100000
> 0x4
> 0x100004
> 0x4
> Why would RK + LOCK give a different result to RK | LOCK?

My guess, RK is seen as a function taking a list, making RK + LOCK to be
equivalent to RK(+LOCK).

Make sure RK is declared to not take arguments (empty prototype).


More information about the london.pm mailing list