Re: Container model - pictures and questions

2005-08-09 Thread TSa
HaloO, Autrijus Tang wrote: 1) I would move the ::name to the Pad level. The idea is that ::name is some less specific supertype of the Fantastique Four ($@%) if more than one of them exists on the container level. Please annotate this idea with the code. You mean: my $a = 3;

Re: Container model - pictures and questions

2005-08-09 Thread TSa
HaloO, Autrijus Tang wrote: The first one is about the compilation cycle: http://pugscode.org/images/simple-compilation.png Question: where is the namespace in the picture? I would expect it to be build in parallel to the syntax tree between parser and compiler. From there it might be

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-09 Thread TSa
HaloO, Stuart Cook wrote: So far, this is what I have picked up; some/most of it is probably wrong: At least your confusion matches nicely with mine :) ~ Foo ~ Is a type that variables etc. can be declared to have Is not an object = I'm really not sure about this... Bare Foo is a

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-09 Thread TSa
HaloO Stevan, you wrote: Guten Tag Herr Sandlaß, you know that a formal German greeting in a collequial environment can be interpreted as unfriendly? I don't do that but just wanted to state the fact. The next level where a 1:n relation exists is below meta(Foo) to pure meta. Not

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread TSa
HaloO, Luke Palmer wrote: On 8/10/05, TSa [EMAIL PROTECTED] wrote: Here is an example of a 2D distance method role Point { has Num $.x; has Num $.y; } method distance( Point $a, Point $b -- Num ) { return sqrt( ($a.x - $b.x)**2 - ($a.y - $b.y)**2

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread TSa
HaloO Autrijus, you wrote: Perl 6 in its unannotated form is also (mostly) a typeless languages, with only the five builtin types, much like Perl 5 is. Counting the sigil quadriga as 4, what is the fifth element? And $it.does(LookGood)? -- $TSa.greeting := HaloO; # mind the echo!

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread TSa
HaloO, Autrijus Tang wrote: So I'm starting to write the inferencer. Immediately I encounter the problem that every type can potentially contain undef: This is the reason why I've bounded Undef below Item disjoint with Value in my type lattice. Of course all types are applicable as type

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread TSa
HaloO, Larry Wall wrote: It might be a mistake to call these isa relationships though. I really only care about Package does Object. Module does Package. Role does Module. Class does Role. OK, I've added that and the Set type in my little type lattice. With your Object still

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread TSa
HaloO Autrijus, you wrote: I think that's because you live in the static realm already. :) Perhaps, but if yes it is an infinite one. my $x is typed; $x = 123; $x = length($x); Would be a type error. If it's in the dynamic world (as in Perl5), that's just fine. Does that

Re: my $pi is constant = 3;

2005-08-10 Thread TSa
HaloO, Larry Wall wrote: In this case it desugars to my $pi is constant = 3; :-) In other words the assignment to a my turns into an ordinary assignment that happens at runtime. Hopefully, since $pi is marked constant, it could be optimized to a binding in many cases, but that's not the

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-11 Thread TSa
HaloO, Autrijus Tang wrote: The purpose is that we don't have to be strong typists to enjoy Strong Typing. To make Perl6 easier to type, and easier to Type. Great! You, if not solve, but at least aim at relieving the pain caused by the 'proliferation of type parameters' problem. Consider me

Re: Typed type variables (my Foo ::x)

2005-08-11 Thread TSa
HaloO, Autrijus Tang wrote: On Thu, Aug 11, 2005 at 08:02:00PM +1000, Stuart Cook wrote: my Foo ::x; a) ::x (=) ::Foo (i.e. any type assigned to x must be covariant wrt. Foo) b) ::x is an object of type Foo, where Foo.does(Class) c) Something else? My current reading is a) -- but only if

Re: Classes as special undefs

2005-08-11 Thread TSa
HaloO, Autrijus Tang wrote: What about this? OK, let's play some manual type inferencing ;) my $spot = Dog; $spot.does(Item of Dog), that means what ever the name Dog represents was stored or bound to $spot. defined($spot); # false!? true! Even for my $spot = ::Dog

Re: Classes as special undefs

2005-08-11 Thread TSa
HaloO, Stuart Cook wrote: On the other hand, there are other things that don't work quite so well: my Dog $spot; $spot.can('bark');# Not until he's instantiated... Are you objecting to the fact that it can't possibly return a valid method, or that it will inappropriately true/false

