Re: Transparent / Opaque references

2005-05-27 Thread Brent 'Dax' Royal-Gordon
Juerd <[EMAIL PROTECTED]> wrote: > There is no way to get an anonymous rw scalar, is there? There's always the Perl 5 hack: \do { my $x } Although that's not truly anonymous, I suppose. -- Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> Perl and Parrot hacker

Re: comprehensive list of perl6 rule tokens

2005-05-27 Thread Jeff 'japhy' Pinyan
In regards to http://www.nntp.perl.org/group/perl.perl6.language/21120 which discusses character class syntax in Perl 6, I have some comments to make. First, I've been very interested in seeing proper set notation for char classes in Perl 5. I was pretty vocal about it during TPC in 2002, I

Re: Transparent / Opaque references

2005-05-27 Thread Ashley Winters
On 5/27/05, Juerd <[EMAIL PROTECTED]> wrote: > > There is no way to get an anonymous rw scalar, is there? Can't the [] and {} syntaxes be considered aliases for new Array(...) and new Hash(...)? my $x := new int = 10; # looks like it should work Ashley Winters

Re: Transparent / Opaque references

2005-05-27 Thread Juerd
Juerd skribis 2005-05-28 1:15 (+0200): > There are named arrays, @foo, and anonymous arrays, []. > > There are named hashes, %foo, and anonymous hashes, {}. > > There are only anonymous pairs. You can't dereference a pair, or bind a > name to it. I forgot an important one: There are named sca

Re: Transparent / Opaque references

2005-05-27 Thread Juerd
Luke Palmer skribis 2005-05-27 20:59 (+): > Opaque references always need to be explicitly dereferenced (except > for binding an array to an array reference, etc.). Transparent > references always automatically dereference. The decision of what > type of dereferencing will go on is left up to

Default invocant of methods

2005-05-27 Thread Ingo Blechschmidt
Hi, what is the default invocant of methods? method blarb ($normal_param) {...} # Same as method blarb (Class | ::?CLASS $invocant: $normal_param) {...} # or method blarb (::?CLASS $invocant: $normal_param) {...} # ? I prefer the latter, as then one can't accidentally call a instance

Transparent / Opaque references

2005-05-27 Thread Luke Palmer
When we heard that Larry didn't acutally want $$foo to infinitely dereference, some of us were overjoyed, and others severely disappointed. Both transparent dereferencing (infinite $$foo) and opaque dereferencing (one-level $$foo) have their uses, but they are definitely distinct. Instead of addi

Re: [S29] uniq

2005-05-27 Thread TSa (Thomas Sandlaß)
Luke Palmer wrote: So I suppose that's my proposal. Allow, even encourage, overloading of =:=, but only for value types. I've been thinking that we ought to provide a standard role for making something a value type. Maybe it would require definition of =:=. I would like to propose something

Re: Declarations of constants

2005-05-27 Thread Ingo Blechschmidt
Hi, "TSa (Thomas Sandlaß)" wrote: > Ingo Blechschmidt wrote: >> Or did you simply forget the braces around 42? :) > > No, it was intented for seeing what the reactions will be :) :) > Just using &foo as unsigiled variable. This might need > > my &foo is rw; I don't think this will DWYW, as fi

Re: Unicode Operators cheatsheet, please!

2005-05-27 Thread Gaal Yahas
On Fri, May 27, 2005 at 10:29:39AM -0400, Rob Kinyon wrote: > I would love to see a document (one per editor) that describes the > Unicode characters in use and how to make them. The Set implementation > in Pugs uses (at last count) 20 different Unicode characters as > operators. Good idea. A mode

Re: Declarations of constants

2005-05-27 Thread TSa (Thomas Sandlaß)
Ingo Blechschmidt wrote: is that allowed (as 42 is a Num (or an Int), not a Code)? I don't know, but guess not. Do (most of) the basic types morph themselves into Codes, when needed? I don't consider it type morphing. If your examples parse at all they will be dispatched as usual say 4

Re: Declarations of constants

2005-05-27 Thread Ingo Blechschmidt
Hi, "TSa (Thomas Sandlaß)" wrote: > my &MEANING_OF_LIVE = 42; # But might be considered evil sigilless > mode is that allowed (as 42 is a Num (or an Int), not a Code)? Do (most of) the basic types morph themselves into Codes, when needed? say 42();# 42? say "Perl"();

Re: (1,(2,3),4)[2]

2005-05-27 Thread TSa (Thomas Sandlaß)
HaloO Juerd, you wrote: Because the alternative is to drop context. ... Then we lose the point for having different sigils, and everything gets a dollar sign. Isn't the strong type system adequate compensation? Especially when the sigils denote the level below which you can't go in untypedness

