Re: S02 mistake re Blob?

2015-02-21 Thread Jonathan Lang
On Feb 21, 2015, at 2:45 AM, Moritz Lenz mor...@faui2k3.org wrote: Hi Darren, On 21.02.2015 08:51, Darren Duncan wrote: I notice from looking at http://design.perl6.org/S02.html that Blob is listed both as being a role and as a type. See http://design.perl6.org/S02.html#Roles

Re: Unexpected expansion of string with xx

2013-12-21 Thread Jonathan Lang
On Dec 21, 2013, at 12:00 AM, Moritz Lenz mor...@faui2k3.org wrote: On 12/20/2013 04:52 AM, Richard Hainsworth wrote: OK x not xx. The doubling of operators is confusing. OTOH having a single operator which two different meanings is also confusing (and very un-perlish). Sometimes,

Re: [perl6/specs] 9c428a: /.sleep/.alarm/

2013-11-04 Thread Jonathan Lang
On Nov 4, 2013, at 12:19 AM, GitHub nore...@github.com wrote: Branch: refs/heads/master Home: https://github.com/perl6/specs Commit: 9c428a98d060811fa086d3168321cfe437be695a https://github.com/perl6/specs/commit/9c428a98d060811fa086d3168321cfe437be695a Author: Elizabeth

Re: Commensurability as Key

2013-08-23 Thread Jonathan Lang
On Aug 23, 2013, at 2:41 AM, Steve Pitchford steve.pitchf...@gmail.com wrote: How would you implement, in a robust way, the following things: 1 kg + 1 kg = 2 kg 2 m * 3 m = 6 m^2 5 kg * (3 m/s)^2 = 45 J The answer is that you wouldn't - the problem domain is so vague as to be

Re: How to make a new operator.

2012-03-21 Thread Jonathan Lang
My understanding is if you want to count by threes, starting at 2 and ending at 14, you should be able to write: 2, 5 ... 14 That is, the list-building operator looks at the previous two or three terms preceding it to determine where to start and what step function to use, and then looks

Re: How to make a new operator.

2012-03-21 Thread Jonathan Lang
What I want to know is whether there's a way to define a step function that's based in part or in whole on the current term's index. For example, how would I use infix:... to generate the perfect squares between 0 and 100? Namely, '0,1,4,9,16,25,36,49,64,81,100'. For example, is Perl 6 set

Re: Setting private attributes during object build

2012-02-01 Thread Jonathan Lang
Why must we use 'submethod BUILD' instead of 'method BUILD'? Is it some sort of chicken-and-egg dilemma?

Re: Musings on operator overloading (was: File-Fu overloading)

2008-02-24 Thread Jonathan Lang
Aristotle Pagaltzis wrote: And this contradiction – that being able to declare sugar is good, but the way that languages have permitted that so far leads to insanity – is what sent me thinking along the lines that there has to be some way to make overloading sane. And we all know that

Re: [svn:perl6-synopsis] r14510 - doc/trunk/design/syn

2008-02-15 Thread Jonathan Lang
+Despite the appearance as a subscripting form, these names are resolved +not at run time but at compile time. The pseudo-subscripts need not +be simple scalars. These are extended with the same two-element list: + +infix:?? !! +infix:['??','!!'] Huh. I thought that

Re: [svn:perl6-synopsis] r14501 - doc/trunk/design/syn

2008-02-05 Thread Jonathan Lang
+++ doc/trunk/design/syn/S03.podTue Feb 5 09:55:29 2008 @@ -2791,7 +2791,7 @@ are insufficient for defining the pecking order of code. Note that you can bind to either a bare block or a pointy block. Binding to a bare block conveniently leaves the topic in C$_, so the final form

Re: [svn:perl6-synopsis] r14501 - doc/trunk/design/syn

2008-02-05 Thread Jonathan Lang
Larry Wall wrote: : Is it forbidden to use placeholder parameters in conjunction with : my? Or would it simply not do anything useful? I ask because Do : what I mean would seem to imply that 'my Dog $^foo' would specify : $^foo's type as 'Dog'. Though if you start doing too much of that, :

Re: pluralization idea that keeps bugging me

2008-01-26 Thread Jonathan Lang
Larry Wall wrote: Any other cute ideas? If you have '\s', you'll also want '\S': $n cat\s fight\S # 1 cat fights; 2 cats fight I'm not fond of the 'ox\soxen' idea; but I could get behind something like '\sox oxen' or 'ox\sen'. '\sa b' would mean 'a is singular; b is plural' '\sa' would be