Re: Classes as special undefs (+ slot call syntax proposal)

2005-08-12 Thread TSa
HaloO, Larry Wall wrote: On Thu, Aug 11, 2005 at 04:47:49PM +0200, TSa wrote: : defined($spot); # false!? : : true! Even for my $spot = ::Dog because when my is evaluated the : name ::Dog has be be bound, AUTOLOADED or by whatever means become : available. What does binding have

Re: my $pi is constant = 3;

2005-08-12 Thread TSa
HaloO, Autrijus Tang wrote: Or do you think that people should really write ::= for constants? For me that is one option if I want the parser to recognize the bareword pi and attach the same meaning as the literal 3. We have at least my ::pi ::= 3; my enum pi(3); # I hope the

Re: Set operators in Perl 6 [was Re: $object.meta.isa(?) redux]

2005-08-12 Thread TSa
HaloO, Larry Wall wrote: [..] but since sets are immutable values, Does that imply they travel in $vars and are a subtype of Value? Is Undef of Set the Set::Empty? Is Set::Empty false? we need only provide an alternate comparison to the constructor, and the set itself needn't remember it.

Re: Classes as special undefs (+ slot call syntax proposal)

2005-08-12 Thread TSa
TSa wrote: :Pair%Hash $Item@Array Here I forget to mention the beautiful symmetry: | arity access | 1| 0..Inf ---+---+- keyed | :Pair | %Hash positional | $Item | @Array Regards, -- $TSa.greeting := HaloO; # mind the echo!

Re: Manuthreading

2005-08-29 Thread TSa
HaloO, Damian Conway wrote: I think that's an appalling idea. is *vastly* more valuable as interpolated word list. I agree. If you *have* to propose manuthreading, go with the previous proposal and use instead. The argument that the angles should point to the operator is spurious. People

Re: Using lists containing arrays as lvalues

