typo fix: trinary - ternary

2006-08-16 Thread Mark Stosberg
In Perl6/Spec/Operator.pod Trinary should be Ternary. Mark

clarify: does Dog is Mammal load Mammal for you?

2006-08-21 Thread Mark Stosberg
In S12, we see a number examples of: class Dog is Mammal http://dev.perl.org/perl6/doc/design/syn/S12.html However, it's not clear if it is necessary to preload Mammal for Dog to function properly here, or what that syntax would be. Testing with current version of pugs, this doesn't

clarifying the spec for 'ref'

2006-08-23 Thread Mark Stosberg
I noticed in pugs, 'ref' does not return 'HASH' and 'ARRAY' as Perl5 does, but returns values including 'Hash', 'Array' and 'Array::Const'. I don't find meaningful mentions of 'HASH' and 'ARRAY' by grep'ing docs/Perl6 (or even ref!), so I wanted to check in here about the meaningfulness of this

feedback on the draft documentation spec

2006-08-25 Thread Mark Stosberg
Perl6::Spec::Documentation is a draft spec for documentation formats for use with Perl6. My own reading of it is that POD still exists and is supported, while a new wiki-like format kwid is added, and a framework for various dialects is supported. POD was successful for its simplicity. It was

return Types: what are the enforcement details?

2006-08-29 Thread Mark Stosberg
I'm interested in helping to write some tests for return types, but I'd like some clarifications about them first. Are they just declarations that help Perl optimize stuff, or they actually contracts? As this little script shows, both inner and of are valid syntax now with pugs, but neither is

named arguments: What's the signature?

2006-08-29 Thread Mark Stosberg
Regarding The S06 description of named arguments: http://feather.perl6.nl/syn/S06.html#Named_arguments What I find missing here is documentation of the signature to use if you want to declare I accept an arbitrary number of named arguments. (Like the param() methods common in Perl5 do). Maybe

Re: named arguments: What's the signature?

2006-08-29 Thread Mark Stosberg
Trey Harris wrote: Slurpy parameters follow any required or optional parameters. They are marked by a C* before the parameter: sub duplicate($n, *%flag, [EMAIL PROTECTED]) {...} Named arguments are bound to the slurpy hash (C*%flag in the above example). Such arguments

could 'given' blocks have a return value?

2006-08-29 Thread Mark Stosberg
Sometimes I use 'given' blocks to set a value. To save repeating myself on the right hand side of the given block, I found I kept want to do this: my $foo = given { } ...and have whatever value that was returned from when {} or default {} populate $foo. It turns out pugs already allow this,

Re: could 'given' blocks have a return value?

2006-08-30 Thread Mark Stosberg
Agent Zhang wrote: According to S04, given {} is at statement level, so you can't use it directly as an expression. But Perl 6 always allow you to say my $foo = do given {...} As well as my $foo = do if foo {...} else {...} I confirmed this both work now with pugs! I think the

request: clarify how symbolic references with OO

2006-09-01 Thread Mark Stosberg
In reading about symbolic references, I didn't find any specific language that mentioned using them in conjunction with methods or OO. I would like to see specific language and examples added to the spec to clarify this. Here's a specific example which currently doesn't work in pugs. It's

Re: request: clarify how symbolic references with OO

2006-09-02 Thread Mark Stosberg
Mark Stosberg wrote: ::($meth)(self:); Well, audreyt just made this work (r12960), which I what I what I thought should work in the first place: self.$meth(). So I'm happy. (But my curiosity about the spec for symbolic refs and OO still stands. ) Mark

multi method dispatching of optional arguments

2006-09-02 Thread Mark Stosberg
Hello, I think it would helpful if the spec addressed who wins in MMD when optional arguments are present. I just submitted these failing tests for pugs which illustrate the issue. not ok 11 - Arguments (a = 'b') to signatures 1. () and 2. (*%h) calls 2 not ok 14 - Arguments () to signatures 1.

Re: multi method dispatching of optional arguments

2006-09-02 Thread Mark Stosberg
Mark Stosberg wrote: Hello, I think it would helpful if the spec addressed who wins in MMD when optional arguments are present. I just submitted these failing tests for pugs which illustrate the issue. not ok 11 - Arguments (a = 'b') to signatures 1. () and 2. (*%h) calls 2 not ok 14

Re: multi method dispatching of optional arguments (further refined)

2006-09-02 Thread Mark Stosberg
Mark Stosberg wrote: Hello, I think it would helpful if the spec addressed who wins in MMD when optional arguments are present. I just submitted these failing tests for pugs which illustrate the issue. not ok 11 - Arguments (a = 'b') to signatures 1. () and 2. (*%h) calls 2 not ok 14

when calling sets of methods, what happens to the return values?

2006-09-02 Thread Mark Stosberg
S12 describes a feature to call sets of methods at the same time: http://feather.perl6.nl/syn/S12.html#Calling_sets_of_methods I would like the spec to clarify what happens to the return values of all these methods. I'm fine with a simple answer, such as that they are not available, or only

Re: multi method dispatching of optional arguments (further refined)

