Re: state vs my

2004-12-04 Thread Alexey Trofimenko
On Fri, 3 Dec 2004 21:25:39 -0800, Larry Wall [EMAIL PROTECTED] wrote: On Sat, Dec 04, 2004 at 06:31:35AM +0300, Alexey Trofimenko wrote: : : for 1..10_000_000 { : my ($a,$b,$c) = ... : ... : } : : vs. : : for 1..10_000_000 { : state ($a,$b,$c) = ... : ... : } : :

Re: state vs my

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:03:45PM +0300, Alexey Trofimenko wrote: : P.S. : btw, what about : : my @rray; : # i'm starting to like that sigil is a part of name idea :) Too cute. But what about %ash and unction? Or is it ubroutine? losure? : for 1..10 { : { :push @rray, \(

Re: state vs my

2004-12-04 Thread Alexey Trofimenko
On Sat, 4 Dec 2004 11:33:10 -0800, Larry Wall [EMAIL PROTECTED] wrote: On Sat, Dec 04, 2004 at 08:03:45PM +0300, Alexey Trofimenko wrote: : P.S. : btw, what about : : my @rray; : # i'm starting to like that sigil is a part of name idea :) : for 1..10 { : { :push @rray, \( state

Re: state vs my

2004-12-04 Thread Larry Wall
On Sun, Dec 05, 2004 at 02:15:51AM +0300, Alexey Trofimenko wrote: : I thought, its primary use is for closures: : : sub test { : my $a=10; : return sub { $a++ } : } : : vs : sub test { : return sub {state $a=10; $a++ } : } : : $func1 = test; : $func2 = test; : : would

Re: state vs my

2004-12-03 Thread Larry Wall
On Sat, Dec 04, 2004 at 06:31:35AM +0300, Alexey Trofimenko wrote: : : for 1..10_000_000 { : my ($a,$b,$c) = ... : ... : } : : vs. : : for 1..10_000_000 { : state ($a,$b,$c) = ... : ... : } : : latter looks like it would run faster, because no reallocation envolved

Re: state vs my

2004-12-03 Thread Brent 'Dax' Royal-Gordon
Larry Wall [EMAIL PROTECTED] wrote: So optimizing to a state variable won't necessarily help your loop overhead, but it could help your subroutine overhead, at least in Perl 5, if Perl 5 had state variables. Best you can do in Perl 5 is an our variable with an obscure name. my $x if 0;

Re: Wrappers vs. efficiency - quick comment

2003-03-12 Thread John Siracusa
On 3/12/03 1:50 AM, Mark Biggar wrote: John Siracusa wrote: From A6: I worry that generalized wrappers will make it impossible to compile fast subroutine calls, if we always have to allow for run-time insertion of handlers. Of course, that's no slower than Perl 5, but we'd like to do better

Re: Wrappers vs. efficiency - quick comment

2003-03-12 Thread Austin Hastings
--- John Siracusa [EMAIL PROTECTED] wrote: From A6: I worry that generalized wrappers will make it impossible to compile fast subroutine calls, if we always have to allow for run-time insertion of handlers. Of course, that's no slower than Perl 5, but we'd like to do better than Perl

Re: Wrappers vs. efficiency - quick comment

2003-03-12 Thread Larry Wall
On Wed, Mar 12, 2003 at 10:04:47AM -0500, John Siracusa wrote: : On 3/12/03 1:50 AM, Mark Biggar wrote: : John Siracusa wrote: : From A6: : I worry that generalized wrappers will make it impossible to compile fast : subroutine calls, if we always have to allow for run-time insertion of :

Re: Wrappers vs. efficiency - quick comment

2003-03-11 Thread Mark Biggar
John Siracusa wrote: From A6: I worry that generalized wrappers will make it impossible to compile fast subroutine calls, if we always have to allow for run-time insertion of handlers. Of course, that's no slower than Perl 5, but we'd like to do better than Perl 5. Perhaps we can have the default

Re: SM vs. BD (apoc6)

2003-03-10 Thread Austin Hastings
--- Uri Guttman [EMAIL PROTECTED] wrote: But mad or not, there are some good reasons to do just that. First, it makes it possible to write interfaces to other languages in Perl. Second, it gives the optimizer more information to think about. Third, it allows

