--
On Thu, 13 Feb 2003 16:03:41
Joseph F. Ryan wrote:
>Erik Steven Harrison wrote:
>
>>
>>--
>>
>>On Wed, 12 Feb 2003 17:14:17
>> Erik Steven Harrison wrote:
>>
>>
>>>--
>>>
>>>On Wed, 12 Feb 2003 18:29:29
>>>Joseph F. Ryan wrote:
>>>
>>>
As near as I can tell, the only problem
Erik Steven Harrison wrote:
--
On Wed, 12 Feb 2003 17:14:17
Erik Steven Harrison wrote:
--
On Wed, 12 Feb 2003 18:29:29
Joseph F. Ryan wrote:
As near as I can tell, the only problem with the nice flow of:
A I is a piece of data.
A I is a variable that holds a literal.
A I is a se
Erik Steven Harrison wrote:
--
On Wed, 12 Feb 2003 18:29:29
Joseph F. Ryan wrote:
As near as I can tell, the only problem with the nice flow of:
A I is a piece of data.
A I is a variable that holds a literal.
A I is a sequence of literals and scalars.
An I is a variable that holds a list
> Here are some of the answers from my own notes. These behaviors have
> all been confirmed on-list by the design team:
>
> An @array in list context returns a list of its elements
> An @array in scalar context returns a reference to itself (NOTE1)
> An @array in numeric (scalar) context retur
--
On Wed, 12 Feb 2003 17:14:17
Erik Steven Harrison wrote:
>
>--
>
>On Wed, 12 Feb 2003 18:29:29
> Joseph F. Ryan wrote:
>>As near as I can tell, the only problem with the nice flow of:
>>
>> A I is a piece of data.
>> A I is a variable that holds a literal.
>>
>> A I is a sequence of lit
--
On Wed, 12 Feb 2003 18:29:29
Joseph F. Ryan wrote:
>As near as I can tell, the only problem with the nice flow of:
>
> A I is a piece of data.
> A I is a variable that holds a literal.
>
> A I is a sequence of literals and scalars.
> An I is a variable that holds a list.
>
>is the "Rvalue-
--
On Tue, 11 Feb 2003 12:28:23
Luke Palmer wrote:
>> Date: Tue, 11 Feb 2003 10:34:57 -0800
>> From: Michael Lazzaro <[EMAIL PROTECTED]>
>>
>> On Monday, February 10, 2003, at 05:56 PM, Luke Palmer wrote:
>> > Indeed, this supports the distinction, which I will reiterate:
>> >
>> > - Ar
On Tuesday, February 11, 2003, at 04:56 PM, Deborah Ariel Pickett
wrote:
But is it OK for a list to be silently promoted to an array when used
as an array? So that all of the following would work, and not just
50%
of them?
(1..10).map {...}
[1..10].map {...}
And somehow related to al
On 2003-02-12 at 11:07:45, Joseph F. Ryan wrote:
> Meaning that "I think this should be possible, but I'm not
> sure if that syntax is correct, because it would mean that
> the arrayrefs would need to be their own class to allow
> a method to be called on it.
No, they wouldn't, unless I'm missing s
Mark J. Reed wrote:
On 2003-02-11 at 17:12:52, Joseph F. Ryan wrote:
(@a,@b,@c).pop
This doesn't make any sense, since pop modifies the pop-ee.
What do you expect should happen here?
[@a,@b,@c].pop
Same as above.
Except that the Perl5 equivalent, ugly as the syntax
On 2003-02-11 at 16:52:36, Dave Whipp wrote:
> "Mark J. Reed" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > On 2003-02-11 at 17:44:08, Mark J. Reed wrote:
> > > pop @{[@a,@b,@c]}
> > >
> > > It creates an anonymous array, then removes the last
> But is it OK for a list to be silently promoted to an array when used
> as an array? So that all of the following would work, and not just 50%
> of them?
> (1..10).map {...}
> [1..10].map {...}
And somehow related to all this . . .
Let's assume for the moment that there's still a fun
Dave Whipp:
# > Minor correction: we don't know how many elements are left in the
# > array - it depends on how many elements were in @a, @b, and @c to
# > start with. One less than that. :)
#
# These days you need the splat operator to flatten lists: so
My understanding was that arrays would
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What is the utility of the perl5 behavior:
>
> \($a,$b,$c)
>
> meaning
>
> (\$a, \$b, \$c)
>
> Do people really do that? I must say, given that it looks *so
> obviously* like it instead
"Mark J. Reed" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On 2003-02-11 at 17:44:08, Mark J. Reed wrote:
> > pop @{[@a,@b,@c]}
> >
> > It creates an anonymous array, then removes the last element, leaving
two
> > elements in the array - which is i
> "JFR" == Joseph F Ryan <[EMAIL PROTECTED]> writes:
>> (@a,@b,@c).pop
JFR> This doesn't make any sense, since pop modifies the pop-ee.
JFR> What do you expect should happen here?
>> [@a,@b,@c].pop
JFR> Same as above.
there is a subtle distinction in those two. the first should b
On 2003-02-11 at 17:44:08, Mark J. Reed wrote:
> pop @{[@a,@b,@c]}
>
> It creates an anonymous array, then removes the last element, leaving two
> elements in the array - which is irrelevant since the array is
> then discarded completely.
Minor correction: we don't know how many element
On 2003-02-11 at 17:12:52, Joseph F. Ryan wrote:
> > (@a,@b,@c).pop
>
> This doesn't make any sense, since pop modifies the pop-ee.
> What do you expect should happen here?
>
>
> >
> > [@a,@b,@c].pop
>
>
> Same as above.
Except that the Perl5 equivalent, ugly as the syntax may be, works
Michael Lazzaro wrote:
On Monday, February 10, 2003, at 05:56 PM, Luke Palmer wrote:
Indeed, this supports the distinction, which I will reiterate:
- Arrays are variables.
- Lists are values.
My hesitation about the 'arrays are variables' part is that Damian
corrected me on a simi
> "Michael" == Michael Lazzaro <[EMAIL PROTECTED]> writes:
Michael> Do people really do that? I must say, given that it looks *so
Michael> obviously* like it instead means [$a,$b,$c], I wonder if attempting to
Michael> take a reference to a list should be a compile-time error.
Michael> Note
On Tuesday, February 11, 2003, at 10:56 AM, Garrett Goebel wrote:
What about this?
\@array
hmm. As perl Apoc2, Lists, RFC 175... arrays and hashes return a
reference
to themselves in scalar context... I'm not sure what context '\' puts
them
in.
I'd guess \@array is a reference to an
> Date: Tue, 11 Feb 2003 10:34:57 -0800
> From: Michael Lazzaro <[EMAIL PROTECTED]>
>
> On Monday, February 10, 2003, at 05:56 PM, Luke Palmer wrote:
> > Indeed, this supports the distinction, which I will reiterate:
> >
> > - Arrays are variables.
> > - Lists are values.
>
> My hesitati
[Recipients trimmed back to just p6-language; the Cc: list was getting
a bit large.]
On 2003-02-11 at 12:56:45, Garrett Goebel wrote:
> I'd just stick with Uri's explanation. Arrays are allocated. Lists are
> on the stack...
Nuh-uh. Those are implementation details, not part of the language
defin
From: Michael Lazzaro [mailto:[EMAIL PROTECTED]]
>
> Just to clarify... in P6, is this an array reference, or a list
> reference?
>
> [1,2,3]
Exactly. It's still up in the air...
Apoc 2, RFC 175:
> So it works out that the explicit list composer:
>
>[1,2,3]
>
> is syntactic sugar f
On Monday, February 10, 2003, at 06:26 PM, Joseph F. Ryan wrote:
Deborah Ariel Pickett wrote:
(Just going off on a tangent: Is it true that an array slice such as
@array[4..8]
is syntactically equivalent to this list
(@array[4], @array[5], @array[6], @array[7], @array[8])
? Are array slices
On Monday, February 10, 2003, at 05:56 PM, Luke Palmer wrote:
Indeed, this supports the distinction, which I will reiterate:
- Arrays are variables.
- Lists are values.
My hesitation about the 'arrays are variables' part is that Damian
corrected me on a similar thing when I was writin
Deborah Ariel Pickett wrote:
While I like the glib "Arrays are variables that hold lists" explanation
that worked so well in Perl5, I think that Perl6 is introducing some
changes to this that make this less true.
Like what?
Well, like the builtin switch statement, which was what I wa
> From: Deborah Ariel Pickett <[EMAIL PROTECTED]>
> Date: Tue, 11 Feb 2003 11:15:13 +1100 (EST)
>
> In Perl6, where there seems to be even more of a blur between
> compile-time and runtime, I don't think it's always going to be possible
> (i.e., easy) to know where naming an array or providing an
> >While I like the glib "Arrays are variables that hold lists" explanation
> >that worked so well in Perl5, I think that Perl6 is introducing some
> >changes to this that make this less true.
> Like what?
Well, like the builtin switch statement, which was what I was trying to
show in my bad examp
Uri Guttman wrote:
>
> arrays are allocated and lists are on the stack. so arrays
> can have references to them but lists can't.
Apoc 2, RFC 175:
>
> scalar(list(1,2,3));
[...]
> scalar(array(1,2,3));
Which would imply one could take a reference to either.
> can anyone see any changes in p
Deborah Ariel Pickett wrote:
I'm trying, and failing, to accurately and definitively answer the
question "what's the difference between an array and a list in Perl6?"
If someone can come up with a simple but accurate definition, it would
be helpful.
While I like the glib "Arrays are varia
> I'm trying, and failing, to accurately and definitively answer the
> question "what's the difference between an array and a list in Perl6?"
> If someone can come up with a simple but accurate definition, it would
> be helpful.
While I like the glib "Arrays are variables that hold lists" explan
> "AT" == Adam Turoff <[EMAIL PROTECTED]> writes:
AT> On Fri, Feb 07, 2003 at 06:38:36PM -0500, Uri Guttman wrote:
>> > "ML" == Michael Lazzaro <[EMAIL PROTECTED]> writes:
ML> Along those lines, the closest I've been able to come so far to a
ML> usable two-sentence definition is:
On Friday, February 7, 2003, at 04:24 PM, Uri Guttman wrote:
ML> \(1,2,3)
ML> returns an array reference...
in perl5 it returns a list of refs ( \1, \2, \3 ). i dunno the perl6
semantics. it could be the same as [ 1, 2, 3 ] which means it is not a
Sorry, I was misremembering a threa
> Date: Fri, 7 Feb 2003 14:46:37 -0800
> From: Michael Lazzaro <[EMAIL PROTECTED]>
>
>
> On Friday, February 7, 2003, at 02:07 PM, Uri Guttman wrote:
> > the whole notion is that lists are always temporary and arrays can be
> > as
> > permanent as you want (an array ref going quickly out of sco
On Fri, Feb 07, 2003 at 06:38:36PM -0500, Uri Guttman wrote:
> > "ML" == Michael Lazzaro <[EMAIL PROTECTED]> writes:
> ML> Along those lines, the closest I've been able to come so far to a
> ML> usable two-sentence definition is:
>
> ML> -- A list is an ordered set of scalar values.
>
> "ML" == Michael Lazzaro <[EMAIL PROTECTED]> writes:
ML> On Friday, February 7, 2003, at 03:38 PM, Uri Guttman wrote:
>> but you can't derive the rules about allowing push/pop/splice/slice
>> from
>> that pair of defintions.
ML> Is there any syntactic reason why both of the follow
On Fri, Feb 07, 2003 at 02:30:47PM -0500, Mark J. Reed wrote:
> On 2003-02-07 at 14:26:42, Mark J. Reed wrote:
> > Not really, though. A list can be an lvalue, provided it is a list
> > of lvalues:
Note that to avoid the burden of writing an explicit slice, 'undef' is
considered as a lvalue in su
On Friday, February 7, 2003, at 03:38 PM, Uri Guttman wrote:
but you can't derive the rules about allowing push/pop/splice/slice
from
that pair of defintions.
Is there any syntactic reason why both of the following cannot be
allowed?
(1,2,3).pop
[1,2,3].pop
I don't know that one is
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Along those lines, the closest I've been able to come so far to a
> usable two-sentence definition is:
>
> -- A list is an ordered set of scalar values.
quibble: that's an "ordered bag", isn't it?
> "ML" == Michael Lazzaro <[EMAIL PROTECTED]> writes:
ML> On Friday, February 7, 2003, at 02:07 PM, Uri Guttman wrote:
>> the whole notion is that lists are always temporary and arrays can
>> be as
>> permanent as you want (an array ref going quickly out of scope is very
>> temporar
On Friday, February 7, 2003, at 02:07 PM, Uri Guttman wrote:
the whole notion is that lists are always temporary and arrays can be
as
permanent as you want (an array ref going quickly out of scope is very
temporary). lists can't live beyond the current expression but arrays
can.
Along those l
> "MJR" == Mark J Reed <[EMAIL PROTECTED]> writes:
MJR> A reference is fundamentally a pointer, but that doesn't help. My point
MJR> was that if you're talking about lists vs. arrays, you have at least
MJR> three different syntaxes to distinguish:
MJR> (1,2,3)
MJR>
On 2003-02-07 at 12:18:21, Austin Hastings wrote:
> > Although this may reasonably be regarded as a special case; you
> > certainly can't pop a list:
> >
> > (1,2,3).pop => error
>
> But could you do it the other way (function instead of method)?
> pop (1,2,3) => ?
Nope. At least, n
--- "Mark J. Reed" <[EMAIL PROTECTED]> wrote:
> On 2003-02-07 at 11:13:07, Austin Hastings wrote:
> > --- Michael Lazzaro <[EMAIL PROTECTED]> wrote:
> > > I'm trying, and failing, to accurately and definitively answer
> the
> > > question "what's the difference between an array and a list in
> >
On 2003-02-07 at 14:26:42, Mark J. Reed wrote:
> Not really, though. A list can be an lvalue, provided it is a list
> of lvalues:
>
> ($a, $b, $c) = 1,2,3;
Forgot the parens on the right side, there:
($a, $b, $c) = (1,2,3);
> But they certainly aren't lvalues:
>
> [$a,$
On 2003-02-07 at 11:13:07, Austin Hastings wrote:
> --- Michael Lazzaro <[EMAIL PROTECTED]> wrote:
> > I'm trying, and failing, to accurately and definitively answer the
> > question "what's the difference between an array and a list in
> > Perl6?"
>
> How's this?
>
>
> A list is a
--- Michael Lazzaro <[EMAIL PROTECTED]> wrote:
>
> I'm trying, and failing, to accurately and definitively answer the
> question "what's the difference between an array and a list in
> Perl6?"
>
> If someone can come up with a simple but accurate definition, it
> would be helpful.
How's this?
=
48 matches
Mail list logo