Funky «vector» operator

2004-03-19 Thread Andy Wardley
I'm so happy! I just found out, totally by accident, that I can type the « and » characters by pressing AltGr + Z and AltGr + X, respectively. Apologies if this is common knowledge, but it was news to me, and I thought I'd share this little Perl6 of wisdom. Your mileage may vary, of

Re: Mutating methods

2004-03-11 Thread Andy Wardley
Larry Wall wrote: multi sub *scramble (String $s) returns String {...} [...] Or you can just call it directly as a function: scramble(hello) Can you also call scramble as a class method? class String is extended { method scramble { ..etc... } } String.scramble(hello) A

Re: Mutating methods

2004-03-11 Thread Andy Wardley
Larry Wall wrote: Yet another approach is to *replace* dot with something that mutates: @array!sort @array?sort Either of those would work syntactically in that case, since neither ! nor ? is expected as a binary operator. What about ? is as a ternary operator: @foo?bar:baz;

Re: Semantics of vector operations

2004-02-02 Thread Andy Wardley
Luke Palmer wrote: But I'm still sure that the unicode-deficient would rather write: I suspect the unicode-deficient would rather write Ruby. Adding unicode operators to Perl will just reinforce its reputation as a line noise language. I know it has been said before, and I'm sure it will be

Re: Compiler writing tools

2004-02-02 Thread Andy Wardley
Luke Palmer wrote: I think $() will help somewhat, as will interpolating method calls, but for a compiler, I'd really like PHP-like parse switching. That is, I could do something like (I'll use $ and $ for ? and ?): Check out the new scanner module for Template Toolkit v3. It does this

Re: This week's summary

2004-01-06 Thread Andy Wardley
Uri Guttman wrote: i say we just sell them a license to use the US constitution. Bill Gates wrote: What is it with these Linux guys? i say we just sell them a license to use Windoze. :-) A

Re: enums and bitenums

2003-12-13 Thread Andy Wardley
Larry Wall wrote: Well, we can't use - because we're using that for something else. But it's certainly true that we'll have to have some mechanism for disambiguating Color.green from Blackberry.green. After all, Blackberry.green == Color.red Or maybe it's Blackberry::green ==

Re: enums and bitenums

2003-12-12 Thread Andy Wardley
Larry Wall wrote: Anyway, this all implies that use of a role as a method name defaults to returning whether the type in question matches the subtype. That is, when you say: $foo.true $bar.red [...] $bar.red [...] $baz.Byte it's asking whether the Int property fulfills

Re: Next Apocalypse

2003-09-18 Thread Andy Wardley
chromatic wrote: The thinking at the last design meeting was that you'd explicitly say Consider this class closed; I won't muck with it in this application at compile time if you need the extra optimization in a particular application. In Dylan, this is called a sealed class. It tells the

Re: Next Apocalypse

2003-09-10 Thread Andy Wardley
Jonathan Scott Duff wrote: This is mostly just a gratuitous message so that Piers has something to talk about in the next summary I bet Leon has something to say about that. Better would be We're working on X and have hashed out the details of Y but are having problems with Z Something

Re: == vs. eq

2003-04-06 Thread Andy Wardley
Tom Christiansen wrote: Anyway, all fun and games with Messrs Engineer and Mathematician, you still want to find some sensible way of comparing lazily evaluated infinite lists so that you could get some sort of answer. But what is that answer? Or what is *an* answer? Can there even *be*

Re: Embedded foreign syntax (was Re: P6ML?)

2003-03-27 Thread Andy Wardley
Miko O'Sullivan wrote: We already have the ability to embed foreign languages (XML, HTML, whatever) using here docs: $myml = MyXmlParser-new( '(MARKUP)'); thingy blahblah blah/blah /thingy (MARKUP) True, but what kind of magic is hiding inside MyXmlParser? One problem is

Re: P6ML?

2003-03-26 Thread Andy Wardley
Robin Berjon wrote: But as someone that also had to parse other people's random formats before we had XML, I would like to stress strongly the fact that the current situation is *much* better than it was. True, but you're also missing the point that XML is a festering pile of steaming camel

Re: P6ML?

2003-03-26 Thread Andy Wardley
Robin Berjon wrote: I just have yet to see someone point at one place where Perl 5 hinders XML processing in such a way that Perl 6 could help. If my understanding of the design of Perl 6 is correct, the lexer, parser and any other related components will be highly configurable and/or

Re: Object spec

2003-03-07 Thread Andy Wardley
Sam Vilain wrote: Associations *are* fundamental object things. Presenting them in terms of attributes is the real hack. Associations *are* fundamental things, but I don't think they are part of an object. They describe relationships between objects and should exist independantly and

Re: newline as statement terminator

2003-02-06 Thread Andy Wardley
Allison Randal wrote: It's a balance, like everything else in design. use Yin::Yang; s/design/life/g; A

Re: Arc: An Unfinished Dialect of Lisp

2003-01-25 Thread Andy Wardley
Adam Turoff wrote: The problem with cons/car/cdr is that they're fundemental operations. Graham *has* learned from perl, and is receptive to the idea that fundemental operators should be huffman encoded (lambda - fn). It would be easy to simply rename car/cdr to first/rest, but that loses

