>> trying to find the constraints explanation in the documentation:

https://docs.raku.org/language/nativetypes

"Raku offers a set of *native* types with a fixed, and known,
representation in memory"
and
"However, these types do not necessarily have the size that is required by
the NativeCall <https://docs.raku.org/language/nativecall> interface (e.g.,
Raku's int can be 8 bytes but C's int is only 4 bytes)"

Took me all of 30 seconds to find.  Obviously that page has much more
information to offer than just those couple of sentences, but ALL native
types are constrained by a certain number of bits.

On Mon, Jan 13, 2020 at 9:51 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> On 2020-01-13 18:46, ToddAndMargo via perl6-users wrote:
> > On 2020-01-13 17:13, ToddAndMargo via perl6-users wrote:
> >> And, no one is telling me percisely what the difference
> >> between UInt and uint is other than one is a subset of
> >> Int and the other is a native type.  They act exactly
> >> the same.
> >
> > Hi All,
> >
> > Off line, Paul told me what the difference is
> > between a UInt and a uint.
> >
> > uint is constrained:
> >
> >      p6 'my uint $c = 0x0; $c = $c +| 0x1FFFFFFFFFFFFFFFF;'
> >      Cannot unbox 65 bit wide bigint into native integer
> >       in block <unit> at -e line 1
> >
> > UInt uses magic Larry Wall powder to remove the constraints
> > from the variable.  (Same powder he uses to create nils.)
> >
> >      p6 'my UInt $c = 0x0; $c = $c +|
> > 0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; say $c'
> > 862718293348820473429344482784628181556388621521298319395315527974911
> >
> > Other than the constrains, they act exactly the same.
> > Oh, and they are both (generic programming term) unsigned integers
> > (cardinals)
> >
> > :-)
> >
> > -T
>
>
> And good luck, all you who told me to read the
> documentation, trying to find the constraints
> explanation in the documentation:
>
> https://docs.raku.org/type/UInt
>
> Have fun!
>
> But it does say "The UInt is defined as a subset of Int:"
> and Int is definitely constrained.
>
>
>
> -T
>


-- 
__________________

:(){ :|:& };:

Reply via email to