Re: S02 mistake re Blob?

2015-02-21 Thread Jonathan Lang
On Feb 21, 2015, at 2:45 AM, Moritz Lenz 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 >> for an e

Re: Unexpected expansion of string with xx

2013-12-21 Thread Jonathan Lang
On Dec 21, 2013, at 12:00 AM, Moritz Lenz 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, yeah. On a r

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

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

Re: Commensurability as Key

2013-08-23 Thread Jonathan Lang
On Aug 23, 2013, at 2:41 AM, Steve Pitchford 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 > meaningless. 1kg or 1m of w

Re: How to make a new operator.

2012-03-24 Thread Jonathan Lang
On Mar 24, 2012, at 6:36 PM, Stefan O'Rear wrote: > On Sat, Mar 24, 2012 at 06:16:58PM -0700, Jonathan Lang wrote: >> IMHO: if we're going to take loss of precision into account, we should do so >> explicitly. I'm a bit rusty, so forgive me if I misuse the termi

Re: How to make a new operator.

2012-03-24 Thread Jonathan Lang
On Mar 24, 2012, at 5:26 PM, Damian Conway wrote: >> Actually, that one works fine in both niecza and rakudo, since those are >> Rats. > > Oh, that's good to hear. > > It doesn't change my underlying argument however. Any operations > performed on genuine floats are going to lose precision, an

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: 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: 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 multipl

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 t

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 fi

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: 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

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 '\s' or 'ox\s'. '\s' would mean 'a is singular; b is plural' '\s' would be short for '\s<

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 encod

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 dis

Re: S02 interpolation of entire hashes

2008-01-07 Thread Jonathan Lang
Dave Whipp wrote: > The tests in S02 L > 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 possible, > in P6, for hash keys to not be compar

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 >

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).

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 keyword (and a > keyword corresponding to ) would be a good idea. > These would not be quite parallel to and because there > would be some subtle differen

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 rest

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
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' statemen

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: #[

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 > >

Re: Multiline comments in Perl6

2007-12-30 Thread Jonathan Lang
Christian Mueller wrote: > i don't know the actually state in the discussion about multiline > comments, but i would propose an idea.. a combination of POD's = and the > traditional route char... Perl 6 already has a robust system for multiline and embedded comments, as described in S02 under "Whi

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:<" "> := "e:.assuming

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(); .do

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

2007-12-07 Thread Jonathan Lang
> @@ -264,17 +264,34 @@ > The C<.next> and C<.last> methods take an optional argument giving > the final value of that loop iteration. So the old C > syntax is still allowed but is really short for C using > -indirect object syntax. > +indirect object syntax. Any block object can be used, not

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

2007-12-07 Thread Jonathan Lang
> @@ -260,6 +260,11 @@ > @evens = ($_ * 2 if .odd for 0..100); > > Loop modifiers C, C, and C also work as in Perl5. > +However, the labelled forms use method call syntax: C, etc. > +The C<.next> and C<.last> methods take an optional argument giving > +the final value of that loop iteration.

Re: perl 6 grammar

2007-12-06 Thread Jonathan Lang
Larry Wall wrote: > On Tue, Dec 04, 2007 at 08:40:10AM -0800, Jonathan Lang wrote: > : or (I think): > : > : method test ($value) { > : setup(); > : when $value { doit() } #[smart-match the calling object $_ against > $value.] > : } > > I know it used to

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

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 beha

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: &, &&, 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,

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 declare

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 uti

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

2007-06-22 Thread Jonathan Lang
Damian Conway wrote: > You gave the hint that comments are also in the parse tree. They can be. Better still, the (raw) Pod can also be kept in the parse tree...since, like comments, the Perl parser still has to recognize it, even when it's focusing on extracting Perl. ...And since the Perl p

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 wethe

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 *not*

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 ea

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

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? Th

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-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 "separat

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: [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, either

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 rend

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.

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 sh

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 alr

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 c

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 p

Re: 'x' vs. 'xx'

2007-06-03 Thread Jonathan Lang
5); print "@a"' - - - - - foo - - - - - I am against anything other than that for x or xx without 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 produ

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 s

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'

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 > > >

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&quo

'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

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 C<

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-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 base

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 C >role, with a note to the effect that the C role does >the C role (and thus anything that C<@x> may be

[S02] Sigils

2007-05-23 Thread Jonathan Lang
From S02: -- Perl 6 includes a system of B 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 view

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 C role, with a note to the

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 a

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 C 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 treats th

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 semicolo

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 h

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 t

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 hash

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: 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

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 dispa

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 get

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 $obj.can(

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 "op

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 di

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, t

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 op

[S03] Negation metaoperator

2007-04-05 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»

[S03] typo

2007-04-05 Thread Jonathan Lang
@@ -749,7 +749,7 @@ These operators compare their operands using numeric, string, or C semantics respectively, and depending on the order return one of C, C, or C -(which numerify to -1, 0, or +1). See L. +(which numerify to -1, 0, or +1). See L. =item *

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 natur

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 So that Sat++ eqv Sun

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

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. I

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 topicali

Re: statement modifiers

2007-03-04 Thread Jonathan Lang
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 "statement_modifier" with "statement_mod_cond" and

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

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 fro

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

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" stat

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

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 elega

  1   2   3   4   >