Re: how to write literals of some Perl 6 types?

2008-12-07 Thread Moritz Lenz
Dave Whipp wrote: > Carl Mäsak wrote: >> Paul (>): >>> I can't find anything in the existing synopses about Blobs. >>> Probably looking in the wrong place, sorry. >> >> > > Re-reading that, a slightly tangent (though still on topic, I hope) > thought

Re: how to write literals of some Perl 6 types?

2008-12-06 Thread Dave Whipp
Carl Mäsak wrote: Paul (>): I can't find anything in the existing synopses about Blobs. Probably looking in the wrong place, sorry. Re-reading that, a slightly tangent (though still on topic, I hope) thought come to mind. The definition of the M

Re: how to write literals of some Perl 6 types?

2008-12-05 Thread Carl Mäsak
Paul (>): > I can't find anything in the existing synopses about Blobs. > Probably looking in the wrong place, sorry. // Carl

Re: how to write literals of some Perl 6 types?

2008-12-05 Thread Paul Hodges
zis <[EMAIL PROTECTED]> wrote: > From: Aristotle Pagaltzis <[EMAIL PROTECTED]> > Subject: Re: how to write literals of some Perl 6 types? > To: perl6-language@perl.org > Date: Friday, December 5, 2008, 7:42 AM > * TSa <[EMAIL PROTECTED]> [2008-12-03 09:30]: > >

Equality of values and types (was Re: how to write literals of some Perl 6 types?)

2008-12-05 Thread David Green
On 2008-Dec-4, at 4:41 pm, Leon Timmermans wrote: On Thu, Dec 4, 2008 at 6:34 PM, TSa <[EMAIL PROTECTED]> wrote: And how about 'Num 1.0 === Complex(1,0) === Int 1'? IMHO the spec on === is quite clear: "two values are never equivalent unless they are of exactly the same type." I guess the

Re: how to write literals of some Perl 6 types?

2008-12-05 Thread Aristotle Pagaltzis
* TSa <[EMAIL PROTECTED]> [2008-12-03 09:30]: > And I want to pose the question if we really need two types > Bool and Bit. I think so. Binary OR and logical OR are different beasts. As Duncan said, the real question is what’s the point of having Bit when we also have both Int and Blob. I think n

Re: Re: how to write literals of some Perl 6 types?

