Re: Mutating methods

2004-03-17 Thread arcadi shehter
Larry Wall writes: > > Despite the severe overloading problems, it's really gonna be hard > to do much better than > > $topic ? (.a + .b + .c) > my dog $spot ?= .new; > @array?.[.min .. .max] > > And I do think people would rebel at using Latin-1 for that one. > I get enoug

Re: Mutating methods

2004-03-14 Thread arcadi shehter
Date: Fri, 12 Mar 2004 12:01:10 -0800 Larry Wall wrote: >It's really a pity that question mark is already so overloaded with >boolean connotations, because > >$dog? .bark > >would really be the best postfix operator in ASCII for this. >People would probably end up writing > >my Dog $spot ?

Re: printf-like formatting in interpolated strings

2003-06-16 Thread arcadi shehter
Luke Palmer writes: > > As far as the syntax, the () and {} don't make a lot of sense with > regard to the rest of the language. We could either utilize the > string/numeric context distinction that already exists in {} and [] > for subscripting, or we could always use () in analog to $().

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-04 Thread arcadi shehter
Yary Hluchan writes: > a = arcadi shehter <[EMAIL PROTECTED]> > a>I think this was already discussed once and then it was proposed to > a>attach a property to characters of the string > a> > a> sub peek_at_sky { > a> > a> my Color @numbers

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread arcadi shehter
Austin Hastings writes: > > On the other hand, let's suppose that you've got a vast array of > floating point data: > > my float @seti = {...evidence of intelligence, somewhere...}; > > It's a fair question to ask how to retarget the rexengine to use @seti > as the input stream. (I hereb

Re: is static? -- Question

2003-04-03 Thread arcadi shehter
Larry Wall writes: > > Er, how would LEAVE detect that this was the *last* time you're ever > going to call this routine? > > On the other hand, if we renamed FIRST and LAST to ENTER and LEAVE, > then FIRST would become available to mean "my very first time"... > and LAST will mean "just

Re: Conditional Cs?

2003-04-01 Thread arcadi shehter
Damian Conway writes: > >given baz(@args) { return $_ when defined } >given baz(@args) { return $_ when $_ > 0 } ># etc. > since we have 2 forms of "return" -- "return" and "leave" , may be we can make "return" also to be a topicalizer for the rest of experssion , and then :

Re: This week's Perl 6 Summary

2003-03-31 Thread arcadi shehter
Piers Cawley writes: > is static? > Discussion of static/state variables continued. Arcadi Shehter wondered > if it made sense to attach "but" properties to closures. I confess I > didn't really understand what he was driving at. Austin Hastings an

Re: is static? -- Question

2003-03-25 Thread arcadi shehter
suppose I want this behaviour : sub new_counter($start=0) { my $cnt = $start; my sub incr { ++$cnt; }; my sub decr { --$cnt; }; return sub (str $how="incr") { give

Re: is static? -- Question

2003-03-24 Thread arcadi shehter
Matthijs van Duin writes: > > A nice example is: > > sub a { > state $x; > my $y; > my sub b { return $x++ + $y++; } > return &b; # is a \ before &b needed? > } > > Every call to sub a will return a different closure. The $x in each closure > all > refer to the sa

Re: is static? -- Question

2003-03-22 Thread arcadi shehter
Matthijs van Duin writes: > > >does it mean that this is legitimate > > > > sub a { > > state $x; > > my $y; > > state sub b { state $z ; return $x++ + $y++ + $z++ ; } > > return &b; # is a \ before &b needed? > > } > > No, since you can't refer to $y in that s

Re: is static? -- Question

2003-03-22 Thread arcadi shehter
Matthijs van Duin writes: > > A nice example is: > > sub a { > state $x; > my $y; > my sub b { return $x++ + $y++; } > return &b; # is a \ before &b needed? > } > > Every call to sub a will return a different closure. The $x in > each closure all refer to the same

Re: is static? -- Question

2003-03-22 Thread arcadi shehter
Larry Wall writes: > > I think it's also a mistake to give C two unrelated meanings. > These are not lexically-scoped variables any more than "our" > variables are, and the fact that they can happen accidentally in > Perl 5 as persistent lexically scoped variables is, er, accidental. > They

Re: is static?

2003-03-18 Thread arcadi shehter
Larry Wall writes: Larry Wall writes: > > I guess the real question would be, is it an overall simplification to > allow "has" anywhere? There *is* an object out there representing each > abstract closure (pre-instantiation), but it's a bit of a stretch from > "Every block is a closure" to "

Re: is static?

2003-03-18 Thread arcadi shehter
on the second thought : its quite strange ( though cute ) that currently the only way to make lexical persistent variable is based on garbage collector. it is referenced -- hence it is kept. this brings to the following : every subroutine may have a "daemon" object of some sort associated with

Re: is static?

2003-03-18 Thread arcadi shehter
Larry Wall writes: > > I guess the real question would be, is it an overall simplification to > allow "has" anywhere? There *is* an object out there representing each > abstract closure (pre-instantiation), but it's a bit of a stretch from > "Every block is a closure" to "Every block is a cl

Re: is static?

2003-03-18 Thread arcadi shehter
Damian Conway writes: on the second thought : its quite strange ( though cute ) that currently the only way to make lexical persistent variable is based on garbage collector. it is referenced -- hence it is kept. may be it have to be more explicit like that sub counter(){ daemon $s;

Re: is static?

2003-03-18 Thread arcadi shehter
Larry Wall writes: > Another question is whether a class containing methods containing > "has" would be confusing. The $s vs $.s distinction seems to help > a bit there. That would seem to imply that > > class foo { > has $s; > has $.t; > } > > declares a class attri

Re: is static?

2003-03-17 Thread arcadi shehter
Joe Gottman writes: > >Not really. A variable declared with can be accessed from > anywhere in the program, just by redeclaring it or calling it with the > "package::" syntax.A variable declared with can be accessed outside > its scope only if the user returns a reference to it.

Re: Why C needs work (was Re: L2R/R2L syntax)

2003-01-23 Thread arcadi shehter
Thomas A. Boyer writes: > Michael Lazzaro wrote: > > *Now*, what to do about the fantastic magic that pointy-sub provides? > > The _spectacular_ win would be if we could just recognize an optional > > parameter list as part of a block. > > > > map @a : ($a,$b) {...} # params + closure

Re: L2R/R2L syntax

2003-01-22 Thread arcadi shehter
Damian Conway writes: > > Not equivalent at all. C<$foo~>bar> means "append $foo to the argument list > of subroutine C". C means "make C<$foo> the invocant for method > ". > > Curiously enough, the confusions I'm hearing over this issue are, to me, the > strongest argument yet for using

Re: L2R/R2L syntax

2003-01-21 Thread arcadi shehter
Damian Conway writes: > Buddha Buck wrote: > > > > Perl 5 allows you to do: > > > > $object->meth1->meth2->meth3; # Perl5 chained method, L2R > > > > Perl 6 will also allow you to do: > > > > $data ~> sub1 ~> sub2 ~> sub3;# Perl6 chained subs, L2R > > > > Perl 5 allows

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

2003-01-12 Thread arcadi shehter
Luke Palmer writes: > I don't think so. Rather, that becomes: > > him.hit(I); > > And to clarify, you should probably format it like this: > > hit him: I; > > But computer languages aren't generally used to specify past tense > anyway > why priperties are sort of ... becau

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

2003-01-09 Thread arcadi shehter
Damian Conway writes: > Unary ~> would (by analogy to unary dot) append the current topic to the > argument list of its operand. > > Thus, your examples become simply: > > given @list { > ~> grep /bad!/ ~> @throw; > ~> grep /good/ ~> @keep; >

Re: purge: opposite of grep

2002-12-13 Thread arcadi shehter
Damian Conway writes: > Famous last words. ;-) > > > > Was it ever decided what C would look like with multiple streams? > > for zip(@x, @y, @z) -> $x, $y, $z {...} > > and its operator version: > > for @x ¦ @y ¦ @z -> $x, $y, $z {...} > > > > Maybe we could just use

Re: right-to-left pipelines

2002-12-09 Thread arcadi shehter
Luke Palmer writes: > > Date: Mon, 9 Dec 2002 06:00:40 +0100 > > From: Stéphane Payrard <[EMAIL PROTECTED]> > > > Damian: > > > so it's easy to build up more complex right-to-left pipelines, like: > > > > > > (@foo, @bar) := > > > part [/foo/, /bar/], > > > so

Re: String Literals, take 3

2002-12-05 Thread arcadi shehter
Jonathan Scott Duff writes: > Non-Interpolating constructs are strings in which expressions do > not interpolate or expand. The exception to this rule is the > backslash character C<\>. A single backslash which is followed > by the current quoting delimiter, or t

Re: String Literals, take 3

2002-12-05 Thread arcadi shehter
Joseph F. Ryan writes: > > The base form for a non-interpolating string is the single-quoted > string: 'string'. However, non-interpolating strings can also be formed > with the q[] operator. The q[] operator allows strings to be made with Ithink it's actually opposite: The basic ( user e

Re: String Literals, take 1

2002-11-30 Thread Arcadi Shehter
issue : * space is allowed (OR NOT ???) between qq ( and friends ) and following delimiter qq ( ... ) ; qq ) ... ( ; qq ' ... ' ; ??? qq | ... | ; qq # ... # ; ??? qq : ... : ; ??? ( to distinguish from usual subs , where this should be subqq

Re: Status Summary; next steps [x-bayes][x-adr]

2002-11-26 Thread Arcadi Shehter
Larry Wall writes: > Note that the "true" property is not the same as the "true" function. > This tells me that properties may need their own namespace distinct > from either subs or classes. (We've talked about defining properties > as subs or classes, but either way is problematic. If we ha

Re: Dynamic scoping (take 2)

2002-11-25 Thread Arcadi Shehter
so these two are equivalent ??? { my $x is yours ; my $y is yours ; my $z is yours ; 1... sub_a ; 2... } sub sub_a ( ; $x is yours, $y is yours ) { ...3... } ; - same as - # ( here no special meaning for "is yours" -- just another property )

Re: Dynamic scoping (take 2)

2002-11-24 Thread Arcadi Shehter
Me writes: > > 4. Autoargs are conceptually simpler than > shared variables, for both newbies and > experts. But clearly this is subjective. :> > thats exactly the point where I tryed to improve. Think of me as a newbe ( which I am ) -- If I understand your proposal , I can explain it to

Re: Dynamic scoping (take 2)

2002-11-24 Thread Arcadi Shehter
I think , ( on the second reading of your post ) , that your proposal of "my $x is yours" is logically very similar to my proposal of "our $x is shared" but your proposal is cleaner if I understand it as follows ( although I like more "shared" instead of "yours" for that purpose ) : instead of ali

Re: Dynamic scoping (take 2)

2002-11-24 Thread Arcadi Shehter
If I misunderstood you -- correct me. It seems that all you worry about is that you want some variable be seen in several subroutines .. you propose a mechanism of passing them between desired subroutins by default through all the dynamical chain of sub calls "connecting them. It seems , on the