About the Raku typing, suppose I'll write a library to deal with data
frames/tables (as PDL - Perl(5) Data Language), something like
Pandas-Python or R.
After reading the file (csv; tsv ....) I'd like that some routine
identifies the best type to fix each column (especially in cases like Unit,
unit, int, ....) what is the best strategy?

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

> >> On Mon, Jan 13, 2020 at 9:51 PM ToddAndMargo via perl6-users
> >> <perl6-us...@perl.org <mailto: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.
> >>
>
> On 2020-01-13 19:13, Paul Procacci wrote:
> >  >> 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.
>
>
> Hi Paul,
>
> For those of you who were no privy to Paul and my
> offline discussion, he must have wrote me 10
> times trying to explain things to me before
> I got it.  He is a real mensch.
>
> 30 seconds!  Yikes!  I never found it.
>
> https://docs.raku.org/type/UInt
> should have stated that directly, but did not.
>
> And to add injury,
>
> https://docs.raku.org/language/nativetypes
>      "Raku offers a set of /native/ types with a fixed,
>      and known, representation in memory"
>
> Did not state who they were.  Sort of like when I
> want the  salt, I always reach for the pepper!
>
> The state of the documentation drives me  ...
>
> <Editorial comment> AAAAAAHHHHHH!!!!! </editorial comment>
>
> -T
>


-- 
Aureliano Guedes
skype: aureliano.guedes
contato:  (11) 94292-6110
whatsapp +5511942926110

Reply via email to