Re: Declarations of constants

2005-05-27 Thread TSa (Thomas Sandlaß)
Ingo Blechschmidt wrote: # Please add more ways :) enum ; my &MEANING_OF_LIVE = 42; # But might be considered evil sigilless mode -- TSa (Thomas Sandlaß)

Declarations of constants

2005-05-27 Thread Ingo Blechschmidt
Hi, # Way 1 my $MEANING_OF_LIFE is constant = 42; # Way 2 my &MEANING_OF_LIVE = -> () { 42 }; # or sub MEANING_OF_LIVE () { 42 } # Then one can use sigilless constants: say MEANING_OF_LIVE; # Way 3 (still possible?) use constant MEANING_OF_LIVE => 42; # Way 4 (evil?)

Re: (1,(2,3),4)[2]

2005-05-27 Thread Juerd
"TSa (Thomas Sandlaß)" skribis 2005-05-27 15:44 (+0200): > Could the ones who know it, enlighten me *why* it has to be so? > What does it buy the newbie, average, expert Perl6 programmer? > The answer "that's how Perl5 did it" is a good default, but > never hindered @Larry to change things. Becaus

Re: (1,(2,3),4)[2]

2005-05-27 Thread Juerd
"TSa (Thomas Sandlaß)" skribis 2005-05-27 16:22 (+0200): > This argumentation breaks down as soon as you regard &infix:{'='} as > an operator like many others. Which we don't, making this discussion much easier for everyone. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolutio

Re: (1,(2,3),4)[2]

2005-05-27 Thread TSa (Thomas Sandlaß)
Juerd wrote: And, assigning to a reference is impossible, as a reference is a VALUE, not a VARIABLE (container). What should hinder &infix:{'='}:(Ref, Int: --> Int) to exist and be usefull at least if the Ref is known to something that derefs it and then finds the new referee? On the Perl6 lang

Unicode Operators cheatsheet, please!

2005-05-27 Thread Rob Kinyon
I would love to see a document (one per editor) that describes the Unicode characters in use and how to make them. The Set implementation in Pugs uses (at last count) 20 different Unicode characters as operators. While I'm sure these documents exist on the web somewhere, since P6 is the first time

Re: (1,(2,3),4)[2]

2005-05-27 Thread TSa (Thomas Sandlaß)
Juerd wrote: From S02: "Array and hash variable names in scalar context automatically produce references." Since [...] produces a scalar arrayref, we end up with an arrayref one both sides of the =. No. There is no scalar context on the LHS of the assignment operator. And, assigning to a re

Re: (1,(2,3),4)[2]

2005-05-27 Thread TSa (Thomas Sandlaß)
Markus Laire wrote: @m[0;1] is a multidim deref, referencing the 4. Referencing the 2, I hope? Doh! Yes, the 2. Really? I consider this puzzling indicative that the (,) vs. [,] distinction in Perl6 falls into the same category as e.g. starting the capture variables at $1. @m here has _sin

Method overloading, MMD/SMD

2005-05-27 Thread Yuval Kogman
In Synopsis 13 MMD is discussed as the mechanism for overloading an operator. Many a times I would like to overload a method of a class. I just played around with this: http://svn.openfoundry.org/pugs/modules/Class-Events/lib/Class/Events.pm Notice how the Named event variation appends

Re: Syntax of using Perl5 modules?

2005-05-27 Thread Rod Adams
Adam Kennedy wrote: You get all those possibilities whenever you install any new version of a module you get from someone else, regardless of a p5->p6 hop. In p6, when you say "use Digest;", you are specifically asking for what p6 considers the "latest" version. In p5, it was "first match on

Re: Sets (was: Reductions, junctions, hashslices, and cribbage scoring)

2005-05-27 Thread Michele Dondi
On Thu, 26 May 2005, Patrick R. Michaud wrote: The continuing exchanges regarding junctions, and the ongoing tendency by newcomers to think of them and try to use them as sets, makes me feel that it might be worthwhile to define and publish a standard C class and operations sooner rather than la

RE: (OT) Re: Perl development server

2005-05-27 Thread Konovalov, Vadim
> Icelandic: laukur (Incidentally, none of you will ever guess how to > correctly pronounce that.) Russian: luk (pronounced similar to English "look"). For some reason, Icelandic translation of onion is much closer to Russian than any other variants...

Re: Syntax of using Perl5 modules?

2005-05-27 Thread Adam Kennedy
You get all those possibilities whenever you install any new version of a module you get from someone else, regardless of a p5->p6 hop. In p6, when you say "use Digest;", you are specifically asking for what p6 considers the "latest" version. In p5, it was "first match on libpath". Except that