The problem is that '1 bitand' is transformed into '>fixnum 1
fixnum-bitand' by the compiler. To fix this properly, we would need a
new integer>fixnum word which behaves like >fixnum but only accepts
fixnums and bignums as input. Then compiler optimizations could emit
this word instead of >fixnum in situations like this one.

Slava

On Tue, Mar 29, 2011 at 3:54 AM, Samuel Tardieu <[email protected]> wrote:
> This behaviour has been noticed indirectly by John Benediktsson who told me
> that "3.5 next-prime" was causing an "out of memory" error.
> On Linux/64 bits:
> ( scratchpad ) 3.5 1 bitand 1 number=
> No suitable arithmetic method
> left    3.5
> right   1.0
> generic bitand
> Type :help for debugging help.
> ( scratchpad ) \ odd? see
> IN: math
> : odd? ( n -- ? ) 1 bitand 1 number= ; inline
> ( scratchpad ) 3.5 odd?
> --- Data stack:
> t
> ( scratchpad ) 3.5 next-odd
> Out of memory
> Why is odd? accepting a non-integer argument while it should raise an
> exception?
>   Sam
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to