Statement modifiers

2003-03-10 Thread Matthijs van Duin
Hi all, just dropping in with some thoughts I had while reading the archive of this list. I've tried to search the list but it's difficult with perl keywords being common english words and google unable to search for punctuation; if the stuff below has already been fully resolved, I'd

Re: Statement modifiers

2003-03-10 Thread Paul
--- Matthijs van Duin [EMAIL PROTECTED] wrote: Now the real subject.. has the issue of multiple statement modifiers already been settled? I saw some mention it wasn't going to be supported, but also mentions of how it would be useful; I can think of such a situation myself: .method when

Re: Statement modifiers

2003-03-10 Thread Matthijs van Duin
On Mon, Mar 10, 2003 at 08:20:39AM -0800, Paul wrote: The real nightmare tends to show up when you duplicate a modifier. What does .method given $x given $y; # which object's .method is called? mean? It gets worse below I made a mistake in my original post, they definitely need to be left-

Re: Statement modifiers

2003-03-10 Thread Luke Palmer
PROPOSAL Replace the 'if', 'unless', 'when' statement modifiers by identically named lowest-precedence left-associative operators that short-circuit from right to left. This means 'FOO if BAR' is identical to 'BAR and FOO', except it has a lower precedence, and 'FOO unless

Re: Statement modifiers

2003-03-10 Thread Matthijs van Duin
On Mon, Mar 10, 2003 at 01:14:05PM -0700, Luke Palmer wrote: It is nice to see someone who puts as much thought into posting as you do. Unfortunately, your proposal is moot, as we have a definitive No, still can't chain them from Larry.

I'm baaaaaaaaaaaaaaack!

2003-03-10 Thread Damian Conway
Like the fully-laden Australian swallow that heralds the first Apocalypse of springtime, I'm back. I hope you're all off reading: http://www.perl.com/pub/a/2003/03/07/apocalypse6.html Special thanks to Simon for getting it on-line as quickly as he did. I'll do my best to answer questions

Question for Damian about Apocalypse 6

2003-03-10 Thread Austin Hastings
Oh, goody. In psiglet, is the 's' silent? =Austin --- Damian Conway [EMAIL PROTECTED] wrote: Like the fully-laden Australian swallow that heralds the first Apocalypse of springtime, I'm back. I hope you're all off reading: http://www.perl.com/pub/a/2003/03/07/apocalypse6.html

SM vs. BD (apoc6)

2003-03-10 Thread Uri Guttman
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 the SM folks to inflict strongly typed

Re: Question for Damian about Apocalypse 6

2003-03-10 Thread Larry Wall
On Mon, Mar 10, 2003 at 01:20:24PM -0800, Austin Hastings wrote: : In psiglet, is the 's' silent? Of course not. That is Greek, not English. Larry

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

Apo 6: Typo in grammar

