CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=43200
server: Combust/Plack (Perl)
vary: Accept-Encoding
content-encoding: gzip
content-length: 1984
content-type: text/html; charset=utf-8
last-modified: Mon, 13 Oct 2025 03:23:43 GMT
date: Mon, 13 Oct 2025 03:23:43 GMT
strict-transport-security: max-age=15768000
Re: Proposal: Make @a and @@a different variables - nntp.perl.org
Front page | perl.perl6.language |
Postings from December 2008
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About

Re: Proposal: Make @a and @@a different variables
Thread PreviousFrom:
TSaDate:
December 17, 2008 09:10Subject:
Re: Proposal: Make @a and @@a different variablesMessage ID:
49493275.4040108@vts-systems.deHaloO, Daniel Ruoso wrote: > The number of "summands" might be also unknown. i.e.: map. > > when you have > > my @a <== map { ... } <== something() > > you can't really know how many elements you have in the first > dimension... Hmm, I thought that all lists know their length, and if not they advertise Inf. This length information would flow out of something() through map before it executes and into @a. That is, the length is part of the lazy list before it is iterated. >> In any case the flat view @a has to step at most the first iterator in >> the array > > I'm not sure I see what you mean, but I presume you mean "the first > iteration". I meant the first infinite iteration. That is, flattened lists can't see past infinities. >> Since one could also go with a shaped @a I think the choice of @@a >> versus @a is a bit like the choice between a @a and an anonymous array >> in a $ var ala $a = [] which can be handled through $a almost like @a. > > I'm not sure I understood that, but I think you're saying that slice > context could be seen just as a regular context, as scalar and list > context, which is something that I agree. I'm not looking at it from the context POV, but from the type based dispatch POV. The thing I wanted to say is that you can also have a multi-dimensional array in a variable with a single @ sigil or in a scalar variable. The type of the content of the variable decides if a multi-slice succeeds. Correct me if I'm wrong, but isn't context just type information derived from the syntactic structure of the source code? Regards, TSa. -- "The unavoidable price of reliability is simplicity" -- C.A.R. Hoare "Simplicity does not precede complexity, but follows it." -- A.J. Perlis 1 + 2 + 3 + 4 + ... = -1/12 -- Srinivasa RamanujanThread Previous
- Proposal: Make @a and @@a different variables by Daniel Ruoso
- Re: Proposal: Make @a and @@a different variables by Larry Wall
- Re: Proposal: Make @a and @@a different variables by TSa
- Re: Proposal: Make @a and @@a different variables by Moritz Lenz
- Re: Proposal: Make @a and @@a different variables by Daniel Ruoso
- Re: Proposal: Make @a and @@a different variables by TSa
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About