Re: Arrays vs lists; A possible solution?

2003-02-13 Thread Joseph F. Ryan
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 Iliteral is a piece of data. A Iscalar is a variable that holds a literal. A Ilist is a sequence of literals and scalars. An Iarray is a

Re: Arrays vs lists; A possible solution?

2003-02-13 Thread Joseph F. Ryan
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 Iliteral is a piece of data. A Iscalar is a variable that holds a

Re: Arrays vs lists; A possible solution?

2003-02-13 Thread Erik Steven Harrison
-- 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 with the nice flow of: A Iliteral

Re: Arrays vs. Lists

2003-02-12 Thread Mark J. Reed
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 element,

Re: Arrays vs. Lists

2003-02-12 Thread Joseph F. Ryan
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

Re: Arrays vs. Lists

2003-02-12 Thread Mark J. Reed
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

Re: Arrays, lists, referencing (was Re: Arrays vs. Lists)

2003-02-12 Thread Michael Lazzaro
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

Re: Arrays vs. Lists

2003-02-12 Thread Erik Steven Harrison
-- 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: - Arrays are

Re: Arrays vs lists; A possible solution?

2003-02-12 Thread Erik Steven Harrison
-- 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 Iliteral is a piece of data. A Iscalar is a variable that holds a literal. A Ilist is a sequence of literals and scalars. An Iarray is a variable that holds a list.

Re: Arrays vs lists; A possible solution?

2003-02-12 Thread Erik Steven Harrison
-- 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 Iliteral is a piece of data. A Iscalar is a variable that holds a literal. A Ilist is a sequence of

Re: Arrays, lists, referencing (was Re: Arrays vs. Lists)

2003-02-12 Thread Deborah Ariel Pickett
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 returns

Re: Arrays vs. Lists

2003-02-11 Thread Michael Lazzaro
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

Re: Arrays vs. Lists

2003-02-11 Thread Michael Lazzaro
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

RE: Arrays vs. Lists [x-adr]

2003-02-11 Thread Garrett Goebel
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 for

Re: Arrays vs. Lists [x-adr]

2003-02-11 Thread Mark J. Reed
[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

Re: Arrays vs. Lists [x-adr]

2003-02-11 Thread Michael Lazzaro
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

Re: Arrays vs. Lists

2003-02-11 Thread Joseph F. Ryan
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

Re: Arrays vs. Lists

2003-02-11 Thread Mark J. Reed
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 fine:

Re: Arrays vs. Lists

2003-02-11 Thread Mark J. Reed
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 elements

Re: Arrays vs. Lists

2003-02-11 Thread Uri Guttman
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 be a syntax

Re: Arrays vs. Lists

2003-02-11 Thread Dave Whipp
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 means

RE: Arrays vs. Lists

2003-02-11 Thread Brent Dax
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

Arrays, lists, referencing (was Re: Arrays vs. Lists)

2003-02-11 Thread Deborah Ariel Pickett
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

Re: Arrays vs. Lists

2003-02-11 Thread Randal L. Schwartz
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 that this is

RE: Arrays vs. Lists [x-adr]

2003-02-10 Thread Garrett Goebel
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 perl6

Re: Arrays vs. Lists

2003-02-10 Thread Deborah Ariel Pickett
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 example

Re: Arrays vs. Lists

2003-02-10 Thread Luke Palmer
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 actual

Re: Arrays vs. Lists

2003-02-10 Thread Joseph F. Ryan
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 was

Re: Arrays vs. Lists

2003-02-09 Thread Deborah Ariel Pickett
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 explanation

Re: Arrays vs. Lists

2003-02-09 Thread Joseph F. Ryan
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

Re: Arrays vs. Lists

2003-02-07 Thread Austin Hastings
--- 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?

Re: Arrays vs. Lists

2003-02-07 Thread Mark J. Reed
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 literal (e.g.,

Re: Arrays vs. Lists

2003-02-07 Thread Mark J. Reed
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,$b,$c]

Re: Arrays vs. Lists

2003-02-07 Thread Austin Hastings
--- 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 Perl6? How's

Re: Arrays vs. Lists

2003-02-07 Thread Mark J. Reed
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, not in Perl

Re: Arrays vs. Lists

2003-02-07 Thread Uri Guttman
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 @arrayName

Re: Arrays vs. Lists

2003-02-07 Thread Michael Lazzaro
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

Re: Arrays vs. Lists

2003-02-07 Thread Uri Guttman
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 temporary). lists can't

