Re: Retry: ITypes and VTypes.

2005-02-05 Thread Alexey Trofimenko
On Fri, 4 Feb 2005 04:09:03 +0800, Autrijus Tang <[EMAIL PROTECTED]> wrote: ... Let's take the first one first, because it is what S06 seems to imply, although it is against Perl5's tie() intuition: my @carton is Scalar; # assuming this is the default Now @carton implements the

strictness and fully qualified global vars

2004-12-28 Thread Alexey Trofimenko
in perl5 C doesn't save us from typo bugs in code like use strict; print $OtherPackage::erroneuos_name; in perl5 C auotovivifies ${__PACKAGE__ . "::"}{var} glob at compile time, so there's something one could check with C, but to do it manually is senseless. And there are no globs in perl6.

Re: state vs my

2004-12-10 Thread Alexey Trofimenko
On Sat, 4 Dec 2004 22:03:19 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: On Sun, Dec 05, 2004 at 02:15:51AM +0300, Alexey Trofimenko wrote: : oh! that it. I've found example which could make it clear to me : : sub test { : return sub { : for 1..3 { :state $var = 1; :

Re: S05 question

2004-12-08 Thread Alexey Trofimenko
On Wed, 8 Dec 2004 16:07:43 -0700, Luke Palmer <[EMAIL PROTECTED]> wrote: Ashley Winters writes: In a one-liner, I'd rather just use: $datetime ~~ /$year := (\d+) -? $month := (\d+) -? ./ I'm starting to think that this '$year := ' syntax is an obfuscator. We couldn't refer to that capture wi

Re: pull & put (Was: Angle quotes and pointy brackets)