2008-12-05 Thread Mark J. Reed
On Fri, Dec 5, 2008 at 1:19 AM, <[EMAIL PROTECTED]> wrote: >> There are; As long as the short name is unambiguous, it can be used. >> >> >> > > What doe *short* name mean? Bool::T or True? It means "True". In this case "short" means "unqualified" - strip off the package name (leading stuff befor

Re: Re: how to write literals of some Perl 6 types?

2008-12-05 Thread xyf . xiao
> Please forgive my ignorance; but are there any cases where > 'Bool::True' can be spelled more concisely as 'True'? There are; As long as the short name is unambiguous, it can be used. What doe *short* name mean? Bool::T or True?

Re: how to write literals of some Perl 6 types?

2008-12-04 Thread Leon Timmermans
On Thu, Dec 4, 2008 at 6:34 PM, TSa <[EMAIL PROTECTED]> wrote: > HaloO, > > And how about 'Num 1.0 === Complex(1,0) === Int 1'? Should all these > be identical irrespective the fact that they come from three different > type domains? How is that implemented? > IMHO the spec on === is quite clear:

Re: how to write literals of some Perl 6 types?

2008-12-04 Thread TSa
HaloO, David Green wrote: Using int8 vs Int is presumably a performance issue, but "int8 29" and "Int 29" *mean* the same thing, so they should be ===. An Enum doesn't mean the same thing as a plain Int, so it shouldn't. And how about 'Num 1.0 === Complex(1,0) === Int 1'? Should all these be

Re: how to write literals of some Perl 6 types?

2008-12-04 Thread TSa
HaloO, David Green wrote: Using int8 vs Int is presumably a performance issue, but "int8 29" and "Int 29" *mean* the same thing, so they should be ===. An Enum doesn't mean the same thing as a plain Int, so it shouldn't. IIRC, === is defined to compare only values from the same type domain.

Re: how to write literals of some Perl 6 types?

2008-12-04 Thread Moritz Lenz
Jon Lang wrote: > Darren Duncan wrote: >> Now, with some basic types, I know how to do it, examples: >> >> Bool # Bool::True > > Please forgive my ignorance; but are there any cases where > 'Bool::True' can be spelled more concisely as 'True'? There are; As long as the short name is unambig

Re: how to write literals of some Perl 6 types?

2008-12-03 Thread Darren Duncan
TSa wrote: Darren Duncan wrote: Strong typing in Perl means that Perl is conveniently and reliably keeping track of this user-intended interpretation of the data, so it is easy for any piece of code to act on it in a reasonable way. Strong typing lets user code be clean and understandable as

Re: how to write literals of some Perl 6 types?

2008-12-03 Thread Patrick R. Michaud
On Wed, Dec 03, 2008 at 02:50:23PM -0800, Jon Lang wrote: > Darren Duncan wrote: > > Now, with some basic types, I know how to do it, examples: > > > > Bool # Bool::True > > Please forgive my ignorance; but are there any cases where > 'Bool::True' can be spelled more concisely as 'True'? Oth

Re: how to write literals of some Perl 6 types?

2008-12-03 Thread Jon Lang
Darren Duncan wrote: > Now, with some basic types, I know how to do it, examples: > > Bool # Bool::True Please forgive my ignorance; but are there any cases where 'Bool::True' can be spelled more concisely as 'True'? Otherwise, this approach seems awfully cluttered. -- Jonathan "Dataweaver

Re: how to write literals of some Perl 6 types?

2008-12-03 Thread David Green
On 2008-Dec-3, at 10:18 am, TSa wrote: Darren Duncan wrote: Strong typing in Perl means that Perl is conveniently and reliably keeping track of this user-intended interpretation of the data, so it is easy for any piece of code to act on it in a reasonable way. Strong typing lets user code

Re: how to write literals of some Perl 6 types?

2008-12-03 Thread TSa
HaloO, Darren Duncan wrote: Strong typing in Perl means that Perl is conveniently and reliably keeping track of this user-intended interpretation of the data, so it is easy for any piece of code to act on it in a reasonable way. Strong typing lets user code be clean and understandable as it d

Re: how to write literals of some Perl 6 types?

2008-12-03 Thread Darren Duncan
TSa wrote: Here we could get away with defining two new enums, e.g. Bit::High and Bit::Low. I like that approach. Go the same way as Bool and Order value literals. Don't know why I didn't think of it before. And I want to pose the question if we really need two types Bool and Bit. I wa

Re: how to write literals of some Perl 6 types?

2008-12-03 Thread TSa
HaloO, [EMAIL PROTECTED] wrote: The literals for Bit are just 0 and 1. I doubt that this works. I assume that there are integer calculations that give the result 1 as an Int. Then comparing these with === to the literal 1 should fail because the types mismatch: my Int $x = 7 - 6; # $x.WHAT

Re: how to write literals of some Perl 6 types?

2008-12-03 Thread TSa
HaloO, Darren Duncan wrote: But some significant ones I don't know and really want to know: Bit Here we could get away with defining two new enums, e.g. Bit::High and Bit::Low. And I want to pose the question if we really need two types Bool and Bit. Blob Set Bag Mapping [.

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Geoffrey Broadwell
On Tue, 2008-12-02 at 21:21 +0100, Leon Timmermans wrote: > If you really want it, a macro can fix all of this for you. > That's the beauty of macros: these kinds of things are possible if you > need them. Sure, but user-written macros are also an easy out that allows one to avoid making hard deci

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Geoffrey Broadwell
On Tue, 2008-12-02 at 13:07 -0700, David Green wrote: > On 2008-Dec-2, at 12:33 pm, Geoffrey Broadwell wrote: > > On Tue, 2008-12-02 at 08:50 +0100, Carl Mäsak wrote: > >> Darren (>): > >>> How does one write anonymous value literals of those types? > >> Why is the latter method [conversion] insuff

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Darren Duncan
Daniel Ruoso wrote: Em Seg, 2008-12-01 às 18:21 -0800, Darren Duncan escreveu: I'm wondering how to write anonymous value literals of some Perl 6 basic types, and I didn't see mention of this in synopsis 2. Getting away from your question entirely, I think the issue here is that while Perl 6 h

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread David Green
On 2008-Dec-2, at 12:33 pm, Geoffrey Broadwell wrote: On Tue, 2008-12-02 at 08:50 +0100, Carl Mäsak wrote: Darren (>): How does one write anonymous value literals of those types? Why is the latter method [conversion] insufficient for your needs? Efficiency reasons, among others. Surely the

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Geoffrey Broadwell
On Tue, 2008-12-02 at 08:50 +0100, Carl Mäsak wrote: > Darren (>): > > Bit > > Blob > > Set > > Bag > > Mapping > > > > How does one write anonymous value literals of those types? And I mean > > directly, not by writing a literal of some other type and using a conversion > > function to deriv

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Daniel Ruoso
Em Seg, 2008-12-01 às 18:21 -0800, Darren Duncan escreveu: > I'm wondering how to write anonymous value literals of some Perl 6 basic > types, > and I didn't see mention of this in synopsis 2. Getting away from your question entirely, I think the issue here is that while Perl 6 has support for s

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Carl Mäsak
Darren Duncan (>): > Regarding Blob, that's not a collection type and its a fundamental type and > it still needs special syntax; I did suggest one in my previous message. Frankly, I don't see why it should need special syntax. Blobs are, most of the time, not typed in through the keyboard (too mu

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread mark . a . biggar
The literals for Bit are just 0 and 1. -- Mark Biggar [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] -- Original message -- From: "Carl Mäsak" <[EMAIL PROTECTED]> > Darren (>): > > Bit > > Blob > > Set > > Bag > > Mapping > > > > How does one write ano

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Moritz Lenz
Darren Duncan wrote: > Hello, > > I'm wondering how to write anonymous value literals of some Perl 6 basic > types, > and I didn't see mention of this in synopsis 2. > > Now, with some basic types, I know how to do it, examples: > >Bool # Bool::True >Int # 42 or 0x17 or :12 >

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Darren Duncan
Moritz Lenz wrote: Darren Duncan wrote: But some significant ones I don't know and really want to know: Bit Blob Set Bag Mapping I guess that Mapping is analog to the List/Seq case: :a(2), :a; Sure, but given how Pair literals work, how would you know whether the above (i

Re: how to write literals of some Perl 6 types?

2008-12-02 Thread Darren Duncan
Carl Mäsak wrote: Darren (>): Bit Blob Set Bag Mapping How does one write anonymous value literals of those types? And I mean directly, not by writing a literal of some other type and using a conversion function to derive the above? Why is the latter method insufficient for your needs?

Re: how to write literals of some Perl 6 types?

2008-12-01 Thread Carl Mäsak
Darren (>): > Bit > Blob > Set > Bag > Mapping > > How does one write anonymous value literals of those types? And I mean > directly, not by writing a literal of some other type and using a conversion > function to derive the above? Why is the latter method insufficient for your needs? // C

how to write literals of some Perl 6 types?

2008-12-01 Thread Darren Duncan
Hello, I'm wondering how to write anonymous value literals of some Perl 6 basic types, and I didn't see mention of this in synopsis 2. Now, with some basic types, I know how to do it, examples: Bool # Bool::True Int # 42 or 0x17 or :12 Rat|Num # 18.2 or :8<53.07> or 4/3 Str