2005-08-29 Thread TSa
HaloO, Ingo Blechschmidt wrote: But there is a problem with the ordinary assignment form: ($head, @tail) = foo(); If the LHS is an ordinary list (i.e., if we don't use help from the grammar/macros), What is a 'ordinary List' to you? I thought (,) constructs a Lazy list? then the

Re: Binding of array elements

2005-08-29 Thread TSa
HaloO, Yuval Kogman wrote: IMHO definately autovivify * @foo[$idx] := $var; my @bar = @foo; $var= $new_var; # @foo[$idx] and $var are now $new_var, but @bar is unchanged, right? Yes, I agree. But we do need a way in the middle. Right now we have: @bar := @foo; #

Re: ~ and + vs. generic eq

2005-08-29 Thread TSa
HaloO, Damian Conway wrote: Just a meta-point...one thing we really do need to be careful of is not ending up with 17 different equality operators (like certain languages I shall refrain from naming). So far we're contemplating: =:= ~~ == eq eqv equals Do we really

Re: Binding of array elements

2005-08-29 Thread TSa
HaloO, Yuval Kogman wrote: On Mon, Aug 29, 2005 at 13:12:37 +0200, TSa wrote: Sorry, I believe everything is an operator---or actually operators are Code subtypes with syntactic sugar. But some operators are usually not dispatched because the type system manages to produce the same effect

Re: Set operators in Perl 6 [was Re: $object.meta.isa(?) redux]

2005-08-29 Thread TSa
HaloO Larry, you wrote: : we need only provide an alternate comparison to : the constructor, and the set itself needn't remember it. On the : other hand, hashes behaving like mutable sets need to remember their : comparison operator if it is not the default. : : The slot accessor paradigma

Re: \(...)?

2005-09-19 Thread TSa
HaloO, Ingo Blechschmidt wrote: [EMAIL PROTECTED];# Ref to array \(@array); # List of refs to @array's elements, i.e. same as map { \$_ } @array; # Weird (violating the parens are only for grouping rule), but # consistent with Perl 5. Correct? I opt for 'no'. ()

Re: \(...)?

2005-09-19 Thread TSa
HaloO Larry, you wrote: We can do whatever we like with \ since it's really a *macro* that Could you explain me the rational why \ and other ops like =, := are not normal overloadable, possibly MMD operators? imposes lvalue context (or at least, indirection in the abstract, if we were ever

Re: Lazy lists and optimizing for responsiveness

2005-09-19 Thread TSa
HaloO, Yuval Kogman wrote: One thing that is extraordinarily hard to do with the facilities we have today is finding the responsive optimum between laziness and eagerness. Good, that you remind me to this subject! I wanted to ask the same question starting from more theoretical grounds. I

Re: \(...)?

2005-09-19 Thread TSa
HaloO, Ingo Blechschmidt wrote: So...: [EMAIL PROTECTED]; # Reference to array, of course \(@array); # same \(((@array))); # same \(1,2,3);# Reference to a list promoted to an array (!) \(((1,2,3)));# same The thing that is unclear to me here

Re: \(...)?

2005-09-19 Thread TSa
HaloO, Ingo Blechschmidt wrote: [EMAIL PROTECTED];# List of references to @array's elements \*(((@array))); # same Yes, and of course \((*((@array; # same \ (* (@array)); # same Well, until someone invents infix:(* :) -- $TSa.greeting := HaloO; # mind the

Re: \(...)?

2005-09-19 Thread TSa
HaloO, Juerd wrote: Could you think of a formal specification of \ the way you want it, that doesn't exist of only examples? I can't speak for Ingo, but here's mine. What context does it give its RHS? I still have difficulties to understand this concept but I think that \ is simply

Re: Demagicalizing pairs

2005-09-20 Thread TSa
HaloO, Luke Palmer wrote: The whole point was to deautomatize it! However, here's an interesting solution: pairs are scanned for *syntactically* *on the top level* of a function call (allowing named() or however we spell it as a fallback when we want to be dynamic). However, :foo(bar) and

Re: \(...)?

2005-09-20 Thread TSa
HaloO chromatic, you wrote: On Mon, 2005-09-19 at 13:01 +0200, TSa wrote: Why shouldn't there be a lvalue traversal that in the end makes ($x, $y) = \($a, $b); actually mean $x = \$a; $y = \$b; Does this not go from one sequence point (evaluate the rhs sufficiently, then perform

Re: \(...)?

2005-09-20 Thread TSa
HaloO Juerd, you wrote: Does the type List exist? What is it? How does it fit in the hierarchy? I've put it below Sub in my type lattice. But that is not official, of course. In list context, comma provides list context to LHS and RHS, and those lists together are flattened. (It's not

Re: conditional wrapper blocks

2005-09-21 Thread TSa
HaloO, Yuval Kogman wrote: Today on #perl6 I complained about the fact that this is always inelegant: if ($condition) { pre } unconditional midsection; if ($condition) { post } I'm not sure if you would considered closure traits as equally inelegant but what are PRE

Re: Symbolic dereferentiation of magical variables

2005-09-21 Thread TSa
HaloO Larry, you wrote: On Mon, Aug 22, 2005 at 10:51:53PM +0200, Ingo Blechschmidt wrote: : If we go with these changes, this functionality (starting place for a : search) would be available by using : : Foo::Bar$symbol_to_lookup; # right? Presumably, though Foo::Bar differs from

Re: ~ and + vs. generic eq

2005-09-21 Thread TSa
HaloO Yuval, you wrote: On Mon, Aug 29, 2005 at 14:07:51 +0200, TSa wrote: role Object does Compare[Object, =:=] role Numdoes Compare[Num, ==] role Strdoes Compare[Str, eq] What is the implication of from the perspective of the person using Object, Num and Str? Do they have

Re: Object Model Pictures

2005-09-21 Thread TSa
HaloO, Nathan Gray wrote: The order that a class does roles is significant, because if two roles define the same method, only the first one is catalogued by the class instance. Ups, this contradicts the concept of class composition which in the above case should raise an error instead of

Re: skippable arguments in for loops

2005-09-22 Thread TSa
HaloO, Carl Mäsak wrote: But what if I don't care about the elements 1,4,7? Would the following be a sane syntax? my @a = 1..9; for @a - undef, $x, $y { say $x } I think that, if the concept of lazy list evaluation is running deep in Perl 6 than the obvious solution to me is: for @a - $x,

Re: pause/cont

2005-09-22 Thread TSa
HaloO, Juerd wrote: Both recently discussed situations with blocks can be solved by introducing a way to leave the current block and resume it elsewhere. With first class code types, _ and label beeing bound lexically to the current instance of the sub class, the set of current control flow

Re: ~ and + vs. generic eq

2005-09-22 Thread TSa
HaloO, Yuval Kogman wrote: No, the role installs homogenious targets into the generic binary-MMD comparator which I think is called eqv. Err, why? We already have that with regular MMD semantics. role Num { multi *infix:eqv ($x:, Num $y) { $x == $y } } What you mean is double

Re: Stringification, numification, and booleanification of pairs

2005-09-23 Thread TSa
(); Questions I pose myself while flying in my TSa $helicopter; through spacetime are for example: Does the vietnamese child expect medical help? How does the rescue team arrive? By car? What sex does the paraglider have? What type of action does the .sees method do with my

Re: skippable arguments in for loops

2005-09-23 Thread TSa
HaloO Carl, you wrote: TSa: Prefers to rely on lazy evaluation, and says both tounge-in-cheek and philosophically that if I don't want to care about some elements, I should do so, and let Perl6 optimize. Proposes several ways of not giving a name to a variable. This hits home. And I did

Re: Stringification, numification, and booleanification of pairs

2005-09-23 Thread TSa
Halo, someone has switched off my echo ;) Juerd wrote: TSa skribis 2005-09-23 15:42 (+0200): 1) the circumfix operator has an arity = 1 I think it's parsed, not having specific arity. Of course it's parsed, how else should it reach the semantic analyzer? And I don't consider (arity