2004-12-07 Thread Alexey Trofimenko
On Mon, 06 Dec 2004 12:22:22 GMT, Smylers <[EMAIL PROTECTED]> wrote: David Green writes: I guess we could always use prepend/append, pull/pop. No! C and C are a well-defined pair, not just in Perl, for dealing with stacks; we should keep those as they are. (And no synonyms, before somebody sugges

Re: state vs my

2004-12-04 Thread Alexey Trofimenko
On Sat, 4 Dec 2004 11:33:10 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: On Sat, Dec 04, 2004 at 08:03:45PM +0300, Alexey Trofimenko wrote: : P.S. : btw, what about : : my @rray; : # i'm starting to like that "sigil is a part of name" idea :) : for 1..10 { :

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Alexey Trofimenko
On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams <[EMAIL PROTECTED]> wrote: Okay, this rant is more about the \s<\s than \s=\s. To me, it is easier to understand the grouping of line 1 than line 2 below: if( $a<$b && $c<$d ) {...} if( $a < $b && $c < $d ) {...} In line2, my mind has to stop and ask

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Alexey Trofimenko
On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams <[EMAIL PROTECTED]> wrote: Larry Wall wrote: for =$*IN {...} for =$*ARGS {...} for = {...} for = {...} for =Â$foo.c $foo.h {...} for =['foo.c', 'foo.h'] {...} for =['.myrc', @*ARGS] {...} for [EMAIL PROTECTED] {...} for =<> {

iterators and functions (and lists)

2004-12-04 Thread Alexey Trofimenko
hm.. consider that: perl5: open $fh, 'file'; $first_line = <$fh>; @remaining = <$fh>; perl6: $fh = open 'file'; $first_line = $fh(); @remaining = $fh(); I thought about parallels between arrays and iterators, and realized that they aren't very close to each other: iterators are

Re: state vs my

2004-12-04 Thread Alexey Trofimenko
On Fri, 3 Dec 2004 21:25:39 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: On Sat, Dec 04, 2004 at 06:31:35AM +0300, Alexey Trofimenko wrote: : : for 1..10_000_000 { : my ($a,$b,$c) = ... : ... : } : : vs. : : for 1..10_000_000 { : state ($a

state vs my

2004-12-03 Thread Alexey Trofimenko
for 1..10_000_000 { my ($a,$b,$c) = ... ... } vs. for 1..10_000_000 { state ($a,$b,$c) = ... ... } latter looks like it would run faster, because no reallocation envolved here. I've read an advice somewhat like that in Ruby docs, tried it on perl5, and it really make

temp $var;

2004-12-03 Thread Alexey Trofimenko
my $var="foo"; { temp $var; say $var; } would it be undef or "foo"? if the former, how could I make $var to contain a copy of original content? using analogy with my $x = $x, that's not going to work.. temp $var = $OUTER::var? OTOH, my @a = ... # something not lazy with 10_000_

Re: Angle quotes and pointy brackets

2004-11-29 Thread Alexey Trofimenko
On Fri, 26 Nov 2004 09:33:49 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: On Fri, Nov 26, 2004 at 07:32:58AM +0300, Alexey Trofimenko wrote: : I notice that in Perl6 thoose funny  and  could be much more common : than other paired brackets. And some people likes how they look, but :

Re: Angle quotes and pointy brackets

2004-11-29 Thread Alexey Trofimenko
Matthew Walton wrote: James Mastros wrote: Larry Wall wrote: On Fri, Nov 26, 2004 at 07:32:58AM +0300, Alexey Trofimenko wrote: : ah, I forget, how could I do qx'echo $VAR' in Perl6? something like : qx:noparse 'echo $VAR' ? I think we need two more adverbs that add the sp

$ @ and %

2004-11-25 Thread Alexey Trofimenko
As far as I understood, arrays and hashes, and references them are much more similar in Perl6 than it was in Perl5. F.e. we have @a and $a = [EMAIL PROTECTED]; the same: push @a,1,2,3 push $a, 1,2,3 $b = @a $b = $a (?) say "@a[]" say "$a[]" (?) myfunc( [EMAIL PROTECTED

Re: Angle quotes and pointy brackets

2004-11-25 Thread Alexey Trofimenko
On Thu, 25 Nov 2004 13:45:51 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: ... Hmm, I would say that "" is short for qq//, not qq"". Quote characters lose their identity when used with generalized quotes. (I realize this is not always true with Perl 5, but that can be construed as a mistake.) So Â

Re: Return with no expression

2004-08-23 Thread Alexey Trofimenko
On Fri, 20 Aug 2004 09:21:02 +0100, Matthew Walton <[EMAIL PROTECTED]> wrote: On 19 Aug 2004, at 18:04, Luke Palmer wrote: [...] my $num = $param == 0 ?? 0 : rand $param; my $num = $param == 0 ?? 0 :: rand $param; surely? a little off theme.. I wanna ask, could be there in perl6 any difficul

Re: String interpolation

2004-07-21 Thread Alexey Trofimenko
On Wed, 21 Jul 2004 10:21:58 -0700 (PDT), Austin Hastings <[EMAIL PROTECTED]> wrote: --- Larry Wall <[EMAIL PROTECTED]> wrote: If {...} supplies list context by default, most intepolations are either the same length or shorter: $($foo) {$foo} @(@foo) [EMAIL PROTECTED] $(@foo)

Re: String interpolation

2004-07-20 Thread Alexey Trofimenko
On Tue, 20 Jul 2004 16:06:40 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: Actually, I've been rethinking this whole mess since last week, and am seriously considering cranking up the Ruby-o-meter here just a tad. At the moment I'm inclined to say that the *only* interpolators in double quotes are:

Re: This week's summary

2004-07-20 Thread Alexey Trofimenko
On Tue, 20 Jul 2004 19:15:49 +0200, Juerd <[EMAIL PROTECTED]> wrote: The Perl 6 Summarizer skribis 2004-07-20 14:46 (+0100): Another subthread discussed interpolation in strings. Larry'schanged his mind so that "$file.ext" is now interpreted as "$object.method". You need to do "${file

Re: "=>" brother

2004-07-09 Thread Alexey Trofimenko
On Fri, 9 Jul 2004 18:00:44 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: On Sun, Jun 20, 2004 at 03:41:41AM +0400, Alexey Trofimenko wrote: : There was some talks about hash keys autoquoting and barewords.. later are : gone and former is disambigued by forcing to write %hash{&#x

Re: if not C<,> then what?

2004-07-09 Thread Alexey Trofimenko
On Fri, 9 Jul 2004 18:25:40 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: On Sat, Jul 10, 2004 at 05:12:54AM +0400, Alexey Trofimenko wrote: : perl is filled with functions which do different things in different : contexts. It seems that in perl6 with plenty of "new contexts", it

Re: if not C<,> then what?

2004-07-09 Thread Alexey Trofimenko
On Fri, 9 Jul 2004 11:13:29 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: On Fri, Jul 09, 2004 at 10:39:56AM +0200, Michele Dondi wrote: : On Thu, 1 Jul 2004, Alexey Trofimenko wrote: : : > if we really about to lose C-style comma, would we have something new : > instead? : : A late

Re: if not C<,> then what?

2004-07-09 Thread Alexey Trofimenko
On Fri, 9 Jul 2004 13:19:46 -0700 (PDT), Austin Hastings <[EMAIL PROTECTED]> wrote: --- Larry Wall <[EMAIL PROTECTED]> wrote: If there reasonably can be block modifiers, I will unreasonably declare that there can't be. You can always say: do { print; next; } if|when /stgh/; (It's still the ca

Re: if not C<,> then what?

2004-07-09 Thread Alexey Trofimenko
On Fri, 9 Jul 2004 20:14:32 -0400, Joe Gottman <[EMAIL PROTECTED]> wrote: -Original Message- From: Larry Wall [mailto:[EMAIL PROTECTED] Sent: Friday, July 09, 2004 2:33 PM To: [EMAIL PROTECTED] Subject: Re: if not C<,> then what? On Fri, Jul 09, 2004 at 11:23:09AM -0700, Austin Hastings

C C and lazyness

2004-07-02 Thread Alexey Trofimenko
consider this: say for map {...} grep {...} map {...} 1..1_000_000 as far as I can imagine, in perl5 it does: 1)flatten 1..1_000_000 into anonimous array; (maybe in this particular case it is optimized in perl5, like it done in C.. I don't know.) 2)map trough it elements and store results in

Re: if not C<,> then what?

2004-07-02 Thread Alexey Trofimenko
On Thu, 1 Jul 2004 16:14:37 -0700 (PDT), Jonathan Lang <[EMAIL PROTECTED]> wrote: Actually, the whole purpose of the C-style comma is to allow you to place multiple expressions in a place that's only designed to take one, such as the various divisions within a loop control set ("loop ($i = 0, $j

Re: if not C<,> then what?

2004-07-01 Thread Alexey Trofimenko
On Wed, 30 Jun 2004 19:41:24 -0600, Luke Palmer <[EMAIL PROTECTED]> wrote: Alexey Trofimenko writes: if we really about to lose C-style comma, would we have something new instead? new C<,>,( as I've been told here by wise ones), doesn't guarantee order in which its operands

if not C<,> then what?

2004-06-30 Thread Alexey Trofimenko
if we really about to lose C-style comma, would we have something new instead? new C<,>,( as I've been told here by wise ones), doesn't guarantee order in which its operands will be evaluated, and even doesn't guarantee that they won't be optimised away before evaluating, if all expression is in

Re: if, loop, and lexical scope

2004-06-29 Thread Alexey Trofimenko
On Tue, 29 Jun 2004 10:52:31 -0400, Jonadab The Unsightly One <[EMAIL PROTECTED]> wrote: People who think in terms of "statements" often get mixed up when they put complex expressions in void context, expecting them to be treated as statements. print(2+3)*7; is another example. Perl doesn't ha

Re: if, loop, and lexical scope

2004-06-28 Thread Alexey Trofimenko
On Mon, 28 Jun 2004 06:42:47 -0700, David Storrs <[EMAIL PROTECTED]> wrote: On Sun, Jun 27, 2004 at 03:16:11PM -0600, Luke Palmer wrote: But anyway, if you still want to be old school about it, then you'll end up not caring about the scope of your $i. Really you won't. And you'll be happy that

if, loop, and lexical scope

2004-06-27 Thread Alexey Trofimenko
AFAIR, I've seen in some Apocalypse that lexical scope boundaries will be the same as boundaries of block, in which lexical variable was defined. so, my question is, what the scope of variables, defined in C and C conditions? in perl5: my $a="first\n"; if (my $a="second\n") {print $a}

Re: user-defined operators?

2004-06-27 Thread Alexey Trofimenko
On Thu, 24 Jun 2004 10:55:26 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: Well, any operator or function that knows how to call a closure can function as a short-circuit operator. The built-in short-circuit operators are a bit special insofar as they're a kind of macro that treats the right side

Re: unicodian monospace fonts for windows(?)

2004-06-21 Thread Alexey Trofimenko
On Sun, 20 Jun 2004 18:37:03 -0700 (PDT), Goplat <[EMAIL PROTECTED]> wrote: --- Alexey Trofimenko <[EMAIL PROTECTED]> wrote: oh my.. it seems to me, that Perl6 starts new age of ASCII-graphics. (not ASCII, really.. maybe Uni-graphics?).. but now i have this issue: I'm

Re: div operator

2004-06-20 Thread Alexey Trofimenko
On Sun, 20 Jun 2004 15:57:48 +0100, Jonathan Worthington <[EMAIL PROTECTED]> wrote: "Alexey Trofimenko" <[EMAIL PROTECTED]> wrote: what do you think about adding C operator, akin %, to perl6 core? I mean, as$a % $b really does int($a) %

Re: unicodian monospace fonts for windows(?)

2004-06-20 Thread Alexey Trofimenko
ality of programmers community. I'll want to understand what programs do, and want to edit them too, if need arise. -- Excuse my French.. Alexey Trofimenko

unicodian monospace fonts for windows(?)

2004-06-20 Thread Alexey Trofimenko
oh my.. it seems to me, that Perl6 starts new age of ASCII-graphics. (not ASCII, really.. maybe Uni-graphics?).. but now i have this issue: I'm coding on Windows, there's already two unicode compliant monospace fonts: Lucida Console and Courier New. And I do not like both of them, (f.e. in

div operator

2004-06-20 Thread Alexey Trofimenko
what do you think about adding C operator, akin %, to perl6 core? I mean, as$a % $b really does int($a) % int($b) and returns modulous, so $a div $b really does int( int($a) / int($b) ) and returns integer division. but with native int

"=>" brother

2004-06-20 Thread Alexey Trofimenko
There was some talks about hash keys autoquoting and barewords.. later are gone and former is disambigued by forcing to write %hash{'key'} or %hashÂkey ( as opposite to %hash{key} which is now %hash{key()} ).. right?.. that's almost ok to me, if there's any hope that  will have a _standard_