Re: pluralization idea that keeps bugging me

2008-01-26 Thread Jonathan Lang
Gianni Ceccarelli wrote: Please don't put this in the language. The problem is harder than it seems (there are European languages that pluralize differently on $X % 10, IIRC; 0 is singular or plural depending on the language, etc etc). -snip- I know Perl is not minimal, but sometimes I feel

Re: pluralization idea that keeps bugging me

2008-01-26 Thread Jonathan Lang
Yuval Kogman wrote: You can subclass the grammar and change everything. Theoretically that's a yes =) Right. One last question: is this (i.e., extending a string's grammar) a keep simple things simple thing, or a keep difficult things doable thing? -- Jonathan Dataweaver Lang

Re: Definition of Order in S29

2008-01-24 Thread Jonathan Lang
Thom Boyer wrote: The enumerations and the numerical values are both in correct order. Since abc is less than xyz, abc cmp xyz is being invoked with its arguments in increasing order, So it returns Order::Increase. That numifies to -1 because that's how less-than is usually encoded. Others

Re: Instance and Class disambiguation?

2008-01-20 Thread Jonathan Lang
Ovid wrote: If I call this: if $class.^can('wibble') { ... } Does Perl 6 return false if that's only an instance method? Will the WALK iterator returned by .^can return references to instance methods? As I understand it, Perl 6 generally doesn't bother with the class-vs-instance

Re: S02 interpolation of entire hashes

2008-01-07 Thread Jonathan Lang
Dave Whipp wrote: The tests in S02 LS02/Literal/In order to interpolate an entire hash appear to assume that an interpolated hash renders its keys in a sorted order. But this property doesn't seem to be stated in the text. Is it true that the keys are always sorted for interpolation? (is it

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-04 Thread Jonathan Lang
Joe Gottman wrote: On the other hand, this being Perl, I do believe it should be easy to specify the concurrent case. I think that a forall keyword (and a givenall keyword corresponding to given) would be a good idea. These would not be quite parallel to for and given because there would

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-04 Thread Jonathan Lang
Dave Whipp wrote: No, you're not the only person thinking Occam ... though I should point out that none of my suggestions are par blocks -- a par block made every statement within the block execute in parallel with the other statements in that block (much like a Verilog fork/join pair). No;

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-04 Thread Jonathan Lang
Larry Wall wrote: I (impersonally) believe that hyper context is the right solution to this because context can propagate to where it needs to dynamically. As for the fact that it's not the default list context for for, that could easily be changed with a pragma. Maybe that could even be the

Re: Multiline comments in Perl6

2008-01-02 Thread Jonathan Lang
Paul Hodges wrote: http://perl6.org/doc/design/syn/S02.html still says: Intra-line comments will not be supported in standard Perl This is wrong, since S02 also defines intra-line comments, under Whitespace and Comments. It calls them 'embedded comments'. You don't need a 'use' statement.

Re: Multiline comments in Perl6

2008-01-02 Thread Jonathan Lang
I've been putting a fair amount of thought into this. Here's what I've come up with: Perl 6 has several instances where whitespace is required or forbidden in order to better facilitate Do What I Mean programming: for instance, by having the presence or absence of whitespace before curly braces

Re: Multiline comments in Perl6

2008-01-02 Thread Jonathan Lang
Jonathan Lang wrote: How about '~#', meaning something along the lines of string-like comment? The idea is that the syntax that follows this would conform closely to that of string literals (i.e., quotes). We might even consider loosening the restrictions on delimiter characters, allowing

Re: Multiline comments in Perl6

2007-12-30 Thread Jonathan Lang
Amir E. Aharoni wrote: On 30/12/2007, Jonathan Lang [EMAIL PROTECTED] wrote: The only wart is that '#( ... )' cannot begin at the very start of a line; but it's easy enough to get around that restriction - say, with some leading whitespace. Thanks for the reply - can you please what

Re: Multiline comments in Perl6

2007-12-30 Thread Jonathan Lang
Offer Kaye wrote: #( commenting out a large code section, yey for Perl6 multi-line comments... if ($foo) { print ...or not :(\n } ) # this should have been the end of the embedded comment ...and since it wasn't, you probably should have chosen other brackets such as: #[[

Factoring Arguments