Re: .chars, .bytes, etc.

2005-09-26 Thread TSa
HaloO, Juerd wrote: wolverian skribis 2005-09-24 13:45 (+0300): Why not define .chars like this: Context Return value itemamount of units listunits themselves I still have my objections to this outside-in flow of type information. Originally I thought that

Re: .chars, .bytes, etc.

2005-09-26 Thread TSa
HaloO, Juerd wrote: Can you explain please what outside-in means to you? TSa wrote: BTW, does everybody expect more than one prefix numerifyer beeing redundant or is there an idea of (+ (+ @foo)) beeing modelled Juerd answered: It's providing context to something that was already

Re: Sort of do it once feature request...

2005-09-26 Thread TSa
HaloO, Larry Wall wrote: ... though we haven't decided what to call the flipflop operator. Sorry, I'm totally out of scope to what 'the flipflop operator' is. Could you be so kind to give some hints. Thanks in advance. if state $s ?? $s = falsify() !! $s = truify() !falsify() {...}

Re: Exceptuations

2005-09-26 Thread TSa
HaloO, Piers Cawley wrote: Exactly which exception is continued? The bottommost one. If you want to return to somewhere up its call chain, do: $!.caller(n).continue(42) Whow, how does a higher level exception catcher *in general* know what type it should return and how to construct it.

Re: Sort of do it once feature request...

2005-09-26 Thread TSa
HaloO, Juerd wrote: TSa skribis 2005-09-26 19:39 (+0200): Sorry, I'm totally out of scope to what 'the flipflop operator' is. Could you be so kind to give some hints. Thanks in advance. http://perldoc.perl.org/perlop.html#Range-Operators Thanks. I'm glad that 1..Inf these days is just

Re: matching colors (was Stringification, numification, and booleanification of pairs)

2005-09-26 Thread TSa
HaloO, Yuval Kogman wrote: if greenish describes the color Indeed, it sounds like Yoda Speak: If greenish that color is, modifying it I will. Same in the German version. I don't know of hebrew though. demonstrates the lack of transitivity in matching... Sorry, but don't you mean

Re: matching colors (was Stringification, numification, and booleanification of pairs)

2005-09-27 Thread TSa
HaloO Yuval, you wrote: On Mon, Sep 26, 2005 at 21:02:06 +0200, TSa wrote: demonstrates the lack of transitivity in matching... Sorry, but don't you mean commutativity? Transitivity of relations requires applying it twice to three values and then concluding it applies to the unchecked

Re: This week's summary

2005-09-27 Thread TSa
HaloO, The Perl 6 Summarizer wrote: Meanwhile, in perl6-language \(...) Oh look, a thread in p6l that's still going more than a fortnight later. How unusual. Is a long running thread considered a bad thing on this list? I have grasped so far, that spawning a new thread after some

