request new Mapping|Hash operators

2007-02-27 Thread Darren Duncan
All, I believe that there is some room for adding several new convenience operators or functions to Perl 6 that are used with Mapping and Hash values. Or getting more to the point, I believe that the need for the relational data model concept of a tuple (a tuple where elements are

Re: [S09] Whatever indices and shaped arrays

2007-02-27 Thread David Green
On 2/24/07, Jonathan Lang wrote: In effect, using * as an array of indices gives us the ordinals notation that has been requested on occasion: '*[0]' means 'first element', '*[1]' means 'second element', '*[-1]' means 'last element', '*[0..2]' means 'first three elements', and so on - and this

Re: request new Mapping|Hash operators

2007-02-27 Thread Aaron Crane
Darren Duncan writes: I believe that there is some room for adding several new convenience operators or functions to Perl 6 that are used with Mapping and Hash values. snip I also want to emphasize that I see this functionality being generally useful, and that it shouldn't just be shunted off

request: num16

2007-02-27 Thread Geoffrey Broadwell
I'd like to request that num16 and therefore complex16 be added to S09, and made optional just as num128 and complex128 are. The half-sized floating point type is commonly used in computer graphics and widely supported by GPUs and High Dynamic Range image formats such as OpenEXR. -'f

Bit shifts on low-level types

2007-02-27 Thread Geoffrey Broadwell
How are the bitwise shifts defined on low level types? In particular, for right shift, does high bit extension or zero fill occur? Does the answer depend on whether the low level type is signed or not? On the flip side, it seems more useful if we have both operators available for either signed

Rotation ops?

2007-02-27 Thread Geoffrey Broadwell
Does Perl 6 have (bit/string) rotation ops? Especially bit rotation on low-level integer types would be Nifty for making some numeric algorithms cleaner, more self documenting, and potentially faster than forcing the use of a combination of other bitwise ops to do the same thing. -'f

Low-level types and over/underflow

2007-02-27 Thread Geoffrey Broadwell
What happens when a low-level type overflows or underflows? For example, if you decrement an int1 twice, what happens? If you increment a uint8 past 255, do you get: 1. A uint8 with value 0? 2. A uint16 with value 256? 3. A failure? What about incrementing an int8 past 127? Do you get: 1.

Casting and low-level types

2007-02-27 Thread Geoffrey Broadwell
What happens when you cast between low-level types? If the source value is out of range of the destination type, do you get: 1. An exception? 2. Clip to finite range always? 3. Clip to finite range for ints, clip to infinities for nums? 4. Exception when dest is int, clip to infinities when dest

Compact structs and byte-stringification

2007-02-27 Thread Geoffrey Broadwell
How do you specify that you want to byte-stringify a compact struct, rather than normal stringify it? Does the byte-stringified version include internal and/or trailing alignment padding? How do you specify the other choices? Whether or not trailing padding is included when byte-stringifying a

Re: request new Mapping|Hash operators

2007-02-27 Thread Nicholas Clark
On Tue, Feb 27, 2007 at 12:18:20AM -0800, Darren Duncan wrote: 4. rename(): function rename of Mapping (Mapping $m, Str $old_k, Str $new_k) { ... } This operator takes one Mapping argument and derives another rename is a Perl 5 builtin. I didn't think that it had

Expressions with mixed types including low-level types

2007-02-27 Thread Geoffrey Broadwell
How is casting and coersion handled with expressions involving mixed low and high level types? For example, what is the output of this? my Int $ten = 10; my int4 $a = 0; my int4 $b; $b = ($a + 2.4 * $ten) / 4; say $b; The answers to the above questions may alter my view

Re: Expressions with mixed types including low-level types

2007-02-27 Thread Geoffrey Broadwell
On Tue, 2007-02-27 at 09:20 -0800, Geoffrey Broadwell wrote: How is casting and coersion handled with expressions involving mixed low and high level types? For example, what is the output of this? my Int $ten = 10; my int4 $a = 0; my int4 $b; $b = ($a + 2.4 * $ten)

Re: request new Mapping|Hash operators

2007-02-27 Thread Smylers
Darren Duncan writes: I believe that ... some common relational operations would be a lot easier to express if Perl 6 had a few more operators that make them concise. I am prepared to believe that. But what I'm unclear on is when I'd want to perform a common relational operation. Please

Re: Bit shifts on low-level types

2007-02-27 Thread Smylers
Geoffrey Broadwell writes: How are the bitwise shifts defined on low level types? In particular, for right shift, does high bit extension or zero fill occur? Does the answer depend on whether the low level type is signed or not? On the flip side, it seems more useful if we have both

Re: Bit shifts on low-level types

2007-02-27 Thread Nicholas Clark
On Tue, Feb 27, 2007 at 06:31:31PM +, Smylers wrote: Geoffrey Broadwell writes: How are the bitwise shifts defined on low level types? In particular, for right shift, does high bit extension or zero fill occur? Does the answer depend on whether the low level type is signed or not?

Re: Bit shifts on low-level types

2007-02-27 Thread John Macdonald
On Tue, Feb 27, 2007 at 06:31:31PM +, Smylers wrote: Geoffrey Broadwell writes: Perhaps having both + and ? operators? Since coerce to boolean and then right shift is meaningless, ... It's useless, rather than meaningless; you've neatly defined what the meaning of that (useless)

Re: [S09] Whatever indices and shaped arrays

2007-02-27 Thread Jonathan Lang
David Green wrote: On 2/24/07, Jonathan Lang wrote: In effect, using * as an array of indices gives us the ordinals notation that has been requested on occasion: '*[0]' means 'first element', '*[1]' means 'second element', '*[-1]' means 'last element', '*[0..2]' means 'first three elements', and

[svn:perl6-synopsis] r13706 - doc/trunk/design/syn

2007-02-27 Thread larry
Author: larry Date: Tue Feb 27 15:41:10 2007 New Revision: 13706 Modified: doc/trunk/design/syn/S09.pod Log: Some clarifications requested by Geoffrey Broadwell++. Modified: doc/trunk/design/syn/S09.pod == ---

Re: request new Mapping|Hash operators

2007-02-27 Thread Darren Duncan
At 4:45 PM + 2/27/07, Nicholas Clark wrote: 4. rename(): rename is a Perl 5 builtin. I didn't think that it had been dropped for Perl 6. At 6:22 PM + 2/27/07, Smylers wrote: 1. join() aka natural_join(): Remember that Perl already has a Cjoin function, for joining strings.

Re: Low-level types and over/underflow

2007-02-27 Thread Darren Duncan
At 6:15 AM -0800 2/27/07, Geoffrey Broadwell wrote: What happens when a low-level type overflows or underflows? For example, if you decrement an int1 twice, what happens? If you increment a uint8 past 255, do you get: 1. A uint8 with value 0? 2. A uint16 with value 256? 3. A failure? What

[svn:perl6-synopsis] r13707 - doc/trunk/design/syn

2007-02-27 Thread larry
Author: larry Date: Tue Feb 27 15:56:44 2007 New Revision: 13707 Modified: doc/trunk/design/syn/S03.pod Log: Modifiers on bit shifts. Modified: doc/trunk/design/syn/S03.pod == --- doc/trunk/design/syn/S03.pod

Re: Expressions with mixed types including low-level types

2007-02-27 Thread Larry Wall
On Tue, Feb 27, 2007 at 09:35:49AM -0800, Geoffrey Broadwell wrote: : On Tue, 2007-02-27 at 09:20 -0800, Geoffrey Broadwell wrote: : How is casting and coersion handled with expressions involving mixed low : and high level types? : : For example, what is the output of this? : : my Int

Re: Compact structs and byte-stringification

2007-02-27 Thread Larry Wall
On Tue, Feb 27, 2007 at 06:54:50AM -0800, Geoffrey Broadwell wrote: : How do you specify that you want to byte-stringify a compact struct, : rather than normal stringify it? Coerce to a buffer type rather than using ~. : Does the byte-stringified version include internal and/or trailing :

Re: Casting and low-level types

2007-02-27 Thread Larry Wall
On Tue, Feb 27, 2007 at 06:26:18AM -0800, Geoffrey Broadwell wrote: : What happens when you cast between low-level types? If the source value : is out of range of the destination type, do you get: : : 1. An exception? : 2. Clip to finite range always? : 3. Clip to finite range for ints, clip to

[svn:perl6-synopsis] r13708 - doc/trunk/design/syn

2007-02-27 Thread larry
Author: larry Date: Tue Feb 27 17:00:09 2007 New Revision: 13708 Modified: doc/trunk/design/syn/S03.pod Log: Better writing requested by John Macdonald++ Modified: doc/trunk/design/syn/S03.pod == ---

[svn:perl6-synopsis] r13709 - doc/trunk/design/syn

2007-02-27 Thread larry
Author: larry Date: Tue Feb 27 17:01:23 2007 New Revision: 13709 Modified: doc/trunk/design/syn/S03.pod Log: gah Modified: doc/trunk/design/syn/S03.pod == --- doc/trunk/design/syn/S03.pod(original) +++