2007-12-21 Thread Jonathan Lang
I'm thinking aloud here, so please bear with me. A number of languages have a with ... construct that's intended to cut down on repetitive typing, by factoring the invocant out of every method call. Perl 6 also has this, in the form of given ...: given $foo.bar.baz { .dothis();

Re: Concerns about {...code...}

2007-12-21 Thread Jonathan Lang
Dave Whipp wrote: If the construct is used only rarely then it should have a longer name, Actually, Huffman coding implies that if the construct is used regularly then it should have a short name. It does not mandate a long name for rare constructs; it merely says that if a given short name is

Re: Factoring Arguments

2007-12-21 Thread Jonathan Lang
Ryan Richter wrote: Jonathan Lang wrote: and so on, you might do something like: with qq :(c = false) { I think this can be done with normal currying, something like temp circumfix: := quote:qq.assuming(:!c); That handles the specific example that I had in mind, but does so

Re: perl 6 grammar

2007-12-04 Thread Jonathan Lang
Another thing to note about given ... when: you don't have to use them together. All that given does is to set $_ to the variable provided; this can be used in a manner similar to with statements in other languages. And when doesn't have to be inside a given block, either: it can be used in any

Re: , , and backtracking.

2007-09-06 Thread Jonathan Lang
Jonathan Scott Duff wrote: How do C and C differ with respect to backtracking? For instance, foobar ~~ / [a..z]+ [ ... ] /; Both sides of the C happen in parallel, so I would guess that they both match foo then stop. Please correct me if that's wrong. As written, this match would

Re: [svn:perl6-synopsis] r14447 - doc/trunk/design/syn

2007-09-06 Thread Jonathan Lang
So 'orelse' is exactly like '//', except that the result of the left side gets passed to the right side as an error message. Is there a reason to make this exception, as opposed to altering '//' to behave exactly like 'orelse' does? -- Jonathan Dataweaver Lang

Re: [svn:perl6-synopsis] r14447 - doc/trunk/design/syn

2007-09-06 Thread Jonathan Lang
Larry Wall wrote: Jonathan Lang wrote: : So 'orelse' is exactly like '//', except that the result of the left : side gets passed to the right side as an error message. Is there a : reason to make this exception, as opposed to altering '//' to behave : exactly like 'orelse' does? How 'bout

Re: A problem about IPC::Open2

2007-07-01 Thread Jonathan Lang
Admittedly, that wasn't particularly germane to the perl6 mailing list; but it did bring up an issue that's been bothering me for a while. I would like to see Perl6 handle the equivalent of IPC::Open2 using the same sort of syntax and semantics that it uses for sockets, by default. That is, I'd

Re: Referring to source code within Perldoc

2007-06-25 Thread Jonathan Lang
David Green wrote: (Unless I'm missing something, which is always possible; you can put a piece of POD geographically next to a Perl declaration, but I'm not sure that's unambiguous enough. Hm, why not? POD doesn't know what's going on around it, but Perl does, and could say, I've just

Re: [svn:perl6-synopsis] r14421 - doc/trunk/design/syn

2007-06-22 Thread Jonathan Lang
Mark Overmeer wrote: * Damian Conway ([EMAIL PROTECTED]) [070622 09:02]: Mark Overmeer wrote: Then, when you want to add some docs to the method, to help the correct use, add it, for instance like: method isValidPostalCode(str $postalcode) returns bool {...} ` Check wether the

Re: Referring to source code within Perldoc: the new A code

2007-06-22 Thread Jonathan Lang
OK. After much thinking on the subject, here are my recommendations: First: give Pod the ability to delimit blocks of ambient text, e.g.: =text class Foo { has $bar; } =stop '=text' and '=stop' would be considered to be separate but related single-line Pod Sections, so Pod-stripping

Quirky comments

2007-06-16 Thread Jonathan Lang
In [svn:perl6-synopsis] r14421 - doc/trunk/design/syn, Damian Conway wrote: brian wrote: So, if this is the case, how will a new Perl 6 user debug a program failure when part of their program mysteriously disappears because they just happened to have =begin at the beginning of a line? The

Re: [svn:perl6-synopsis] r14421 - doc/trunk/design/syn

2007-06-16 Thread Jonathan Lang
brian d foy wrote: Whereas the rule you have to teach under the Integration model is: We don't teach any rule under this model, and it's been fine for over a decade :) When we do teach the current Pod, the simple rule is that Pod starts: * when Perl is expecting a new statement * there

Re: [svn:perl6-synopsis] r14421 - doc/trunk/design/syn

2007-06-16 Thread Jonathan Lang
Jonathan Lang wrote: Which is not to say that there isn't a time and place when ease of implementation should trump ease of programming; taking an extreme example, being able to write a program that consists of the single line: attend my every wish is the ultimate in terms of ease

Re: Quirky comments

2007-06-16 Thread Jonathan Lang
Larry Wall wrote: I have a problem with both extremes, and I want to solve it with a dose of postmodern apathy. It may seem a bit insane, but I think that in print qq:to/END/ =for whatever END I would prefer that the =for is considered Pod by any standard Pod parser, but is

Re: [svn:perl6-synopsis] r14421 - doc/trunk/design/syn

2007-06-14 Thread Jonathan Lang
I'm going to stay away from the POD referencing Perl debate for the time being. Instead, a couple of thoughts: 1. It has always been my understanding that comments intimately relate to documentation, despite being part of Perl's syntax. As such, they are a technical violation of this

Re: [svn:perl6-synopsis] r14421 - doc/trunk/design/syn

2007-06-14 Thread Jonathan Lang
Larry Wall wrote: So I think a named reference is a good compromise, where the name in the documentation (in some easily recognized syntactic form) refers to the next declaration (or set of declarations) of that same name. Hopefully the pod either knows implicitly or has been told explicitly how

Re: [svn:perl6-synopsis] r14421 - doc/trunk/design/syn

2007-06-13 Thread Jonathan Lang
[EMAIL PROTECTED] wrote: +Block comments may be nested within other block comments (with the +same or differing brackets). POD comments may also be nested within +block comments. (These are still visible to the POD parser; if you +wish to comment out a block of mixed POD and Perl 6 code,

Re: Generalizing ?? !!

2007-06-13 Thread Jonathan Lang
Charles Bailey wrote: I'm concerned that the relevant precedent isn't just Perl5. The ?: spelling of the ternary is pretty deeply embedded in programming languages -- I'm hard pressed to think of a widely used language in the past 10-15 years that spells it differently (though that may say more

Re: Generalizing ?? !!

2007-06-11 Thread Jonathan Lang
Audrey Tang wrote: Jonathan Lang wrote: A variation of chaining associativity gets used, with the chaining rule being '$v1 op1 $v2 // $v1 op2 $v3' instead of '$v1 op1 $v2 $v2 op2 $v3', as is the case for comparison chaining. But wouldn't that make: True ?? undef !! Moose; evaluate

Re: Generalizing ?? !!

2007-06-11 Thread Jonathan Lang
[EMAIL PROTECTED] wrote: Besides ?? !! with out an else part is just . No, it isn't. While behaves properly when the condition turns out to be true, the result of the condition turning out to be false is whatever the condition turned out to be. Still, Damian has a good point - which renders

Generalizing ?? !!

2007-06-10 Thread Jonathan Lang
Rereading A03, I ran across the original reasoning behind why Perl 5's '?:' trinary operator became '?? ::' first, and then '?? !!'. Three reasons were given: * the '?' and ':' tokens are far too broadly useful to be gobbled up by the trinary operator. * the doubled symbols bring to mind the

Re: [svn:perl6-synopsis] r14415 - doc/trunk/design/syn

2007-06-05 Thread Jonathan Lang
Larry Wall wrote: : * In item context, a list of captures becomes a single Array object, : and the question about whether or not it gets flattened gets deferred : until its contents get looked at in list, slice, or hash context. That's the intent. $() used to assume @@ inside till this latest

Re: [svn:perl6-synopsis] r14415 - doc/trunk/design/syn

2007-06-05 Thread Jonathan Lang
Jonathan Lang wrote: Arguably list should be non-committal and we give @() a different name like flat, but that grates in my brain for some reason, if only because most list contexts would in the end be flat anyway. And list in English already implies something flatter than, say

Re: 'x' vs. 'xx'

2007-06-03 Thread Jonathan Lang
Chas Owens wrote: Jonathan Lang wrote: Chas Owens wrote: Jonathan Lang wrote: Is there any reason why we can't simply define '$a x $n' as being shorthand for 'cat($a xx $n)'? In what way does the former differ from the latter, other than the use of a Whatever in place of $n

Re: 'x' vs. 'xx'

2007-06-03 Thread Jonathan Lang
Chas Owens wrote: I am almost certain that the following code is in list context. pugs my @a = '-' x 5, 'foo', '-' x 5; pugs @a (-, foo, -) pugs my @b = cat('-' xx 5), 'foo', cat('-' xx 5) (-, -, -, -, -, foo, -, -, -, -, -) However, it does seem that Pug's version of cat does not

Re: 'x' vs. 'xx'

2007-06-03 Thread Jonathan Lang
Mark J. Reed wrote: Is item context what we're calling scalar these days, or something else? According to S03, it does indeed appear that item context is the current terminology for what perl 5 called scalar context: The item contextualizer item foo() The new name for Perl 5's scalar

Re: 'x' vs. 'xx'

2007-06-03 Thread Jonathan Lang
a really compelling reason. ...with x always corresponding to the first and xx always corresponding to the second, right? In essence, x always produces a string, while xx always produces a list. Jonathan Lang wrote: Personally, I would tend to favor the notion that infix:x always produces

Re: [svn:perl6-synopsis] r14415 - doc/trunk/design/syn

2007-06-03 Thread Jonathan Lang
[EMAIL PROTECTED] wrote: Author: larry Date: Sun Jun 3 17:23:15 2007 New Revision: 14415 Modified: doc/trunk/design/syn/S03.pod doc/trunk/design/syn/S04.pod doc/trunk/design/syn/S06.pod Log: typo from Aaron Crane++ s/cat/list/ for flattening captures in order cat() now only produces

'x' vs. 'xx'

2007-06-02 Thread Jonathan Lang
Is there any reason why we can't simply define '$a x $n' as being shorthand for 'cat($a xx $n)'? In what way does the former differ from the latter, other than the use of a Whatever in place of $n? -- Jonathan Dataweaver Lang

Re: 'x' vs. 'xx'

2007-06-02 Thread Jonathan Lang
Chas Owens wrote: Jonathan Lang wrote: Is there any reason why we can't simply define '$a x $n' as being shorthand for 'cat($a xx $n)'? In what way does the former differ from the latter, other than the use of a Whatever in place of $n? $a x $n is equivalent to join '', $a xx $n

Purging [-1]

2007-05-25 Thread Jonathan Lang
I just went through all of the synopses searching for instances where [-1] is still being referenced in its perl5 sense; the following patches update them to correct perl6 syntax. I also took the liberty of fixing up a markup glitch in S03.pod. =begin S02 @@ -1379,7 +1379,7 @@ =item * -The

Re: [svn:perl6-synopsis] r14401 - doc/trunk/design/syn

2007-05-24 Thread Jonathan Lang
Darren Duncan wrote: Jonathan Lang wrote: I see no mention of C@@x in this section. I would assume that C@@x may be bound to any object that does the CMultidimensional role, with a note to the effect that the CMultidimensional role does the CPositional role (and thus anything that C@x may

Re: [svn:perl6-synopsis] r14401 - doc/trunk/design/syn

2007-05-24 Thread Jonathan Lang
Perhaps it's better to think of '@' and '@@' as working with different contexts. S02 says that there are three main contexts (void, scalar, and list); that scalar context has a number of sub-contexts (boolean, integer, number, and string), and that list context has a number of sub-contexts based

Re: [S02] Sigils

2007-05-24 Thread Jonathan Lang
Larry Wall wrote: Well, it's already too easy, but the problem I have with it is not that. My problem is that sigil:@ is the name of a very specific syntactic notion, while Positional is the name of a very generic semantic notion. I don't think those levels should be confused. Fair enough.

Re: [svn:perl6-synopsis] r14401 - doc/trunk/design/syn

2007-05-23 Thread Jonathan Lang
[EMAIL PROTECTED] wrote: Sigils indicate overall interface, not the exact type of the bound +object. Different sigils imply different minimal abilities. I see no mention of C@@x in this section. I would assume that C@@x may be bound to any object that does the CMultidimensional role, with a

[S02] Sigils

2007-05-23 Thread Jonathan Lang
From S02: -- Perl 6 includes a system of Bsigils to mark the fundamental structural type of a variable: $ scalar (object) @ ordered array % unordered hash (associative array) code/rule/token/regex :: package/module/class/role/subset/enum/type/grammar @@ multislice

Re: [svn:perl6-synopsis] r14399 - doc/trunk/design/syn

2007-05-22 Thread Jonathan Lang
Some additional suggestions for S02: -- @@ -740,9 +740,9 @@ Range A pair of Ordered endpoints; gens immutables when iterated Set Unordered group of values that allows no duplicates Bag Unordered group of values that allows duplicates -JunctionSets with

Re: explicit line termination with ;: why?

2007-05-15 Thread Jonathan Lang
Larry Wall wrote: Dave Whipp wrote: : A slightly tangental thought: is the behavior of Cgiven with no block : defined? I.e. is It would be illegal syntax currently. As I understand it, the proposal is to say that if the parser finds a ';' where it was expecting to find a control block, it

Re: explicit line termination with ;: why?

2007-05-14 Thread Jonathan Lang
gabriele renzi wrote: Hi everyone, I don't want to argue about the design of perl6, I just wonder: why the semicolon is still needed in the end of lines in perl6? It isn't - sometimes. S03 identifies a number of ways that an expression can be terminated: the semicolon (';'), a block-final

Re: Sigils by example (was: Re: Is Perl 6 too late?)

2007-05-14 Thread Jonathan Lang
Good examples. Now could you provide some to explain to me why it's important to distinguish between '$', '@', '%', and ''? I ask because I've seen a lot of object-based code that has said stuff like '$container{$key}'; it seems that there's an assumption that $foo can be used as a list, a

Re: explicit line termination with ;: why?

2007-05-14 Thread Jonathan Lang
Jonathan Lang wrote: ^[3]: If this were included in the core, you might even reverse things so that ';' is defined in terms of postfix:. or infix:{'=='}, depending on the context; in this case, postfix:? would be defined in terms of postfix:., rather than postfix:;. In fact, the only thing

Re: Sigils by example (was: Re: Is Perl 6 too late?)

2007-05-14 Thread Jonathan Lang
Mark J. Reed wrote: Jonathan Lang wrote: Good examples. Now could you provide some to explain to me why it's important to distinguish between '$', '@', '%', and ''? I ask because I've seen a lot of object-based code that has said stuff like '$container{$key}'; Well, $container{$key

Re: explicit line termination with ;: why?

2007-05-14 Thread Jonathan Lang
On 5/14/07, Daniel Hulme [EMAIL PROTECTED] wrote: On Mon, May 14, 2007 at 02:29:11PM -0700, Jonathan Lang wrote: 2. This brings up the possibility of custom-designed termination operators. cf. Semi::Semicolons. Close. I'm thinking added functionality for semicolon alternatives rather than

Re: Default filehandles, or topicalizing filehandles, or something

2007-05-01 Thread Jonathan Lang
On 5/1/07, brian d foy [EMAIL PROTECTED] wrote: I was thinking about default filehandles yesterday. select() doesn't seem to be around except as an Unfiled function in S16. Then, as I was looking at .say( Hello World ); At various times, I have seen something to the effect of each of the

Re: S12: can(), signatures and casting

2007-04-30 Thread Jonathan Lang
Larry Wall wrote: The fundamental problem here is that we're forcing a method name to be represented as a string. We're basically missing the foo equivalent for methods. Maybe we need to allow the indirection on method names too: if $obj.fribble:(Str -- BadPoet) { Takes a little

Re: S12: can(), signatures and casting

2007-04-30 Thread Jonathan Lang
Larry Wall wrote: Maybe we need to allow the indirection on method names too: if $obj.fribble:(Str -- BadPoet) { -snip- Note that we already define foo:(Int, Str) to return a list of candidates if there's more than one, so extending this from the multi dispatcher to the single

Re: S12: can(), signatures and casting

2007-04-29 Thread Jonathan Lang
Ovid wrote: My apologies if these have been answered. I've been chatting with Jonathan Worthington about some of this and any misconceptions are mine, not his. In reading through S12, I see that .can() returns an iterator for the methods matched. What I'm curious about is this: if

Re: File test operators as Pairs

2007-04-13 Thread Jonathan Lang
Luke Palmer wrote: These things are methods, and I'm not sure why we've crammed them into smart match. Things like :M have nothing to do with matching. What would it mean if smart match returned false? This file has not been modified ever? :e has a bit more merit for a smart match, but the

Re: Should a dirhandle be a filehandle-like iterator?

2007-04-13 Thread Jonathan Lang
brian d foy wrote: As I was playing around with dirhandles, I thought What if... (which is actualy sorta fun to do in Pugs, where Perl 5 has everything documented somewhere even if nobody has read it). My goal is modest: explain fewer things in the Llama. If dirhandles were like filehandles,

Re: Should a dirhandle be a filehandle-like iterator?

2007-04-13 Thread Jonathan Lang
Geoffrey Broadwell wrote: Jonathan Lang wrote: Also: why distinguish between open and opendir? If the string is the name of a file, 'open' means open the file; if it is the name of a directory, 'open' means open the directory. If it's the name of a pipe, it opens the pipe. And so

Re: Should a dirhandle be a filehandle-like iterator?

2007-04-13 Thread Jonathan Lang
Uri Guttman wrote: JL == Jonathan Lang [EMAIL PROTECTED] writes: JL Please. I've always found the opendir ... readdir ... closedir set JL to be clunky. JL Also: why distinguish between open and opendir? If the string is JL the name of a file, 'open' means open the file

[S03] Negation metaoperator

2007-04-06 Thread Jonathan Lang
Generalize the negated relational operators to apply to any infix operator that returns a boolean. In terms of the standard operators, this will add || ^^ // and or xor err to the family that is implicitly equipped with logical negations. For consistency's sake, you may also want to define

[S03] Range Semantics

2007-04-05 Thread Jonathan Lang
Inspired by the new array indexing syntax from S09. Modify S03 (under Range Semantics) so that if a Range is operating in a bounded space, a 'whatever' star as the starting or ending point maps to the lower or upper bound: my enum Months «:Jan(1) Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec»

Re: [svn:perl6-synopsis] r14359 - doc/trunk/design/syn

2007-04-04 Thread Jonathan Lang
[EMAIL PROTECTED] wrote: +Arrays may also be defined with a mixture of fixed and autoextending +dimensions: + +my @calendar[12;*;24]; # Month dimension unlimited + + Move this out of the section on fixed-length arrays and into the section on multidimensional arrays; it fits most

Enhanced enumerations

2007-03-19 Thread Jonathan Lang
Some (many?) enumerations represent cycles, where incrementing from the last element takes you back to the first: the seasons, the months, the days of the week, the hues, etc. How hard would it be to write a module that lets you say something like: enum weekdays is cycle Sun Mon Tue Wed Thu

Re: [S09] Whatever indices and shaped arrays

2007-03-07 Thread Jonathan Lang
OK: before I submit a patch, let me make sure that I've got the concepts straight: @x[0] always means the first element of the array; @x[-1] always means the last element of the array; @x[*+0] always means the first element after the end of the array; @x[*-1] always means the first element

Re: [S09] Whatever indices and shaped arrays

2007-03-06 Thread Jonathan Lang
Larry Wall wrote: I like it. I'm a bit strapped for time at the moment, but if you send me a patch for S09 I can probably dig up a program to apply it with. :) Could someone advise me on how to create patches? -- Jonathan Dataweaver Lang

Re: for ... else

2007-03-05 Thread Jonathan Lang
Larry Wall wrote: On Mon, Mar 05, 2007 at 04:13:16PM +1030, Tom Lanyon wrote: : Sounds like the following will work, but it doesn't seem 'nice'. : : for @invoice : { : .process; : 1; : } or fail 'No invoices to process'; Still think if there's no invoices it logically should be tested first.

Re: for ... else

2007-03-04 Thread Jonathan Lang
herbert breunung wrote: Von: Thomas Wittek [EMAIL PROTECTED] That's, well, elegant! Yes. Because and but it's tricky. Nothing where I'd say wow, thats an easy solution to my problem!. It's a bit complicated, because you have to understand and combine several concepts. That's elegant. But

Re: for ... else

2007-03-04 Thread Jonathan Lang
Jonathan Lang wrote: Seconded. I would favor allowing an else block to be attached following any loop block, with the semantics being that the else block only gets triggered if the loop block doesn't run at least once. I'd do this instead of a block trait (such as FIRST or LAST) because

Re: for ... else

2007-03-04 Thread Jonathan Lang
Daniel Brockman wrote: What about this? given @foo { for $_ - $x { ... } when .empty { ... } } You can reverse the order if you want: given @foo { when .empty { ... } for $_ - $x { ... } } Actually, you'd be better off using the second order; the when

Re: for ... else

2007-03-04 Thread Jonathan Lang
Rick Delaney wrote: Smylers wrote: for @invoice { .process; } or fail 'No invoices to process'; If that actually works then I'm happy. It's dependent on .process not returning a false on the final iteration. -- Jonathan Dataweaver Lang

statement modifiers

2007-03-04 Thread Jonathan Lang
The text of S02, S03, and S04 still contain references to the now-defunct statement_modifier grammatical category. Also, what's the reasoning behind specifically disallowing _all_ statement modifiers to do blocks (as opposed to forbidding just looping statement modifiers)? Is this legacy from

Compound grammar

2007-03-04 Thread Jonathan Lang
AFAICT, there's nothing in the documentation to explain how one would define a statement or operator with syntax along the lines of if ... else ... or ... ?? ... :: ... Admittedly, the only cases I know of where this is still an issue are the two listed above: for statements, all other perl 5

Re: statement modifiers

2007-03-04 Thread Jonathan Lang
Larry Wall wrote: Jonathan Lang wrote: : Larry Wall wrote: : : Finally: when used as a statement modifier, is given considered to : : be conditional or looping? (Gut instinct: conditional.) : : Why does it have to be one or the other? It's just a topicalizer. : : One implication of replacing

Re: [S09] Whatever indices and shaped arrays

2007-02-27 Thread Jonathan Lang
David Green wrote: On 2/24/07, Jonathan Lang wrote: In effect, using * as an array of indices gives us the ordinals notation that has been requested on occasion: '*[0]' means 'first element', '*[1]' means 'second element', '*[-1]' means 'last element', '*[0..2]' means 'first three elements

Re: What criteria mark the closure of perl6 specification

2007-02-25 Thread Jonathan Lang
Smylers wrote: Richard Hainsworth writes: When does the specification of perl6 come to an end? At a guess: when it's implemented. Many of the recent changes have been made by Larry in response to his trying to write the grammar, and encountering problems. With all due respect: Once the

Re: [S09] Whatever indices and shaped arrays

2007-02-24 Thread Jonathan Lang
Jonathan Lang wrote: Larry Wall wrote: : If you want the last index, say '*[-1]' instead of '* - 1'. : If you want the first index, say '*[0]' instead of '* + 0'. So the generic version of leaving off both ends would be *[1]..*[-2] (ignoring that we'd probably write *[0]^..^*[-1

[S09] Whatever indices and shaped arrays

2007-02-23 Thread Jonathan Lang
From S09: When you use * with + and -, it creates a value of Whatever but Num, which the array subscript interpreter will interpret as the subscript one off the end of that dimension of the array. Alternately, *+0 is the first element, and the subscript dwims from the front or back depending on

Re: [S09] Whatever indices and shaped arrays

2007-02-23 Thread Jonathan Lang
Larry Wall wrote: On Fri, Feb 23, 2007 at 10:49:34AM -0800, Jonathan Lang wrote: : That said, I think I can do one better: : : Ditch all of the above. Instead, '*' always acts like a list of all : valid indices when used in the context of postcircumfix:[ ]. Ooh, shiny! Or at least, shiny

Y not

2007-02-21 Thread Jonathan Lang
Luke Palmer wrote: % as the mod operator is a good example of what you describe. There's no need for mod to be a symbolic operator: when you read 5 % 3 you say 5 mod 3. Why would we not write 5 mod 3: it is just as obvious what and how we are doing this operation. And % is uncommon enough that

Re: Y not

2007-02-20 Thread Jonathan Lang
Thomas Wittek wrote: Larry Wall schrieb: I think the ¥ and Y operators are going to have to change to something else. Very probably I missed something as I'm only a distant observer of the Perl6 development: Why not just call it zip?! There is a function called zip, wouldn't it be possible to

Re: Y not

2007-02-20 Thread Jonathan Lang
Damian Conway wrote: I'd be more inclined to go the other way and say that you can transform any list infix form to the corresponding function form: @a ZZ @b ZZ @c - zip operator ZZ(@a; @b; @c) - zip function @a XX @b XX @c - cross operator XX(@a; @b; @c) - cross

Re: Negative fraction subscripts

2007-01-30 Thread Jonathan Lang
Larry Wall wrote: TSa wrote: : Luke Palmer wrote: : When do we do integer/rational math and when do we do floating point math? : : Since we have now flooring semantics on modulus and division I wonder : how the coercion of nums to ints takes place. Does it also use floor? : E.g. is @array[-0.3]

  1   2   3   4   >