Re: Exceptuations

2005-09-29 Thread TSa
HaloO, Yuval Kogman wrote: On Wed, Sep 28, 2005 at 09:49:11 -0700, Larry Wall wrote: But thinking about optional continuations, another thing occured to me. It's always bugged me that warnings were something different from exceptions, and now I think we can unify them, if we say that Yes,

Re: use fatal err fail

2005-09-29 Thread TSa
HaloO, Yuval Kogman wrote: On Wed, Sep 28, 2005 at 11:46:37 -0500, Adam D. Lopresto wrote: The recent thread on Expectuations brought back to mind something I've been thinking for a while. In short, I propose that use fatal be on by default, and that err be turned into syntactic sugar for a

Re: Exceptuations, fatality, resumption, locality, and the with keyword; was Re: use fatal err fail

2005-09-30 Thread TSa
HaloO, Yuval Kogman wrote: The try/catch mechanism is not like the haskell way, since it is purposefully ad-hoc. It serves to fix a case by case basis of out of bounds values. Haskell forbids out of bound values, but in most programming languages we have them to make things simpler for the

Re: Exceptuations

2005-09-30 Thread TSa
HaloO Piers, you wrote: TSa [EMAIL PROTECTED] writes: BTW, I would call *intentional* exceptions terrorism. So that would be all exceptions then. They all get implemented somewhere, even the ones that get thrown by builtins. I knew that the statement would emotionalize. Sorry to all who

Re: A listop, a block and a dot

2005-10-05 Thread TSa
HaloO, Luke Palmer wrote: On 10/4/05, Miroslav Silovic [EMAIL PROTECTED] wrote: Playing with pugs, I ran into this corner case: sub f($x) { say $x; } f {1}.(); # ok, outputs 1 IIRC, this puts f into the named unary precedence level which is below method postfix. Thus we get (f ({1}.()))

Re: seeing the end of the tunnel

2005-10-05 Thread TSa
HaloO, Luke Palmer wrote: On 10/1/05, David Storrs [EMAIL PROTECTED] wrote: All in all, I think that might just be the end of the tunnel up ahead. Go us for getting here, and loud applause to @Larry for guiding us so well! Applause for p6l for hashing out the issues that we didn't think

Re: Exceptuations (proposal for RESUME blocks)

2005-10-07 Thread TSa
HaloO Yuval Kogman wrote: We have: die: throw immediately fail: return an unthrown exception, which will be thrown depending on whether our caller, and their caller - every scope into which this value propagates - is using fatal. This is enough for normal

Re: Type annotations

2005-10-10 Thread TSa
HaloO, I fear I'm addicted... Luke Palmer wrote: On 10/7/05, chromatic [EMAIL PROTECTED] wrote: On Fri, 2005-10-07 at 17:43 -0600, Luke Palmer wrote: No, you can't overload assignment at runtime because you can't overload assigment at any time, so says the language spec (well, not any

Re: Sane (less insane) pair semantics

2005-10-11 Thread TSa
HaloO, Larry Wall wrote: It still has to figure out how to reconcile the named arguments with the positional parameters, of course, unless someone has made sufficient representation to the compiler that all calls to a particular short name have particular named parameters that are guaranteed to

Re: Sane (less insane) pair semantics

2005-10-12 Thread TSa
HaloO, Ingo Blechschmidt wrote: Exactly. I'd like to add that, under the proposal, you always know what things are passed how, only by looking for a *. foo $var;# always positionally, even if $var isa Pair foo *$pair; # always named But where is the name? Is it 'pair'? Like in

Re: Proposal to make class method non-inheritable

2005-10-13 Thread TSa
HaloO, Stevan Little wrote: On Oct 11, 2005, at 8:47 PM, Larry Wall wrote: You seem to be arguing that a class has no state, but my view is that, in the abstract, a class encompasses the state of *all* its objects. It just hasn't picked one particular object to be at the moment. I love this

Re: Re(vised): Proposal to make class method non-inheritable

2005-10-17 Thread TSa
HaloO, Stevan Little wrote: Now, as for class methods, I suppose it is possible to just stash then in the classes symbol table like with variables. However, do we then loose the method call syntax? I think not. But the current notion seems to drift closer to my idea of free methods versus

Re: Translitteration and combining strings and array references