Re: Arc: An Unfinished Dialect of Lisp

2003-01-22 Thread Andy Wardley
On Tue, Jan 21, 2003 at 12:55:56PM -0800, Rich Morin wrote: I'm not a Lisp enthusiast, by and large, but I think he makes some interesting observations on language design. Take a look if you're feeling adventurous... I can't help feeling slightly deflated. Given the chance to re-design Lisp

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-10 Thread Andy Wardley
Paul Johnson wrote: When I later saw it using mutt in an xterm, the tilde was at the top of the character, where I was more used to seeing it and it didn't look like an arrow any more, nor did it look very good to me. Ah yes, that's the problem. On all my fonts, the tilde appears at the top

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Andy Wardley
Damian Conway wrote: Really? We don't have any trouble in Perl 5 with an = character being used in various unrelated operators: == comparison =assignment ~= match s/~=/=~/ = comma = less than or equal to But these are all roughly related to the concept

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-08 Thread Andy Wardley
Damian Conway wrote: [...] ~ and ~ Michael Lazzaro wrote: I too think this idea is fabulous. You are my hero. I also think this is semantically fabulous but syntactically slightly dubious. '~' reads 'match' in my book, so I'm reading the operators as 'match left' and 'match right'. Or

Re: PRE / POST in loops

2003-01-03 Thread Andy Wardley
Luke Palmer wrote: The difference between POST and NEXT is simply that POST fails to refrain from executing after the final iteration, while NEXT does not. Or in other words: The difference between POST and NEXT is that POST executes after the final iteration, while NEXT does not. NEXT

Re: right-to-left pipelines

2002-12-12 Thread Andy Wardley
Michael Lazzaro asked: foo $a, $b, $c, $d; # how many args? Damian Conway wrote: Yep. Can't be known unless predeclared and hence compile-time discernible. And methods can't be discerned in the presence of run-time dispatch. Is that not the purpose of an interface? That is, to specify at

Re: Unifying invocant and topic naming syntax

2002-11-20 Thread Andy Wardley
Me wrote: Well, I could argue that c) already exists in the form of passing parameters in parens. This reminds me of the Law of Demeter. It specifies what your methods should and shouldn't be able to do if you want to build a bright, shiny system that never has bugs, maintains itself, turns

Re: Unifying invocant and topic naming syntax

2002-11-19 Thread Andy Wardley
Larry Wall wrote: So I was thinking it'd be better to use something different to represent the outer topic... How about this: $_ # current topic $__ # outer topic $___ # outer outer topic ...etc... I also wondered if $= might be a suitable alias to the current

String concatentation operator

2002-11-14 Thread Andy Wardley
Quoted from Seven Deadly Sins of Introductory Programming Language Design [1] by Linda McIver and Damian Conway: We have shown over one thousand novice programming students the C/C++ expression: the quick brown fox + jumps over the lazy dog and asked them what they believe the

Re: Interfaces

2002-10-07 Thread Andy Wardley
Nicholas Clark wrote: I think that the first syntax class Car::Q is Car renames(eject = ejector_seat) is CD_Player renames(drive = cd_drive); makes it more clear that I'd like to pick and choose which methods the composite object gets from which parent. But now you've

Re: Subject-Oriented Programming

2002-10-02 Thread Andy Wardley
On Mon, Sep 30, 2002 at 11:22:02PM -0400, Michael G Schwern wrote: Last year at JAOO I stumbled on this thing called Subject-Oriented Programming which looked interesting. There are a bunch of advanced programming techniques like this that all fit under the same umbrella: * Subject

Perl 6 types: ref() vs isa() (was: Just reading up on Pike...)

2002-08-18 Thread Andy Wardley
[EMAIL PROTECTED] wrote: [...] whose type is simultaneously Cstr and Cint. Has any thought yet gone into the builtin Perl types and what they will be called in Perl 6? Will there be a difference between the Cref() of something and the type(s) that Cisa() returns? In keeping with the lower

The Past, Present and Future of Continuations (was: Perl 6 Summary)

2002-07-08 Thread Andy Wardley
A short time ago, in a nearby thread, Larry Wall wrote: Perhaps we should just explain continuations in terms of time travel. Funny. I wrote a message to this effect the other night, but decided not to send it (too tired to decide if I was talking sense or nonsense). I was about to propose

Re: Apoc 5 questions/comments

2002-06-09 Thread Andy Wardley
On Sat, Jun 08, 2002 at 06:51:19AM +1000, Damian Conway wrote: I have no doubt that, once Perl 6 is available, we'll see a rash of modules released in the Grammar:: namespace. Including Grammar::HTML and Grammar::XML. I have no doubt that, once Perl 6 is available, we'll see a rash of modules

Re: Unary dot

2002-04-16 Thread Andy Wardley
On Mon, Apr 15, 2002 at 07:24:13PM -0700, Larry Wall wrote: So the main reason that objects can function as hashes is so that the user can poke an object into an interface expecting a hash and have it make sense, to the extent that the object is willing to be viewed like that. AKA the

