multidimensional array,
other than by looking at the size of the first row and column, with
@m[0;*].elems and @m[*;0].elems.
Am I missing something in the docs?
If it's a shaped multidimensional array, you can call the .shape method
my @a[3;3;3];
dd @a.shape; # (3,3,3)
If it i
t;> > On 5 Feb 2021, at 15:49, Theo van den Heuvel wrote:
>> > I cannot seem to find an idiomatic way to get the dimensions of a
>> > multidimensional array,
>> > other than by looking at the size of the first row and column, with
>> > @m[0;*].elems and @m[*;0].elems.
>
When will we have p6’s Numpy?
On Sat, Feb 6, 2021, at 2:04 AM, Brad Gilbert wrote:
> There is a reason that you can't just ask for the dimensions of an
> unspecified multidimensional array.
> It may be multiple dimensions.
>
> [[1,2,3],
> [4,5,6,7,8,9,10]].
There is a reason that you can't just ask for the dimensions of an
unspecified multidimensional array.
It may be multiple dimensions.
[[1,2,3],
[4,5,6,7,8,9,10]].shape
If it gave a result it would be something like:
(2,3|7)
On Fri, Feb 5, 2021 at 8:50 AM Theo van den Heuvel
t;> wrote:
> I cannot seem to find an idiomatic way to get the dimensions of
a multidimensional array,
> other than by looking at the size of the first row and column,
with @m[0;*].elems and @m[*;0].elems.
> Am I missing something in the docs?
If it's a shaped
o list
-y
On Fri, Feb 5, 2021 at 10:06 AM Elizabeth Mattijsen wrote:
> > On 5 Feb 2021, at 15:49, Theo van den Heuvel
> wrote:
> > I cannot seem to find an idiomatic way to get the dimensions of a
> multidimensional array,
> > other than by looking at the size of the
> On 5 Feb 2021, at 15:49, Theo van den Heuvel wrote:
> I cannot seem to find an idiomatic way to get the dimensions of a
> multidimensional array,
> other than by looking at the size of the first row and column, with
> @m[0;*].elems and @m[*;0].elems.
> Am I missing somethin
Hi gurus,
I cannot seem to find an idiomatic way to get the dimensions of a
multidimensional array,
other than by looking at the size of the first row and column, with
@m[0;*].elems and @m[*;0].elems.
Am I missing something in the docs?
Thanks,
--
Theo van den Heuvel
Fixed with https://github.com/rakudo/rakudo/commit/13f6b63455
I'm closing this ticket as 'resolved'.
As a follow-up: The following code works as expected:
$ perl6-j -e 'my @a; @a[0;1] = "foo"; @a[0;0] = "bar"; say @a.perl'
[["bar", "foo"],]
# New Ticket Created by Christian Bartolomaeus
# Please include the string: [perl #128341]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=128341 >
The following code started to fail on rakudo-j with Rakudo commit 069b789af5:
# New Ticket Created by
# Please include the string: [perl #126979]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=126979 >
Hi
This statement causes an infinite loop in REPL
my @a[;];
This is Rakudo version 2015.11-
Larry Wall larry-at-wall.org |Perl 6| wrote:
On Tue, Jun 02, 2009 at 08:21:29AM -0700, yary wrote:
: I do see a problem if there's more than one unspecified dimension.
: Though I suppose an array of shape(*;*) as an lvalue might be a
: constraint allowing assignment only of another 2D array?
I d
I haven't gotten deep into the shape/array specs and I need to... nonetheless
On Tue, Jun 2, 2009 at 9:55 AM, Larry Wall wrote:
> I don't see why we shouldn't use the capture shape of the value
> by default all the time, and do linear reshaping only if the value
> comes in as a flat list.
This h
On Tue, Jun 02, 2009 at 08:21:29AM -0700, yary wrote:
: I do see a problem if there's more than one unspecified dimension.
: Though I suppose an array of shape(*;*) as an lvalue might be a
: constraint allowing assignment only of another 2D array?
I don't see why we shouldn't use the capture shape
On Mon, Jun 1, 2009 at 10:43 PM, John M. Dlugosz > And it should be an
error if dimensions other than the highest are
> unspecified. How can it know how to shape it? Use an explicit command to
> shape up the argument in that case.
I don't see why shape(2;*) is not a problem and shape(*;2) is a
p
Larry Wall larry-at-wall.org |Perl 6| wrote:
On Mon, Jun 01, 2009 at 08:23:41PM -0700, yary wrote:
: How does one create an anonymous multidimensional array in p6? Not an
: array of arrays or a capture of captures...
But I would expect a shaped array to be able to coerce either of
those into
On Mon, Jun 01, 2009 at 08:23:41PM -0700, yary wrote:
: How does one create an anonymous multidimensional array in p6? Not an
: array of arrays or a capture of captures...
But I would expect a shaped array to be able to coerce either of
those into its internal format. And coercing captures into
How does one create an anonymous multidimensional array in p6? Not an
array of arrays or a capture of captures... I'm guessing it involves
Array.new(:shape) or something like :shape(2;2), and
that it's not yet implemented in Rakudo.
Is anonymous multidimensional array creation cove
On Tue, Mar 15, 2005 at 02:22:13AM -0600, Rod Adams wrote:
:
: my int @a is shape(Int ; Int) = (1..10 ; 2..100 :by(2) ; 4);
:
: $x = pop @a
: push @a, $x;
: @b = sort @a;
: # etc
:
: I see two views to take with these cases.
:
: 1) flatten the array to one dimension, and act accordingly.
:
: o
my int @a is shape(Int ; Int) = (1..10 ; 2..100 :by(2) ; 4);
$x = pop @a
push @a, $x;
@b = sort @a;
# etc
I see two views to take with these cases.
1) flatten the array to one dimension, and act accordingly.
or
2) assume
my int @a is shape(Int ; Int);
my @a is Array of Array of int;
Mean exactly
l == 2 in first position and
pos->next.upper_init_val == 3
I've been thinking about this and i dont think its the best way to
store init values .. i am currently thinking of creating a
seperate POS at begining of the PMC Buffer that needs to be
al
At 9:45 PM +0100 7/2/02, Nicholas Clark wrote:
>On Thu, Jun 27, 2002 at 05:42:10PM +0200, Josef Höök wrote:
>> I've been thinking abit on howto implement multidimensional arrays and
>> i found that its quite tricky :). I'm currently thinking of having
>> a structure that contains a data pointer
On Thu, Jun 27, 2002 at 05:42:10PM +0200, Josef Höök wrote:
> I've been thinking abit on howto implement multidimensional arrays and
> i found that its quite tricky :). I'm currently thinking of having
> a structure that contains a data pointer and its location in every
> dimension something like
At 5:42 PM +0200 6/27/02, =?latin1?Q?Josef_H=F6=F6k?= wrote:
>I've been thinking abit on howto implement multidimensional arrays
>and
>i found that its quite tricky :). I'm currently thinking of
>having
>a structure that contains a data pointer and its location in every
>di
I've been thinking abit on howto implement multidimensional arrays and
i found that its quite tricky :). I'm currently thinking of having
a structure that contains a data pointer and its location in every
dimension something like this:
Bart Lateur wrote:
>
> >The problem is that
> >
> > $name = "myarray";
> > @$name = (1,2,3);
> > print @$name[0,1]; # 1,2
> >
> >Is very consistent currently. Change one and you have to change the
> >precedence and parsing of all symbolic refs.
>
> You are suggesting to keep a weird prece
On Mon, 25 Sep 2000 19:26:38 -0700, Nathan Wiger wrote:
>> I agree with both of you. It would be nice if @$ precedence worked as Bart
>> specified, but I still think that arrays should be arrays.
>
>The problem is that
>
> $name = "myarray";
> @$name = (1,2,3);
> print @$name[0,1]; # 1,2
>
> I agree with both of you. It would be nice if @$ precedence worked as Bart
> specified, but I still think that arrays should be arrays.
The problem is that
$name = "myarray";
@$name = (1,2,3);
print @$name[0,1]; # 1,2
Is very consistent currently. Change one and you have to change t
Buddha Buck wrote:
> The main problem I see are these:
>
> @array = ([1,2],[3,4]); # 2-dimensional array, using LOL syntax
> print $array[[1,1]]; # prints 4, OK
> print $array[1]; # prints ?
> print $array[[1,1,1]]; # prints ?
> print $array[[1]]; # prints ?
>
> Ac
inds of behavious, depending on the contents
> of a variable, as we have with symbolic references versus anonymous
> arrays/hashes.
>
> What will this return?
>
> $ary[$index]
>
> It looks like a plain and simple array item, but what if $index is an
> array ref?
On Fri, 22 Sep 2000 08:58:10 +1100, Jeremy Howard wrote:
>Bart Lateur wrote:
>> Hmm... the problem is, I think, that array references and ordinary
>> scalars are both scalars.
>>
>That's true, but they're scalars with different interfaces. In particular,
>an array ref can be dereferenced and prov
Bart Lateur wrote:
> Hmm... the problem is, I think, that array references and ordinary
> scalars are both scalars.
>
That's true, but they're scalars with different interfaces. In particular,
an array ref can be dereferenced and provides an array in doing so. If an
index can do this, then it's a
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Arrays: Overview of multidimensional array RFCs (RFC 203 through RFC 207)
=head1 VERSION
Maintainer: Jeremy Howard <[EMAIL PROTECTED]>
Date: 8 Sep 2000
Last Modified: 21 Sep 2000
Mailin
On 20 Sep 2000 04:06:02 -, Perl6 RFC Librarian wrote:
>Ilya Zakharevich brought up the issue of a potential problem with
>objects which use blessed list references as their internal structure,
>and their use as indices. Given a Bignum class, which stores its
>(external) value internally as a
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Arrays: Use list reference for multidimensional array access
=head1 VERSION
Maintainer: Buddha Buck <[EMAIL PROTECTED]>
Date: 8 Sep 2000
Last Modified: 19 Sep 2000
Mailing List:
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Array: Use list reference for multidimensional array access
=head1 VERSION
Maintainer: Buddha Buck <[EMAIL PROTECTED]>
Date: 8 September 2000
Mailing List: [EMAIL PROTECTED]
Number: 204
V
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Arrays: Overview of multidimensional array RFCs (RFC 203 through RFC 207)
=head1 VERSION
Maintainer: Jeremy Howard <[EMAIL PROTECTED]>
Date: 8 September 2000
Mailing List: [EMAIL PROTECTED]
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Arrays: Overview of multidimensional array RFCs (RFC 203 through RFC 207)
=head1 VERSION
Maintainer: Jeremy Howard <[EMAIL PROTECTED]>
Date: 8 September 2000
Mailing List: [EMAIL PROTECTED]
39 matches
Mail list logo