2003-03-10 Thread Piers Cawley
Larry says that sub foo { ... } is equivalent to sub foo will do {...} But then goes on to give the grammar for subroutine definitions as: rule lexicalsub :w { lexscope type? subintro subname psignature? trait* block } rule packagesub :w {

Question (#2) about Apocalypse 6 : Can is properties by specified indirectly?

2003-03-10 Thread Austin Hastings
Having just read through the declaration bits (not the calling bits, yet): It is explicitly stated that is rw on a slurpy parameter distributes across all the components. Is there some way of differentiating array of const vs. array of rw? That is, creating a hash or array that can be extended

Apocalypse 6: Possible file-transfer glitch?

2003-03-10 Thread Austin Hastings
I see e-accent in te/en we can say, below, plus dhow is ii\ the named-only zone below that. It survived a few refreshes, so I wonder if it's a file-transfer problem? =Austin If instead we force new parameters to be in named notation, like this: multi *push (@array, [EMAIL PROTECTED],

Re: Apocalypse 6: Possible file-transfer glitch?

2003-03-10 Thread Christian Renz
It survived a few refreshes, so I wonder if it's a file-transfer problem? No, Larry is just presenting additional proof that we need Unicode operators in Perl 6 by using them in English, too. :) Greetings, Christian -- [EMAIL PROTECTED] - http://www.web42.com/crenz/ - http://www.web42.com/ The

is constant eq pass by value (apoc6)

2003-03-10 Thread Uri Guttman
is constant (default) Every formal parameter is constant by default, meaning primarily that the compiler won't feel obligated to construct an lvalue out the actual argument unless you specifically tell it to. It also means that you may not modify the

Re: Apocalypse 6: Possible file-transfer glitch?

2003-03-10 Thread Austin Hastings
Christian, [A6, p7] There will be two new operators, called pipe operators, that allow us to hook list generators together with list consumers in either order. So either of these works: stuff @foo == 1,2,3 1,2,3 == stuff @foo [/A6, p7] I don't think that's going to be an issue --

Re: is constant eq pass by value (apoc6)

2003-03-10 Thread Mark J. Reed
On 2003-03-10 at 18:03:12, Uri Guttman wrote: this confuses me. sometimes i want a simple pass by value param which i can modify locally in the sub. is this the same as the constant above? No, that's the same as is copy. -- Mark REED| CNN Internet Technology 1 CNN Center

is copy (was Re: is constant eq pass by value (apoc6))

2003-03-10 Thread Uri Guttman
bah, the is copy is pass by value with local modification (my params in p5). this works as most params should be constant. the few that are copies can be declared that or copied to my vars. i have to wait on posting before i read the whole megilla. uri -- Uri Guttman -- [EMAIL

Re: Question (#2) about Apocalypse 6 : Can is properties by specified indirectly?

2003-03-10 Thread Damian Conway
Austin Hastings wrote: It is explicitly stated that is rw on a slurpy parameter distributes across all the components. Is there some way of differentiating array of const vs. array of rw? That is, creating a hash or array that can be extended without overwriting? I'm not sure I follow what

A6 page 6 formatting problem

2003-03-10 Thread Paul
Just in case anyone cares, page 6 is requiring that I scroll horizontally. I'll live, but if it can be easily fixed, that's a Good Thing. :) Haven't read the rest yet -- still working on it. Paul --- Damian Conway [EMAIL PROTECTED] wrote: Like the fully-laden Australian swallow that heralds

Re: Question (#2) about Apocalypse 6 : Can is properties by specified indirectly?

2003-03-10 Thread Mark J. Reed
On 2003-03-11 at 10:12:17, Damian Conway wrote: Austin Hastings wrote: It is explicitly stated that is rw on a slurpy parameter distributes across all the components. Is there some way of differentiating array of const vs. array of rw? That is, creating a hash or array that can be

Re: Question (#2) about Apocalypse 6 : Can is properties by specified indirectly?

2003-03-10 Thread Austin Hastings
--- Damian Conway [EMAIL PROTECTED] wrote: Austin Hastings wrote: It is explicitly stated that is rw on a slurpy parameter distributes across all the components. Is there some way of differentiating array of const vs. array of rw? That is, creating a hash or array that can be

Re: Question (#2) about Apocalypse 6 : Can is properties by specified indirectly?

2003-03-10 Thread Damian Conway
Austin Hastings asked: How do I specify an array which may be appended/pushed, but whose values cannot change? I believe you'd have to create a class for such things, derived from Array: class AppOnlyArray is Array { method STORE(int $index, $value) {

A6: Pipes

2003-03-10 Thread Michael Lazzaro
Since noone else has said it yet -- This Apoc looks *great*. The sig stuff is very, very nice. (The wrapper stuff has interesting possibilities, too, especially with OO.) Question on pipes: I like very much the concept of relating them only to the variadic list, that was the piece we were

Re: A6: Pipes

2003-03-10 Thread Damian Conway
Michael Lazzaro wrote: After reading that appendix, I'm still a bit murky on the final decisions as to which of these edge cases will be allowed: my @out == (1,2,3); my @out == (my @in = foo()); my @out == foo(); (1,2,3) == my @out; (my @in = foo()) == my

A6: Complex Parameter Types

2003-03-10 Thread Michael Lazzaro
In A6, it is confirmed that you can have complex types such as: my %pet is Hash of Array of Array of Hash of Array of Cat; It is also confirmed that you can indeed use such types in sub signatures, e.g.: sub foo (@a is Array of int) {...} Confirmations/Questions: 1) Complex types for sub

Re: A6: Complex Parameter Types

2003-03-10 Thread Damian Conway
Michael Lazzaro asked: 1) Complex types for sub parameters: The above would imply that a sub can tell the difference between an CArray of int vs an CArray of str, thank goodness. That also implies that you can use arbitrarily complex types, and still get the same type checking: sub foo (

Re: A6: Complex Parameter Types

2003-03-10 Thread Larry Wall
On Tue, Mar 11, 2003 at 01:25:41PM +1100, Damian Conway wrote: : 3) The edge point between explicitly typed and explicitly non-typed : variables: If you pass an untyped array (or list?) to an explicitly : typed array parameter, is the untyped array considered a unique case, : or will it fail?

Re: A6: Complex Parameter Types

2003-03-10 Thread Dave Whipp
Larry Wall wrote: I dunno. I can argue that it should coerce that. It'll certainly be able to coerce a random scalar to int for you, so it's not a big stretch to coerce conformant arrays of them. On the other hand, it's likely to be expensive in some cases, which isn't so much of an issue for

Re: Question (#2) about Apocalypse 6 : Can is properties by specified indirectly?

2003-03-10 Thread Luke Palmer
I believe you'd have to create a class for such things, derived from Array: class AppOnlyArray is Array { method STORE(int $index, $value) { fail Can't modify existing element if 0 = $index .length;

Re: A6: Complex Parameter Types

2003-03-10 Thread Damian Conway
Larry wrote: : multi foo (@a is Array of int) {...} : : my int @a = baz(); # is Array of int : my @b = baz(); # is Array of Scalar : : foo(@a);# @a is typed correctly, so OK : foo(@b);# @b is not explicitly typed as Cint; OK or FAIL? : : Fails. : : Because: : :

A6: Signature zones and such

2003-03-10 Thread Brent Dax
method x ($me: $req, ?$opt, +$namedop, *%named, [EMAIL PROTECTED]) { ... } Yikes. And I thought we were trying to get *away* from line noise? :^) Seriously, can't we use something rather prettier, like this? method x($me: $req, $opt is optional, $namedop is named, *%named,

Re: A6: Signature zones and such

2003-03-10 Thread Damian Conway
Brent Dax wrote: method x ($me: $req, ?$opt, +$namedop, *%named, [EMAIL PROTECTED]) { ... } Yikes. And I thought we were trying to get *away* from line noise? :^) Seriously, can't we use something rather prettier, like this? method x($me: $req, $opt is optional, $namedop is named,

A6 and temp/let

2003-03-10 Thread Luke Palmer
First of all, I like where Appendix C is going. My (small in comparison) problem is with Clet's definition of failure. The exception bit is neat, and provides for pretty much out-of-the-box exception safety. But failure based on return value may not be such a hot idea. Consider: class