2005-10-19 Thread TSa
HaloO, Luke Palmer wrote: It looks nicer if you use the indirect object form: trans string: [ h e = 0, ]; Given the right interpretation this just looks like a typed label selection in a multi method. multi trans { Str $x: ...; return; Int $x: ...; return;

Re: Translitteration and combining strings and array references

2005-10-19 Thread TSa
HaloO, Juerd wrote: Luke Palmer skribis 2005-10-18 11:57 (-0600): It looks nicer if you use the indirect object form: trans string: [ h e = 0, ]; It'd also look very nice with optional parens: string.trans [ h e = 0 ]; Or is it not yet time to resuggest that? :) I like

Re: new sigil

2005-10-21 Thread TSa
HaloO, Brent 'Dax' Royal-Gordon wrote: Steve Peters [EMAIL PROTECTED] wrote: ~ seems to be available for a sigil, if my reading of S02 is correct, and the cent sign is replacing :: in all cases. If not (that is $::foo is still the global variable named foo) then * may also be available.

Re: new sigil

2005-10-24 Thread TSa
HaloO, Luke Palmer wrote: On 10/20/05, Larry Wall [EMAIL PROTECTED] wrote: Another thing I didn't mention is that that binds both the variable and its class. But the $ variable is of course optional after the type, so you could just write that sub sametype (¢T, ¢T) {...} if you don't

Re: +$arg changed to :$arg

2005-10-26 Thread TSa
HaloO, Larry Wall wrote: On Wed, Oct 26, 2005 at 04:59:04PM +0200, Juerd wrote: : Larry Wall skribis 2005-10-26 7:31 (-0700): : One slightly serious ramification of the : switch is that the space : is required after the colon indicating a null invocant. What is an invocantless method other

Re: Ways to add behavior

2005-10-26 Thread TSa
HaloO, Austin Frank wrote: Which (sort of) takes us back to TSa's (non)sign-off note from 10/5, wherein he suggested: I just can't help it, I love the good work done on this list! And thanks for spelling the acronym correctly. The Kindly One of a class beeing the representative like the

Re: +$arg changed to :$arg

2005-10-27 Thread TSa
HaloO, Larry Wall wrote: : Yes, and dispatch as a runtime keyed access into a code multitude. : The covariant part of the method's sig! The code equivalent to keyed : data access into hashes. Um, yeah. Won't play in Peoria, though. Where or what is Peoria? What I mean with the covariant

Re: +$arg changed to :$arg

2005-10-27 Thread TSa
HaloO, Juerd wrote: This aside, you could of course just double the colon. Or use a semicolon. Semicolon would give me the mnemonic of 'end of statement' seperating the dispatched part from the checked part of the signature. Or it reminds one of the array and hash slicing. Should we call

Re: Why submethods

2005-11-03 Thread TSa
HaloO, Luke Palmer wrote: On 10/29/05, Damian Conway [EMAIL PROTECTED] wrote: So we need a mechanism that is externally (i.e. from a class interface point-of-view) a subroutine, but internally has the features of a method (i.e. has an invocant). Since it's externally sub-like but internally

Re: Role Method Conflicts and Disambiguation

2005-11-03 Thread TSa
HaloO, Rob Kinyon wrote: On Nov 2, 2005, at 9:02 PM, Jonathan Lang wrote: Let's say you have this: role A {method foo() { code1; } } role B {method foo() { code2; } } I think, A and B might just be aliases to the *identical* structural type because the only constraint that both roles

co/contra variance of roles/factories in theory.pod

2005-11-03 Thread TSa
HaloO, I don't understand why theory.pod states that roles are covariant, unary theories and factories are contravariant. I would expect the opposite from the requirement that all functions in roles only take the topic type while function in factories only return the topic type. So if A : B, I

Re: $_ defaulting for mutating ops

2005-11-04 Thread TSa
HaloO, Michele Dondi wrote: And yes: there are lots of languages having (e.g.) a ++ operator, mostly derived from C. But Perl's C++ already allows an extended syntax wrt that of those other languages, that is: I'm not really sure, but I don't think that in C you can do (the equivalent of)

Re: co/contra variance of roles/factories in theory.pod

2005-11-04 Thread TSa
HaloO, Luke Palmer wrote: Well, it's possible that I'm abusing the terms, since I first heard the terms from you and inferred what they meant. I'm honoured. Thanks. Please don't get me wrong. I appreciate the document you wrote. I just want to help with peer reviewing it. However, there is

Re: new sigil

2005-11-04 Thread TSa
HaloO, Larry Wall wrote: On Tue, Oct 25, 2005 at 10:25:48PM -0600, Luke Palmer wrote: : Yeah, I didn't really follow his argument on that one. I, too, think : that the one() junction in general is silly, especially for types. Well, I think it's silly too. I'm just trying to see if we need to

Re: Ways to add behavior

2005-11-04 Thread TSa
HaloO, Larry Wall wrote: On Wed, Oct 26, 2005 at 04:56:23PM -0600, Luke Palmer wrote: : Then ^T $x binds T to the kind of $x. And $x.kind == $y.kind asks : if two objects are of the same type, : : Don't you mean $x.kind eqv $y.kind? I start to dislike the eqv name as generic value

Re: Ways to add behavior

2005-11-04 Thread TSa
HaloO, Larry Wall wrote: At the moment, I think the weakest word choice is subtype. People from certain cultures will confuse subtypes with subclasses. Not to mention submethods and subroutines! The notion of constraints or limitations is already conveyed by where, and some subtypes may

Re: Ways to add behavior

2005-11-07 Thread TSa
HaloO, Stevan Little wrote: This is actually the principe behind the Ruby style singleton methods (the shadow class), it basically creates an anon-class which inherits from $x's original class, then it rebinds/blesses $x into the anon- class. It is very simple really :) Yes, it's the

Re: Ways to add behavior

2005-11-07 Thread TSa
HaloO, Larry Wall wrote: : or is 'bound of' proper english? It doesn't really resonate for a native speaker. --snip-- : Plus, as we've defined : them above, subtypes are the most generic type you can name in Perl. --snip-- I wasn't using the term generic in a type-theoretic sense.

Re: Ways to add behavior

2005-11-07 Thread TSa
HaloO, Larry Wall wrote: : ::Takes3Ints ::= :(Int,Int,Int -- Any); : : my foo:(Takes3Ints); I'd say that has to be something like: my foo:(Takes3Ints:); or maybe one of my foo:(Takes3Ints \!); my foo:(\Takes3Ints); my foo\(Takes3Ints); since Takes3Ints

proposal: rename 'subtype' declarator to 'set'

2005-11-09 Thread TSa
Larry Wall wrote: On Mon, Nov 07, 2005 at 01:05:16PM +0100, TSa wrote: : With the introduction of kind capture variables ^T we could complety : drop the subtype special form. As you pointed out the adding of : constraints happens with the where clause anyway. Thus we return to : the usage

Re: given too little

2005-11-10 Thread TSa
HaloO, Gaal Yahas wrote: I know why the following doesn't work: given $food { when Pizza | Lazagna { .eat } when .caloric_value $doctors_orders { warn no, no no } # ... } The expression in the second when clause is smart-matched against $food, not tested

Re: co/contra variance of roles/factories in theory.pod

2005-11-14 Thread TSa
HaloO, Larry Wall wrote: Another possibility is to take $? away from the compiler. All the compiler variables could go under $= instead, since pod is actually just one particular kind of compiler-time data, and there's really no particular mnemonic relationship between ? and the compiler. But

Re: Test Case: Complex Numbers

2005-11-17 Thread TSa
HaloO, Jonathan Lang wrote: Complex numbers come in two representations: rectilinear coordinates and polar coordinates: I think there's also the Riemanian two angle form of the complex number sphere with r = 0.5 around (0,0,0.5) touching the plane at the origin (0,0) and reaching up to

Re: ='s autoquoted identifiers

2005-11-18 Thread TSa
HaloO, Luke Palmer wrote: I think = gets special treatment from the parser; i.e. it is undeclarable. It's probably not even declarable as a macro, since it needs to look behind itself for what to quote. And I think this is okay. For some reason, we are not satisfied if if is undeclarable,

Re: \x{123a 123b 123c}

2005-11-21 Thread TSa
HaloO, Patrick R. Michaud wrote: There's also sp, unless someone redefines the sp subrule. And in the general case that's a slightly more expensive mechanism to get a space (it involves at least a subrule lookup). Perhaps we could also create a visible meta sequence for it, in the same way

Re: statement_controlfoo() (was Re: lvalue reverse and array views)

2005-11-21 Thread TSa
HaloO, Luke Palmer wrote: On 11/21/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote: Of course, the compiler is free to optimize these things if it can prove that runtime's statement_control:if is the same as the internal optimized statement_control:if. Which it definitely can't without some

Re: dis-junctive patterns

2005-11-22 Thread TSa
HaloO, Gaal Yahas wrote: In pugs, r7961: my @pats = /1/, /2/; say MATCH if 1 ~~ any @pats; # MATCH say MATCH if 0 ~~ any @pats; # no match So far so good. But: my $junc = any @pats; say MATCH if 1 ~~ $junc; # no match say MATCH if 0 ~~ $junc; # no match Bug?

Re: implied looping

2005-11-23 Thread TSa
Larry Wall wrote: On Wed, Nov 23, 2005 at 06:21:56PM +0100, Juerd wrote: : Larry Wall skribis 2005-11-23 9:19 (-0800): : ^5.each { say } : : Without colon? Yeah, that one doesn't work a couple of way. Unfortunately .each still binds tighter than ^ too. So it'd have to be:

Re: type sigils redux, and new unary ^ operator

2005-11-24 Thread TSa
HaloO, Ruud H.G. van Tol wrote: Yes, it could use a step: ^42.7 = (0, 7, 14, 21, 28, 35) ^42.-7 = (35, 28, 21, 14, 7, 0) OK, fine if the step sign indicates reversal after creation. That is, the modulus is 7 in both cases. ^-42.7 = (-35, -28, -21, -14, -7, 0) ^-42.-7 = (0, -7, -14,

Re: directional ranges

2005-11-25 Thread TSa
HaloO, Ruud H.G. van Tol wrote: Not at all: they just overlap at 0. OK, to me this spoils regularity. Like 'ab ' ~ ' xy' becoming 'ab xy' is at least surprising, if not outright wrong. That is (~$x).chars + (~$y).chars == +((~$x) ~ (~$y)) should always hold. Same thing for list

Re: type sigils redux, and new unary ^ operator

2005-11-25 Thread TSa
HaloO, Michele Dondi wrote: IMHO the former is much more useful and common. Mathematically (say, in combinatorics or however dealing with integers) when I happen to have to do with a set of $n elements chances are to a large extent that it is either 0..$n or 1..$n; 0..$n may lead to confusion

Re: type sigils redux, and new unary ^ operator

2005-11-25 Thread TSa
HaloO, 0 .. 5 == ( 0, 1, 2, 3, 4) Hmm, and 0..5.1 == (0,1,2,3,4,5) to rescue the end. --

Re: the $! too global

2005-12-05 Thread TSa
HaloO, Darren Duncan wrote: The problem is that $! is being treated too much like a global variable and not enough like a lexical variable. Consider the following example: Wasn't the idea to have $! only bound in CATCH blocks? sub foo () { try { die MyMessage.new( 'key' =

Re: the $! too global

2005-12-05 Thread TSa
HaloO, Nicholas Clark wrote: No, I think not, because the closure on the last line closes over a read/write variable. It happens that read only reference to the same variable is passed into the subroutine, but that's fine, because the subroutine never writes to *its* reference. So, you argue

Re: the $! too global

2005-12-07 Thread TSa
HaloO, Larry Wall wrote: My gut-level feeling on this is that $! is going to end up being an env variable like $_. I just re-read about exceptions. Well, I undestand now that $! is intented as a variable with a spectrum of meanings ranging from 1) the return value of a sub, through 2) an

Re: handling undef better

2005-12-22 Thread TSa
HaloO, Larry Wall wrote: And replying to the thread in general, I'm not in favor of stricter default rules on undef, because I want to preserve the fail-soft aspects of Perl 5. Also replying to the thread in general, I feel that undef as a language concept mixes too many usefull concept into

Re: Problem with dwimmery

2005-12-22 Thread TSa
HaloO, Luke Palmer wrote: Recently, I believe we decided that {} should, as a special case, be an empty hash rather than a do-nothing code, because that's more common. Ups, is that distinction needed eagerly? Wouldn't the return value of a do-nothing code return a value that when coerced into

  1   2   3   4   5   6   7   >