Re: Arrays vs. Lists

2003-02-07 Thread Dave Whipp
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? ;) --

Re: Arrays vs. Lists

2003-02-07 Thread Stéphane Payrard
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 such a

Re: Arrays vs. Lists

2003-02-07 Thread Uri Guttman
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 following cannot be

Re: Arrays vs. Lists

2003-02-07 Thread Adam Turoff
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 -- An array is

Re: Arrays vs. Lists

2003-02-07 Thread Luke Palmer
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 scope is very

Re: Arrays vs. Lists

2003-02-07 Thread Michael Lazzaro
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

Re: Arrays vs. Lists

2003-02-07 Thread Uri Guttman
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: ML -- A list is

Re: Primitive Vs Object types

2002-11-11 Thread Damian Conway
Mark J. Reed wrote: Attributes are class-specific for a variable (okay, class instance specific, if you do Evil Things with multiple copies of a single base class in different legs of the inheritance tree and override the default behaviour of the engine) and not queryable at runtime without

Re: Primitive Vs Object types

2002-11-11 Thread Damian Conway
Luke Palmer wrote: Could you just look through the lexical scope of the object? for $this.MY.kv - $k, $v { print $k: $v\n } Or would you look through the class's lexical scope and apply it to the object? for keys $this.class.MY { print $_: $this.MY{$_}\n } I

Re: Primitive Vs Object types

2002-11-10 Thread Nicholas Clark
On Thu, Nov 07, 2002 at 04:16:50PM -0500, Dan Sugalski wrote: Basically anything you can potentially find in a symbol table or lexical scratchpad will potentially be able to have a property attached to it. The only way that we'll be able to reasonably restrict (and optimize) the use of

Re: Primitive Vs Object types

2002-11-08 Thread Leopold Toetsch
Larry Wall wrote: ... I can see ways of binding properties to a location without growing the location itself, but I think stuffing a junction of ints into a single location is somewhat problematical. We are still talking about native types - these with lowercase names in the docs? Why

Re: Primitive Vs Object types

2002-11-07 Thread Austin Hastings
--- Michael Lazzaro [EMAIL PROTECTED] wrote: Primitive types were originally intended for runtime speed, thus an int or a bit is as small as possible, and not a lot of weird runtime checking has to take place that would slow it down. It can't even be undef, because that would take an extra

Re: Primitive Vs Object types

2002-11-07 Thread Michael Lazzaro
On Thursday, November 7, 2002, at 06:36 AM, Austin Hastings wrote: For 'bit', the key value is (eenie, meenie, ...) '1'. Any '1' value will trigger a search for undef bit values. Presuming that bit values will not frequently be undef, the search should be cheap and the storage requirements will

Re: Primitive Vs Object types

2002-11-07 Thread Leopold Toetsch
Michael Lazzaro wrote: On Thursday, November 7, 2002, at 06:36 AM, Austin Hastings wrote: For 'bit', the key value is (eenie, meenie, ...) '1'. From A2 we have: Run-time properties really are associated with the object in question, which implies some amount of overhead. For that

Re: Primitive Vs Object types

2002-11-07 Thread Dan Sugalski
At 8:29 PM +0100 11/7/02, Leopold Toetsch wrote: Michael Lazzaro wrote: On Thursday, November 7, 2002, at 06:36 AM, Austin Hastings wrote: For 'bit', the key value is (eenie, meenie, ...) '1'. From A2 we have: Run-time properties really are associated with the object in question,

RE: Primitive Vs Object types

2002-11-07 Thread Garrett Goebel
Dan Sugalski wrote: At 8:29 PM +0100 11/7/02, Leopold Toetsch wrote: Michael Lazzaro wrote: On Thursday, November 7, 2002, at 06:36 AM, Austin Hastings wrote: For 'bit', the key value is (eenie, meenie, ...) '1'. From A2 we have: Run-time properties really are associated with the

Re: Primitive Vs Object types

