John Macdonald [EMAIL PROTECTED] writes:
If a int1 (or int2 or nybble or other sub-addressable sized value)
is being referred to, a similar issue arises since most machines
these days have byte addressing, but do not have bit addressing. If
you can't refer directly to it, the value will have
--- Jonadab the Unsightly One [EMAIL PROTECTED] wrote:
I surely must be misunderstanding what you're saying... the way I
read that, you're suggesting that it will matter to Perl -- not only
to the compiler but even to user code -- how the underlying hardware
addresses its memory. I really
Aaron Sherman [EMAIL PROTECTED] writes:
It took us some time discussing this... we weren't sure what tense
you were using. At first we thought it might be the past subjective,
but after a while, we decided to coin a new tense: the vapor tense. ;-)
Actually, it's not new at all; there's
Larry Wall [EMAIL PROTECTED] writes:
int1, int2, int4, int8, int16, int32, int64, uint1, uint2, uint4,
uint8, uint16, uint32, uint64, num32, num64, num128, complex32,
complex64, complex128, ...
Well, all that is harmless enough, as long as I don't ever have the
misfortune to inherit
On Thu, 2 Sep 2004, Larry Wall wrote:
To declare a multidimensional array, you add a shape parameter:
my num @nums is shape(3); # one dimension, @nums[0..2]
my int @ints is shape(4;2); # two dimensions, @ints[0..3; 0..1]
Just a random thought, and probably a minor point: I know
Michele Dondi wrote:
On Thu, 2 Sep 2004, Larry Wall wrote:
To declare a multidimensional array, you add a shape parameter:
my num @nums is shape(3); # one dimension, @nums[0..2]
my int @ints is shape(4;2); # two dimensions, @ints[0..3; 0..1]
Just a random thought, and probably a minor
On Thu, Sep 09, 2004 at 03:09:47PM +0200, Michele Dondi wrote:
On Thu, 2 Sep 2004, Larry Wall wrote:
And yes, an Cint1 can store only -1 or 0. I'm sure someone'll think of
a use for it...
Probably OT, but I've needed something like that badly today: working on
a japh that turned out to
John Macdonald writes:
As an array index -1 and 0 give you the 2 ends. The perl5
code to alternately extract elements from the two eds of an
array can be something like:
my $end = 0; # -1 to start with right end
while( @array ) {
my $next = splice( @array, $end, 1 );
Michele Dondi writes:
On Thu, 2 Sep 2004, Larry Wall wrote:
To declare a multidimensional array, you add a shape parameter:
my num @nums is shape(3); # one dimension, @nums[0..2]
my int @ints is shape(4;2); # two dimensions, @ints[0..3; 0..1]
Just a random thought, and
On Fri, 2004-09-03 at 20:08, Larry Wall wrote:
Arrays with explicit ranges don't use the
minus notation to count from the end. We probably need to come up
with some other notation for the beginning and end indexes. But it'd
be nice if that were a little shorter than:
On Tue, Sep 07, 2004 at 10:34:33PM -0400, John Macdonald wrote:
: If a int1 (or int2 or nybble or other sub-addressable sized
: value) is being referred to, a similar issue arises since most
: machines these days have byte addressing, but do not have bit
: addressing. If you can't refer directly
Larry Wall [EMAIL PROTECTED] wrote:
On Sat, Sep 04, 2004 at 09:47:29AM +0200, Leopold Toetsch wrote:
: Honestly I don't see the point why all normal array usage should be
: slowed down just for the sake of some rare usage patterns.
Does it have to? Couldn't it have a different vtable? (Which
On Mon, Sep 06, 2004 at 10:13:56AM +0200, Leopold Toetsch wrote:
: A different vtable implies some kind of a derived class. The question
: is, if an of shape or is shape already causes a new class of
: arrayish objects.
: The question probably is: how much of this class code is done directly
: by
On Sat, Sep 04, 2004 at 09:47:29AM +0200, Leopold Toetsch wrote:
: Honestly I don't see the point why all normal array usage should be
: slowed down just for the sake of some rare usage patterns.
Another possibility is that .[] always forces the normal view of an
array as 0-based, and if you want
On Thu, 2004-09-02 at 19:47, Larry Wall wrote:
This synopsis summarizes the non-existent Apocalypse 9, which
discussed in detail the design of Perl 6 data structures. It was
primarily a discussion of how the existing features of Perl 6 combine
to make it easier for the PDL folks to write
Larry Wall skribis 2004-09-03 17:08 (-0700):
The element with index -1. Arrays with explicit ranges don't use the
minus notation to count from the end. We probably need to come up
with some other notation for the beginning and end indexes.
@array.abs[0];
@array.abs[-1];
.abs would
John Williams skribis 2004-09-03 23:06 (-0600):
(A and Z)
I think I'd prefer alpha and omega.
Why not use Cyrillic or Korean or the secret code alphabet we used in
school?
I don't like using letters for array indexes, but if they're used,
please keep it ascii :)
Juerd
John Williams [EMAIL PROTECTED] wrote:
What happens when the Pascal programmer declares
my int @ints is shape(-10..10);
Should that really all be in core? Why not let the user create his own
derived array that does what she wants?
Honestly I don't see the point why all normal array usage
Larry Wall [EMAIL PROTECTED] wrote:
On Fri, Sep 03, 2004 at 11:41:05AM +0100, Tim Bunce wrote:
: (I'm not (yet) familiar with Parrot's ManagedStruct and UnManagedStruct
: types but there's probably valuable experience there.)
Quite likely.
Well, *ManagedStruct is already working pretty well.
Larry Wall [EMAIL PROTECTED] writes:
On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote:
: What happens when the Pascal programmer declares
:
: my int @ints is shape(-10..10);
:
: Does it blow up?
No.
: If not, does @ints[-1] mean the element with index -1 or the
At Fri, 3 Sep 2004 17:08:00 -0700,
[EMAIL PROTECTED] (Larry Wall) wrote:
On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote:
: If not, does @ints[-1] mean the element with index -1 or the last element?
The element with index -1. Arrays with explicit ranges don't use the
minus
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Larry Wall) wrote:
I'm still thinking A is the first one and Z is the last one. Someone
talk me out of it quick.
Just think of all the trouble it would cause in the summaries:
'Meanwhile, in perl6-language, there was much discussion about Z.
On Sat, Sep 04, 2004 at 09:47:29AM +0200, Leopold Toetsch wrote:
: John Williams [EMAIL PROTECTED] wrote:
:
: What happens when the Pascal programmer declares
:
: my int @ints is shape(-10..10);
:
: Should that really all be in core? Why not let the user create his own
: derived array
On Sat, Sep 04, 2004 at 08:30:27AM -0600, David Green wrote:
: I actually found things I liked in pretty much all the suggested
: alternatives, but none of them reached out and grabbed me by the throat
: the way nth did. It just seems more Perlish.
Yow. Presumably nth without an argument
On Fri, 3 Sep 2004 17:08:00 -0700, [EMAIL PROTECTED] (Larry Wall) wrote:
On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote:
: On Thu, 2 Sep 2004, Larry Wall wrote:
:
: The argument to a shape specification is a semicolon list, just like
: the inside of a multidimensional
On Sat, 4 Sep 2004, David Green wrote:
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Larry Wall) wrote:
I'm still thinking A is the first one and Z is the last one. Someone
talk me out of it quick.
The actual issue is how to distinguish cardinal numbers from ordinals,
right? So if we
: On Sat, Sep 04, 2004 at 09:47:29AM +0200, Leopold Toetsch wrote:
: : Honestly I don't see the point why all normal array usage should be
: : slowed down just for the sake of some rare usage patterns.
On Sat, Sep 04, 2004 at 08:48:54AM -0700, Larry Wall wrote:
: Does it have to? Couldn't it
On Sat, 4 Sep 2004, Juerd wrote:
John Williams skribis 2004-09-03 23:06 (-0600):
(A and Z)
I think I'd prefer alpha and omega.
Why not use Cyrillic or Korean or the secret code alphabet we used in
school?
I meant the actual words alpha and omega, because they're like A and Z
but with
David Green writes:
The actual issue is how to distinguish cardinal numbers from ordinals,
right? So if we want ordinal numbers, why not use ordinals?
While we're here, I think perl should understand ordinals
(http://mathworld.wolfram.com/OrdinalNumber.html), too. The syntax is
quite ready
On 2004/9/04, [EMAIL PROTECTED] (Larry Wall) wrote:
Yow. Presumably nth without an argument would mean the last. So
@ints[1st..nth]
means
@ints[*]
Yeah, I was thinking something like that. And if the arg is an actual
array, maybe it returns the max dimension(s)? I think you'd get
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Luke Palmer) wrote:
sub wn($n) { $n ?? wn($n-1)+1 :: $w }
$w2 = 0... + wn«0...;
assert($w2 == $w*2);
Just think of the possibilities! :-)
Hm. Needs more Unicode. =)
Seriously though, putting 1st, 2nd, nth, etc. in the language is
David Green wrote:
It is kind of comfortable. Which is why I think I'd like to keep the
redundant nth (if we have first and last), aka 'th (where nth($i)
and $i'th are just pre- and postfixed versions of each other).
Especially important since there's a potential ambiguity problem between
On Thu, Sep 02, 2004 at 04:47:40PM -0700, Larry Wall wrote:
=head1 Compact structs
A class whose attributes are all low-level types can behave as
a struct.
all low-level types or all low-level *sized* types?
(I'm wondering about char arrays, string and pointers.)
I presume a char[n] array
On Fri, 3 Sep 2004 11:41:05 +0100, Tim Bunce [EMAIL PROTECTED] wrote:
Is there some syntax to express if the struct is packed or
needs alignment? (Perhaps that would be needed per element.)
Why am I suddenly thinking about unions ?
On Thu, Sep 02, 2004 at 04:47:40PM -0700, Larry Wall wrote:
my ref[Array] @ragged2d;
What is a ref type exactly? Is it like a pointer in C? If so, and
based on the parameterization above, I assume that there will also be
the appropriate pointer arithmetic such that if $fido is declared as a
Jonathan Scott Duff wrote:
Maybe it's just my BASIC upbringing, but shape doesn't seem like the
right word. Words like dimension and cardinal fit better in my
head, but I'd want them shorter and dim and card don't quite work
either ;-)
But shape makes me want to do something like this:
my num
On Fri, Sep 03, 2004 at 10:00:24AM -0500, Jonathan Scott Duff wrote:
: On Thu, Sep 02, 2004 at 04:47:40PM -0700, Larry Wall wrote:
: my ref[Array] @ragged2d;
:
: What is a ref type exactly? Is it like a pointer in C?
It's exactly like a reference in Perl 5. Declaring a compact array of
ref
On Fri, Sep 03, 2004 at 09:29:36AM -0700, Larry Wall wrote:
: If so, and
: based on the parameterization above, I assume that there will also be
: the appropriate pointer arithmetic such that if $fido is declared as a
: ref[Dog] and pointed at an array of Dogs, then $fido++ will move to the
:
On Fri, Sep 03, 2004 at 12:25:37PM -0500, Jonathan Scott Duff wrote:
: If my int @foo makes a compact array of ints, is there a way to make a
: compact array of Dog? (Does it even make sense?) And if so, does it look
: like my Dog @foo or must there be some other syntax to declare it?
It's just
On Fri, Sep 03, 2004 at 11:41:05AM +0100, Tim Bunce wrote:
: On Thu, Sep 02, 2004 at 04:47:40PM -0700, Larry Wall wrote:
:
: =head1 Compact structs
:
: A class whose attributes are all low-level types can behave as
: a struct.
:
: all low-level types or all low-level *sized* types?
: (I'm
On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote:
: On Thu, 2 Sep 2004, Larry Wall wrote:
:
: The argument to a shape specification is a semicolon list, just like
: the inside of a multidimensional subscript. Ranges are also allowed,
: so you can pretend you're programming in
On Thu, 2 Sep 2004, Larry Wall wrote:
A multidimensional array is indexed by a semicolon list, which is really
a list of lists in disguise. Each sublist is a slice of one particular
dimension. So
@array[0..10; 42; @x]
is really short for
@array.postcircumfix:[]( == [0..10],
Larry Wall wrote:
On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote:
: What happens when the Pascal programmer declares
:
: my int @ints is shape(-10..10);
:
: Does it blow up?
No.
: If not, does @ints[-1] mean the element with index -1 or the last element?
The element with
John Williams writes:
On Thu, 2 Sep 2004, Larry Wall wrote:
A multidimensional array is indexed by a semicolon list, which is really
a list of lists in disguise. Each sublist is a slice of one particular
dimension. So
@array[0..10; 42; @x]
is really short for
Larry Wall wrote:
Arrays with explicit ranges don't use the minus notation to count from
the end. We probably need to come up with some other notation for the
beginning and end indexes. But it'd be nice if that were a little
shorter than:
@ints.shape[0].beg
@ints.shape[0].end
On Fri, Sep 03, 2004 at 07:42:53PM -0500, Rod Adams wrote:
(B: What jumps to my mind is that inside an array subscript could be
(B: (sub)?context of it's own. Then one could do:
(B:
(B: @ints[.beg .. .end ; .beg + 3 .. .end];
(B
(BAwful dotty...
(B
(B: Where the .beg and .end would
On Fri, Sep 03, 2004 at 06:31:49PM -0700, Jonathan Lang wrote:
: I wonder if this notion of contextualizing a method's signature could be
: generalized... I could see a case for treating most methods as if the
: expressions in each parameter were being evaluated within the caller's
: class:
:
:
I think we just need something really short and unconfusing for the
commonest cases,
@a[ 42 ; -1 but last ]
That reads pretty well, no?
Maybe the other end isn't quite as good:
@a[ 1 but first .. -2 but last ]
Hmm. Should -1 but last or 0 but last be the last element?
~ John Williams
On Fri, Sep 03, 2004 at 08:19:11PM -0600, John Williams wrote:
: I think we just need something really short and unconfusing for the
: commonest cases,
:
:@a[ 42 ; -1 but last ]
:
: That reads pretty well, no?
:
: Maybe the other end isn't quite as good:
:
: @a[ 1 but first .. -2 but
Larry Wall wrote:
On Fri, Sep 03, 2004 at 06:31:49PM -0700, Jonathan Lang wrote:
: I wonder if this notion of contextualizing a method's signature could
: be generalized... I could see a case for treating most methods as if
: the expressions in each parameter were being evaluated within the
Larry Wall wrote:
I'm still thinking A is the first one and Z is the last one. Someone
talk me out of it quick.
I had thought about A and Z before my previous post. I dismissed it for
two reasons:
1) Using Alphas as an index for something that should be numeric can be
very confusing.
If you insist on using A and Z, at least make them \A and \Z, to give a
stronger visual cue that something different is happening.
I think I'd prefer alpha and omega.
Or maybe turn my previous suggestion around and make first and last
special constants. Then say:
@a[ first .. last but 1 ]
=head1 Overview
This synopsis summarizes the non-existent Apocalypse 9, which
discussed in detail the design of Perl 6 data structures. It was
primarily a discussion of how the existing features of Perl 6 combine
to make it easier for the PDL folks to write numeric Perl.
=head1 Lazy lists
All
LW == Larry Wall [EMAIL PROTECTED] writes:
LW =head1 Compact structs
LW A class whose attributes are all low-level types can behave as
LW a struct. (Access from outside the class is still only through
LW accessors, though.) Whether such a class is actually stored compactly
LW is up
54 matches
Mail list logo