Re: Apocalypse 4 : The Strange Case of the STRANGE CASE

2002-01-24 Thread Andy Wardley
On Wed, Jan 23, 2002 at 08:30:41AM -0800, Larry Wall wrote: : INIT, DESTROY, AUTOLOAD, etc., all make sense to me. They really are : special blocks that normally only occur once in a file. But CATCH and : NEXT are part of normal syntax. I don't think they're any more unusual : in their

Re: RFC 118 (v1) lvalue subs: parameters, explicit assignment, and wantarray() changes

2000-08-17 Thread Andy Wardley
can fix Perl so that it can tell the above apart, then good, but I think it's a separate problem to the lvalue subs. A -- Andy Wardley [EMAIL PROTECTED] Signature regenerating. Please remain seated. [EMAIL PROTECTED] For a good time: http://www.kfs.org/~abw/

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Andy Wardley
accessing a variable as '@something' but it's actually coming from '%something'. Hence the Highlander Variables RFC which should hopefully do away with much of this confusion. A -- Andy Wardley [EMAIL PROTECTED] Signature regenerating. Please remain seated. [EMAIL PROTECTED] For a good time: http://www.kfs.org/~abw/

(Fwd) Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Andy Wardley
Darn, I sent this to perl6-announce instead of perl6-language. Let's try again. --- Forwarded mail from "Andy Wardley" [EMAIL PROTECTED] I thought very carefully about this before writing the Highlander Variables RFC, and came to the conclusion that it's a bad idea. I've read you

Re: RFC 107 (v1) lvalue subs should receive the rvalue as an argument

2000-08-16 Thread Andy Wardley
be on the function name, not on the attribute. sub foo ($value) : lvalue { } Thus the prototype covers both cases: $x-foo($y); $x-foo = $y; A -- Andy Wardley [EMAIL PROTECTED] Signature regenerating. Please remain seated. [EMAIL PROTECTED] For a good time: http

Re: Make lvalue subs the default (was Re: RFC 107 (v1) lvalue subs should receive the rvalue as an argument)

2000-08-16 Thread Andy Wardley
as such. This could, of course, be done automatically for you by a Cuse lvalue pragma, or something similar, but it shouldn't be the default case. A -- Andy Wardley [EMAIL PROTECTED] Signature regenerating. Please remain seated. [EMAIL PROTECTED] For a good time: http://www.kfs.org

Re: RFC 95 (v1) Object Classes

2000-08-12 Thread Andy Wardley
Couldn't: my $u = User.new('abw', 'Andy Wardley', '[EMAIL PROTECTED]'); just be my $u = User-new('abw', 'Andy Wardley', '[EMAIL PROTECTED]'); And: $foo.bar.baz = 10; Just be: $foo::bar::baz = 10; Yes, but the semantics change. A key feature of this proposal is that object

Re: RFC 95 (v1) Object Classes

2000-08-12 Thread Andy Wardley
Since you didn't mention it in your references, you may want to check out RFC 92, Extensible Meta-Object Protocol -- Method Search at http://tmtowtdi.perl.org/rfc/92.pod I saw it after I posted the RFC. Yes, this is exactly the kind of support that we need in the core to allow us to do

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Andy Wardley
I know other languages call it zip, but personally I dislike that name as zip() is commonly used with reference to compression. Although I do not have a good alternative. fold() and unfold()? merge() and cleave()? A

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Andy Wardley
Spinning off from Larrys syntactic comment and Mike Pastores example, how about some of the following: How about any variable created in UPPER case is a constant? Quite restrictive, and likely to screw many things up, admittedly, but it's an easy rule to remember and one which is generally

Re: RFC 57 (v1) Subroutine prototypes and parameters

2000-08-08 Thread Andy Wardley
In the meantime, is there a reason the suggestion of: foo($x := 10, $y := 20) was dropped? It seems pretty obvious to me. Or what about: No, nothing's been dropped. I'll summarise all suggestions that don't otherwise get toasted in the next version of the RFC. A

Re: RFC 55 (v1) Compilation: Remove requirement for fina

2000-08-08 Thread Andy Wardley
So I have to delete $INC{ $file } before I require it. There are other ways I could easily do the same thing (the Data::Dumper approach for one). A -- Andy Wardley [EMAIL PROTECTED] Signature regenerating. Please remain seated. [EMAIL PROTECTED] For a good time: http://www.kfs.org/~abw/

Re: New Group proposed: subs (was Re: named parameters)

2000-08-04 Thread Andy Wardley
Before it's too late - please, don't impose either '$self' or '$this', but make this a per-module choice. I deal with people of both these religions... What about '$me'? It ties in nicely with 'my' (although perhaps for the wrong reasons), it's half as much typing as 'self' or 'this' and

Re: RFC: Highlander Variables

2000-08-03 Thread Andy Wardley
suggesting that this would one possible way for the Perl5-Perl6 translator to handle the case where a script uses more than one variable of the same name. It would need to change the name of one or more of the variables to avoid conflict. @array would still be @array. A -- Andy Wardley [EMAIL