2002-11-07 Thread Jonathan Scott Duff
On Thu, Nov 07, 2002 at 03:56:04PM -0600, Garrett Goebel wrote: Dan Sugalski wrote: At 8:29 PM +0100 11/7/02, Leopold Toetsch wrote: Michael Lazzaro wrote: On Thursday, November 7, 2002, at 06:36 AM, Austin Hastings wrote: For 'bit', the key value is (eenie, meenie, ...) '1'.

RE: Primitive Vs Object types

2002-11-07 Thread Dan Sugalski
At 3:56 PM -0600 11/7/02, Garrett Goebel wrote: Dan Sugalski wrote: At 8:29 PM +0100 11/7/02, Leopold Toetsch wrote: Michael Lazzaro wrote: On Thursday, November 7, 2002, at 06:36 AM, Austin Hastings wrote: For 'bit', the key value is (eenie, meenie, ...) '1'. From A2 we have:

Re: Primitive Vs Object types

2002-11-07 Thread Mark J. Reed
[Recipients list trimmed back to just the list - it was getting ridiculous. So everyone will get only get one copy and it may take a tad longer to get there . . .] On 2002-11-07 at 17:07:46, Dan Sugalski wrote: Attributes are class-specific for a variable (okay, class instance specific, if

Re: Primitive Vs Object types

2002-11-07 Thread Luke Palmer
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Date: Thu, 7 Nov 2002 17:19:28 -0500 From: Mark J. Reed [EMAIL PROTECTED] Content-Disposition: inline X-Julian-Day: 2452586.42675 X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/ [Recipients list trimmed back to just the list

Re: Primitive Vs Object types

2002-11-07 Thread Mark J. Reed
On 2002-11-07 at 15:28:14, Luke Palmer wrote: From: Mark J. Reed [EMAIL PROTECTED] Will something like that not be possible in Perl6? I'm afraid that statement is false for all values of something :) Good point. Erratum: for possible,

Re: Primitive Vs Object types

2002-11-07 Thread Larry Wall
On Thu, Nov 07, 2002 at 04:16:50PM -0500, Dan Sugalski wrote: : At 8:29 PM +0100 11/7/02, Leopold Toetsch wrote: : Michael Lazzaro wrote: : : : On Thursday, November 7, 2002, at 06:36 AM, Austin Hastings wrote: : : For 'bit', the key value is (eenie, meenie, ...) '1'. : : : From A2 we have:

Re: Primitive Vs Object types

2002-11-06 Thread Dan Sugalski
At 6:50 PM -0800 11/6/02, David Whipp wrote: Whenever a value passes through a primitive type, it loses all its run-time properties; and superpositions will collapse. What makes you think so, and are you really sure? -- Dan

RE: Primitive Vs Object types

2002-11-06 Thread David Whipp
Dan Sugalski [mailto:dan;sidhe.org] wrote: At 6:50 PM -0800 11/6/02, David Whipp wrote: Whenever a value passes through a primitive type, it loses all its run-time properties; and superpositions will collapse. What makes you think so, and are you really sure? I was sure up until the

RE: Primitive Vs Object types

2002-11-06 Thread Dan Sugalski
At 8:24 PM -0800 11/6/02, David Whipp wrote: If I am wrong, then I am in need of enlightenment. What is the difference between the primitive types and their heavyweight partners? And which should I use in a typical script? The big difference is there's no way you can ever truly get a primitive

Re: Primitive Vs Object types

2002-11-06 Thread Michael Lazzaro
David Whipp wrote: Dan Sugalski [mailto:dan;sidhe.org] wrote: At 6:50 PM -0800 11/6/02, David Whipp wrote: Whenever a value passes through a primitive type, it loses all its run-time properties; and superpositions will collapse. What makes you think so, and are you really sure?

RE: Primitive Vs Object types

2002-11-06 Thread David Whipp
Dan Sugalski [mailto:dan;sidhe.org] wrote: At 8:24 PM -0800 11/6/02, David Whipp wrote: If I am wrong, then I am in need of enlightenment. What is the difference between the primitive types and their heavyweight partners? And which should I use in a typical script? The big difference is

Re: Primitive Vs Object types

2002-11-06 Thread John Williams
I gotta admit that this issue is bugging me too. Larry mentions (in http://groups.google.com/groups?hl=enlr=ie=UTF-8selm=Pine.LNX.4.44.0210140927520.20533-10%40london.wall.org) that all-uppercase is ugly and has boundary conditions. Maybe it would be helpful to know what conditions are

Re: eq Vs == Vs ~~ ( was Re: Primitive Boolean type?)

2002-11-01 Thread Sean O'Rourke
See http://archive.develooper.com/perl6-internals;perl.org/msg11308.html for a closely-related discussion. /s On Fri, 1 Nov 2002, David Whipp wrote: In Perl6, everything is an object. So almost everything is neither a number nor a string. It probably doesn't make sense to cast things to

Re: vector vs. hyper

2002-10-29 Thread Dave Mitchell
On Tue, Oct 29, 2002 at 02:55:57PM -0500, Uri Guttman wrote: damian's syntax table and his use of the term vectorizing made me wonder why we call his [op] thing a hyperoperator? the word hyper i assume came from hyperdimensional. but calling [] the vectorizing (or just vectored) op variant

Re: XOR vs. Hyper (was Re: Perl6 Operator List)

2002-10-27 Thread Luke Palmer
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Date: Sat, 26 Oct 2002 23:01:31 -0700 From: Michael Lazzaro [EMAIL PROTECTED] X-Accept-Language: en,pdf Cc: Damian Conway [EMAIL PROTECTED], [EMAIL PROTECTED] [EMAIL PROTECTED] X-SMTPD: qpsmtpd/0.12-dev,

Re: Attribute vs. Property

2002-05-11 Thread Damian Conway
David Wheeler wrote: I just want to verify that I properly understand the use of these two terms in Perl 6. and in the wider OO community, BTW. * An attribute is a data member of a class. Yes. * A property is a piece of metadata on a...uh...thing -- e.g., on an attribute,

Re: Attribute vs. Property

2002-05-11 Thread David Wheeler
On 5/11/02 2:48 PM, Damian Conway [EMAIL PROTECTED] claimed: Well, I suppose there's always a *chance* that we'd both completely reverse our careful thinking on this issue and ignore the common usage of attribute in the OO literature. But I do think it would be easier all round if you just

Re: Curious: - vs .

2001-04-27 Thread Piers Cawley
Buddha Buck [EMAIL PROTECTED] writes: Piers Cawley [EMAIL PROTECTED] writes: Buddha Buck [EMAIL PROTECTED] writes: Bart Lateur [EMAIL PROTECTED] writes: On Wed, 25 Apr 2001 15:52:47 -0600 (MDT), Dan Brian wrote: So why not $object!method(foo, bar);

Re: Curious: - vs .

2001-04-27 Thread Bart Lateur
On 26 Apr 2001 23:19:49 -0400, Buddha Buck wrote: $bar = [$obj method() ]; # method call $bar = method $obj() would be more consistent with perl's current $object = new Class() syntax. -- Bart.

Re: Curious: - vs .

2001-04-27 Thread Buddha Buck
Bart Lateur [EMAIL PROTECTED] writes: On 26 Apr 2001 23:19:49 -0400, Buddha Buck wrote: $bar = [$obj method() ]; # method call $bar = method $obj() would be more consistent with perl's current $object = new Class() syntax. Yes, well, some people want to get rid

Re: Curious: - vs .

2001-04-27 Thread Buddha Buck
Piers Cawley [EMAIL PROTECTED] writes: Buddha Buck [EMAIL PROTECTED] writes: Piers Cawley [EMAIL PROTECTED] writes: Buddha Buck [EMAIL PROTECTED] writes: How about borrowing from Objective C? [$object method(foo, bar)]; How do you create an anonymous

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-26 Thread Bart Lateur
On Wed, 25 Apr 2001 06:09:56 -0700 (PDT), Larry Wall wrote: Bart Lateur writes: : Er... hip hip hurray?!?! : : This is precisely the reason why I came up with the raw idea of : highlander variables in the first place: because it's annoying not being : able to access a hash passed to a sub

Re: Curious: - vs .

2001-04-26 Thread Dan Brian
the idea of a dereference operator dumbfounds lots of folks. What's an object got to do with a reference, much less a pointer? A p5 object is very confusing to others for this reason, and so is the syntax. So you want a method invocation syntax that doesn't remind people of references.

Re: Curious: - vs .

2001-04-26 Thread Piers Cawley
Buddha Buck [EMAIL PROTECTED] writes: Bart Lateur [EMAIL PROTECTED] writes: On Wed, 25 Apr 2001 15:52:47 -0600 (MDT), Dan Brian wrote: So why not $object!method(foo, bar); In my opinion, because it doesn't provide sufficient visual distinction between $object and method().

Re: Curious: - vs .

2001-04-26 Thread Buddha Buck
Piers Cawley [EMAIL PROTECTED] writes: Buddha Buck [EMAIL PROTECTED] writes: Bart Lateur [EMAIL PROTECTED] writes: On Wed, 25 Apr 2001 15:52:47 -0600 (MDT), Dan Brian wrote: So why not $object!method(foo, bar); In my opinion, because it doesn't provide sufficient

RE: Curious: - vs .

2001-04-26 Thread Sterin, Ilya
Lateur; [EMAIL PROTECTED] Subject: Re: Curious: - vs . Piers Cawley [EMAIL PROTECTED] writes: Buddha Buck [EMAIL PROTECTED] writes: Bart Lateur [EMAIL PROTECTED] writes: On Wed, 25 Apr 2001 15:52:47 -0600 (MDT), Dan Brian wrote: So why not $object!method(foo, bar); In my

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-26 Thread Larry Wall
Bart Lateur writes: : Yeah. But no cheers then. The problem still remains: you can access a : hash in the normal way in plain code, but inside a sub, you can mainly : only access a passed hash through a reference. Won't be a problem. : It's annoying to basically having two ways of doing

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Peter Scott
At 09:06 PM 4/24/2001 -0700, Larry Wall wrote: Edward Peschko writes: : Ok, so what does: : : my %hash = ( 1 = 3); : my $hash = { 1 = 4}; : : print $hash{1}; : : print? 4. You must say %hash{1} if you want the other. I was teaching an intro class yesterday and as usual, there were several

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread David L. Nicol
John Porter wrote: We could y/$@%/@%$/ ... ... and create an alternate parser able to handle the full internal internals API. I have finally figured out the main motivation behind the whole perl6 effort: the obfuscated perl contests were getting repetitive. Good night.

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Bart Lateur
On Tue, 24 Apr 2001 18:39:09 -0700 (PDT), Larry Wall wrote: Edward Peschko writes: : I guess my question is what would be the syntax to access hashes? Would : : $hashref.{ } : : be that desirable? I really like -{ } in that case.. It won't be either of those. It'll simply be $hashref{ }.

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Bart Lateur
On Tue, 24 Apr 2001 21:06:56 -0700 (PDT), Larry Wall wrote: : Ok, so what does: : : my %hash = ( 1 = 3); : my $hash = { 1 = 4}; : : print $hash{1}; : : print? 4. You must say %hash{1} if you want the other. Ok. So how about hash slices? Is $hash{$a, $b}, the faked multidimensional hash,

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Larry Wall
Bart Lateur writes: : Er... hip hip hurray?!?! : : This is precisely the reason why I came up with the raw idea of : highlander variables in the first place: because it's annoying not being : able to access a hash passed to a sub through a hash reference, in the : normal way. Not unless you do

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Eric Roode
Nathan Wiger wrote: Here's something I was thinking about at lunch: $concated_number = $number + $other_number; $numerical_add = $number + $other_number; One major, MAJOR pet peeve I have wrt Javascript is that it uses + to mean concatenation as well as addition, and that it (like

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Simon Cozens
On Mon, Apr 23, 2001 at 12:59:54PM -0700, Nathan Wiger wrote: Doesn't ~ look like a piece of string to you? :-) It looks like a bitwise op to me, personally. That's because every time you've used it in Perl, it's been a bitwise op. Sapir-Whorf, and all that. -- So what if I have a fertile

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Graham Barr
On Wed, Apr 25, 2001 at 06:46:20PM +0100, Simon Cozens wrote: On Mon, Apr 23, 2001 at 12:59:54PM -0700, Nathan Wiger wrote: Doesn't ~ look like a piece of string to you? :-) It looks like a bitwise op to me, personally. That's because every time you've used it in Perl, it's been a

<    1   2   3   4   >