2006-09-03 Thread Mark Stosberg
Luke Palmer wrote: I don't follow your examples. What is the logic behind them? On 9/3/06, Mark Stosberg [EMAIL PROTECTED] wrote: Examples: Arguments (1 2) to signatures 1. (@a?) and 2. (@a) calls 2 For example, I would expect this one to be ambiguous, because the 1. (@a?) sub

Re: when calling sets of methods, what happens to the return values?

2006-09-04 Thread Mark Stosberg
Mark Stosberg wrote: S12 describes a feature to call sets of methods at the same time: http://feather.perl6.nl/syn/S12.html#Calling_sets_of_methods I would like the spec to clarify what happens to the return values of all these methods. I'm fine with a simple answer

clarify: how WALK arguments can be combined

2006-09-04 Thread Mark Stosberg
In the Objects chapter, a WALK pseudo-class is spec'ed for using when calling sets of methods: http://feather.perl6.nl/syn/S12.html#Calling_sets_of_methods These are the arguments listed that can be used with WALK: :canonical # canonical dispatch order :ascendant #

Re: clarify: how WALK arguments can be combined

2006-09-05 Thread Mark Stosberg
Brad Bowman wrote: Mark Stosberg wrote: In the Objects chapter, a WALK pseudo-class is spec'ed for using when calling sets of methods: http://feather.perl6.nl/syn/S12.html#Calling_sets_of_methods These are the arguments listed that can be used with WALK: :canonical # canonical

gather/take definition missing

2006-09-06 Thread Mark Stosberg
I found 6 references to gather in Perl6/Spec/*, but none of them were a formal definition. It would great if an official entry for gather/take could be added. Mark

Re: Cwhen outside of Cgiven

2006-09-07 Thread Mark Stosberg
Trey Harris wrote: markstos++ pointed out the following behavior: use v6-alpha; { when 1 ~~ 0 { say Surprise! } } This code prints Surprise!, because $_ is undef, which is false, just like 1 ~~ 0 is. I'd like to make the following suggestions for Synopsis

CATCH: changing the topic and preserving the call stack

2006-09-07 Thread Mark Stosberg
I'll hold up some error handling in CGI::Application as use case some for some CATCH spec refinements. The Perl 5 code is below for reference. First, we handle the exception conditionally based /not/ on the exception itself, but whether we have an exception handle installed to deal with it. Is it

Inf appears to be unspec'ed

2006-09-10 Thread Mark Stosberg
The formal definition of Inf appears to be missing from the spec documents. Since I'm not exactly sure how Perl 6 treats Inf, I'll leave submitting this patch to someone else. Once the spec is added, a smart link to it should be added from: t/builtins/math/infinity.t Mark

Re: not and true appear unspec'ed, too

2006-09-11 Thread Mark Stosberg
Mark Stosberg wrote: The formal definition of Inf appears to be missing from the spec documents. Since I'm not exactly sure how Perl 6 treats Inf, I'll leave submitting this patch to someone else. Once the spec is added, a smart link to it should be added from: t/builtins/math/infinity.t

Re: Inf appears to be unspec'ed

2006-09-11 Thread Mark Stosberg
Mark Stosberg wrote: The formal definition of Inf appears to be missing from the spec documents. Since I'm not exactly sure how Perl 6 treats Inf, I'll leave submitting this patch to someone else. Once the spec is added, a smart link to it should be added from: t/builtins/math/infinity.t

sub ($self: $foo ) (was: Re: single named param)

2006-09-12 Thread Mark Stosberg
Larry Wall wrote: I'm trying to decide if sub ($self: $just_a_named_param) can meaningfully put anything into $self. It seems doubtful, and it should probably be submethod ($self: $just_a_named_param) I agree. If sub ($self: $foo) works than it reduces privacy, since

request for addition to administative field to Synopsis

2006-09-17 Thread Mark Stosberg
Hello, As I've worked on smart linking, I've found some gaps in the spec, often of the variety of obvious parts that should largely work the same as Perl 5. For example, say was formally spec'ed until recently, or print for that matter. I have a suggestion which I believe make the docs more

Re: renaming grep to where

2006-09-18 Thread Mark Stosberg
Darren Duncan wrote: Putting aside legacy issues for the moment, I suggest that it might be appropriate to rename the .grep list operator to .where, so we can say, for example: @filtered = @originals.where:{ .foo eq $bar }; We already have a where keyword in the language, which is

Re: Good list-flattening question.

2006-09-21 Thread Mark Stosberg
Mark J. Reed wrote: Ok, I dkimmed through the synopses again and didn't see this offhand. If I have two arrays @a and @b and I wish to create a two-element list out of them - a la Perl5 ([EMAIL PROTECTED], [EMAIL PROTECTED]) - what's the correct way to do that in Perl6? If it's still

Re: Common Serialization Interface

2006-09-25 Thread Mark Stosberg
Brad Bowman wrote: Both Data::Dumper and Storable provide hooks to customize serialization ($Data::Dumper::Freezer|Toaster, STORABLE_freeze|_thaw). Other modules like YAML and Clone could also possibly reuse a common state marshalling interface. Is there some common element to this