Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-09 Thread TSa (Thomas Sandlaß)
On Tuesday, 9. November 2010 01:45:52 Mason Kramer wrote: > I have to disagree here. Arrays and Hashes may be about storage (I don't > think they are, though, since you can change the (storage) implemenation of > an Array or Hash via its metaclass and it can still remain an Array or > Hash). What

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-08 Thread TSa (Thomas Sandlaß)
On Monday, 8. November 2010 17:20:43 Jon Lang wrote: > Solomon Foster wrote: > > Well, hyperoperators work fine on Hashes, they operate on the values, > > paired up by key if needed.  (That is, %hash>>++ doesn't care about > > the keys, %hash1 >>+<< %hash2 sums based on keys.)  I would assume > > t

Re: Smart match isn't on Bool

2010-08-02 Thread TSa (Thomas Sandlaß)
HaloO, On Monday, 2. August 2010 20:02:40 Mark J. Reed wrote: > On Sun, Aug 1, 2010 at 6:02 PM, Jonathan Worthington wrote: > > No, given-when is smart-matching. The RHS of a smart-match decides what > > happens. If you do True ~~ 1 then that's 1.ACCEPTS(True) which is going > > to do +True and

Re: Smart match isn't on Bool

2010-08-01 Thread TSa (Thomas Sandlaß)
HaloO, On Saturday, 31. July 2010 20:47:49 Patrick R. Michaud wrote: > On Sat, Jul 31, 2010 at 10:56:47AM -0600, David Green wrote: > > It's not unreasonable, especially if that's what you expect. > > But it's even more reasonable to expect this to work: > > given $something { > >

Re: Smart match isn't on Bool

2010-07-31 Thread TSa (Thomas Sandlaß)
HaloO, On Saturday, 31. July 2010 18:56:47 David Green wrote: > On 2010-07-31, at 1:33 am, Moritz Lenz wrote: > > sub test() { True }; > > given 0 { when test() { say "OH NOEZ" } } > > I don't think it's unreasonable to expect the output to be "OH NOEZ". How does this relate the given to the when

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread TSa (Thomas Sandlaß)
On Wednesday, 28. July 2010 05:12:52 Michael Zedeler wrote: > Writing ($a .. $b).reverse doesn't make any sense if the result were a > new Range, since Ranges should then only be used for inclusion tests (so > swapping endpoints doesn't have any meaningful interpretation), but > applying .reverse c

Re: Type system for Perl 6

2010-02-05 Thread TSa (Thomas Sandlaß)
HaloO Mr Castagna, On Friday, 5. February 2010 23:13:25 you wrote: > Actually I noticed an old post you did on this list 5 years ago. It > contained the following drawing Yeah it's a long time. And I've sort of lost interest in type theory. But then I tried to persuade the list of a sophisticated

Re: Type system for Perl 6

2010-02-05 Thread TSa (Thomas Sandlaß)
HaloO Mr Castagna On Friday, 5. February 2010 16:43:26 you wrote: > I see I'm going out of the scope of this list. I apologize for spamming, > but please continue to post here or send me by PM every information about > Perls 6 types. I'm delighted to have you interested in Perl 6. I know your boo

Re: How does List.map: { .say } work?

2009-11-04 Thread TSa (Thomas Sandlaß)
HaloO, On Tuesday, 3. November 2009 17:13:22 Carl Mäsak wrote: > That would make statement modifier for loops less useful. For those, > there's nowhere to put the lambda arrow. > > ++$_ for @things; I think this is resolved with the is ref binding which implies that the thingy that is bound to

Re: Int/Rat max precision (was Re: r28882 - docs/Perl6/Spec)

2009-10-27 Thread TSa (Thomas Sandlaß)
HaloO, On Friday, 23. October 2009 02:27:00 Darren Duncan wrote: > Thinking further, my interpretation of what you said above is that the > Rational role is now basically saying that a number is represented in terms > of numerator/denominator and that certain operators are supported, but now > it

Re: role invocant slot in type sig (was: unusual invocants)

2009-10-26 Thread TSa (Thomas Sandlaß)
HaloO, On Thursday, 22. October 2009 20:58:15 I wrote: > The class Dogwood however might be written as > >class Dogwood does Dog[Dogwood:] does Wood[Dogwood:] >{ >method Dog {...} >method Wood {...} >method bark {...} >} On #perl there was the question if any t

Re: unusual invocants

2009-10-26 Thread TSa (Thomas Sandlaß)
HaloO, On Sunday, 25. October 2009 01:38:21 Martin D Kealey wrote: > Sounds like going back to static typing -- which does sometimes have some > advantages. Well, you can also consider it dynamic. The important point is that it is a constraint on allowed types e.g. in the sig of a sub or on a var

role invocant slot in type sig (was: unusual invocants)

2009-10-22 Thread TSa (Thomas Sandlaß)
HaloO, On Thursday, 22. October 2009 18:31:16 I wrote: > The invocant slot of the role signature is sort of implied in the spec > already! I also like this because a type in Perl 6 is then always > written as SomeRole[SomeClass:]. Classes without explicit roles are > Any[SomeClass:] and untyped is

Re: unusual invocants

2009-10-21 Thread TSa (Thomas Sandlaß)
HaloO, On Wednesday, 21. October 2009 12:40:06 Mark J. Reed wrote: > Rather than disallow the composition, I'd say that any class, role, or > object that does both roles must override the method in question. The problem that Ovid posed needs to be resolved in the dispatch tables seen in certain m

Re: unusual invocants

2009-10-20 Thread TSa (Thomas Sandlaß)
HaloO, On Tuesday, 20. October 2009 18:35:36 David Green wrote: > >> So what the OP wants to do is declare a method that is available on > >> all those invocants - and only those invocatnts - which do all of > >> roles X, Y, and Z. Granted, you can declare a new role XandYandZ > >> that does X, Y

Re: Freezing role methods

2009-10-14 Thread TSa (Thomas Sandlaß)
HaloO, On Wednesday, 14. October 2009 12:18:30 Ovid wrote: > You *could* (this wasn't explained in the paper) extract those > methods into C::x(), check your callers and dispatch as appropriate, but > that would get very problematic, particularly with roles composed of other > roles. I consider t

Re: Synopsis 02: Range objects

2009-08-28 Thread TSa (Thomas Sandlaß)
On Thursday, 27. August 2009 23:58:51 Jon Lang wrote: > It might also be nice to have a stringifying version; perhaps 'be', > using the same "everything's an acronym" naming convention used by > other stringifying operators (e.g., 'lt' is "less than", 'le' is 'less > than or equal to', 'leg' is "le

Re: On Sets (Was: Re: On Junctions)

2009-03-28 Thread TSa (Thomas Sandlaß)
HaloO, On Friday, 27. March 2009 12:57:49 Daniel Ruoso wrote: > 1 - multi infix:<+>(Set $set, Num $a) > This would return another set, with each value of $set summed with $a. I think that this mixed case should numify the set to the number of elements to comply with array semantics. infix:<+> sho

Re: Logo considerations

2009-03-25 Thread TSa (Thomas Sandlaß)
On Tuesday, 24. March 2009 05:47:12 Darren Duncan wrote: > If you're going for sciencey or mathey illustrations, then I think its > important to include something that speaks quantum physics in there, since > quantum superpositions aka Junctions are one of the big central user > features that Perl

Re: a junction or not

2009-03-18 Thread TSa (Thomas Sandlaß)
HaloO, On Tuesday, 17. March 2009 10:25:27 David Green wrote: > > That is, it would return a Junction of Str, not a Str. So the > > question is how to get something that returns an expression to the > > effect of: > > 'any(' ~ $choice.eigenstates.«perl.join(',') ~ ')' > > say $choice.perl > >

Re: Range and continuous intervals

2009-03-01 Thread TSa (Thomas Sandlaß)
On Friday, 27. February 2009 07:42:17 Darren Duncan wrote: > I was thinking that Perl 6 ought to have a generic interval type that is > conceptually like Range, in that it is defined using a pair of values of an > ordered type and includes all the values between those, but unlike Range > that type

Re: Comparing inexact values (was "Re: Temporal changes")

2009-02-24 Thread TSa (Thomas Sandlaß)
On Tuesday, 24. February 2009 17:59:31 Larry Wall wrote: > So it might be better as a (very tight?) operator, regardless of > the spelling: > > $x ~~ $y within $epsilon This is a pretty add-on to smartmatch but I still think we are wasting a valueable slot in the smartmatch table by making num

Re: min= (from "Rakudo Built-ins Can Now Be Written In Perl 6")

2009-02-24 Thread TSa (Thomas Sandlaß)
On Tuesday, 24. February 2009 07:30:05 Carl Mäsak wrote: > >    my $foo is limited(100..200); > >    $foo = 5;                       # really does $foo = 100 > > Sounds like a good idea for a CPAN module. You can already do > something similar with the subset keyword, though: > > subset Percentage

Re: References to parts of declared packages

2009-02-13 Thread TSa (Thomas Sandlaß)
On Friday, 13. February 2009 20:30:24 Larry Wall wrote: > While taking a shower I refined the design somewhat in my head, > thinking about the ambiguities in package names when you're redefining. > By my previous message, it's not clear whether the intent of > > multi package Foo::Bar {...} > >

Re: returning one or several values from a routine

2009-01-06 Thread TSa (Thomas Sandlaß)
On Tuesday, 6. January 2009 22:01:36 Jon Lang wrote: > item($x) # Dwimmey use of item context. IIRC this is the same as $$x, right? Or does that extract the invocant slot without dwimmery? > list($x) # Dwimmey use of list context. > hash($x) # Dwimmey use of hash context. > $x._ # the Cap

Re: Smooth numeric upgrades?

2008-10-05 Thread TSa (Thomas Sandlaß)
HaloO, On Sunday, 5. October 2008 04:23:42 Darren Duncan wrote: > Note that just as integers are naturally radix independent, the unlimited > rationals should be too, and the latter can compactly represent all > rationals as a triple of integers corresponding roughly to a (normalized) > [mantissa,

Re: [svn:perl6-synopsis] r14585 - doc/trunk/design/syn

2008-10-05 Thread TSa (Thomas Sandlaß)
On Wednesday, 1. October 2008 21:54:12 [EMAIL PROTECTED] wrote: > If you apply an assignment operator to a protoobject, it is assumed that > you are implementing some kind of notional "reduction" to an accumulator > -variable. To that end, the base operator is dropped and a simple > -assignment

Re: What happened to "err" operator?

2008-09-07 Thread TSa (Thomas Sandlaß)
HaloO, On Thursday, 4. September 2008 03:39:20 Larry Wall wrote: > Another potential issue is that CATCH doesn't distinguish exceptions > coming from the current block from those coming from the subcall to a(). > So it could end up returning Failure from the current block when > you intended to fo

Re: arrayref/hashref in spectest suite

2008-08-20 Thread TSa (Thomas Sandlaß)
On Monday, 18. August 2008 20:38:05 Patrick R. Michaud wrote: > I would somewhat expect > a reference to be instead handled using a statement like > > $foo[1] := $bar; > > Comments and clarifications appreciated. I would also opt for copy semantics whenever = is used for assignment. But it see

Re: Allowing '-' in identifiers: what's the motivation?

2008-08-11 Thread TSa (Thomas Sandlaß)
On Monday, 11. August 2008 05:35:03 John M. Dlugosz wrote: > E.g. see : > > sub bar { > return 100; > } > sub foo { 50;} > sub foo-bar { >return rand(50); >} > if (foo - bar != foo-bar) { >print "Haha!\n"; > } Actually I can even imagine

Re: Some details of function return captures

2008-08-10 Thread TSa (Thomas Sandlaß)
HaloO, On Saturday, 9. August 2008 01:32:35 John M. Dlugosz wrote: > TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: > > If such a ReturnCapture could also be > > preliminary of some kind, then lvalue subs could be lazily resumed when > > the rvalue comes in. > > Can you elaborate on that? I don

Re: Differential Subscripts

2008-08-10 Thread TSa (Thomas Sandlaß)
On Saturday, 9. August 2008 04:41:46 John M. Dlugosz wrote: > Is this magic known to the parser at a low level, or is it possible to > define your own postcircumfix operators that interact with the > interpretation of the argument? My interpretation is that there is a Whatever type that most of th

meta_postfix:<*>

2008-07-13 Thread TSa (Thomas Sandlaß)
HaloO, I know that the hot phase of the operator discussions are over. But here's a little orthogonalizing idea from my side. The observation is that * can be regarded as repeated addition: 5 * 3 == 5 + 5 + 5 and ** as repeated multiplication. Now imagine having a meta_postfix:<*> that gives +* as

Re: Rakudo test miscellanea

2008-06-29 Thread TSa (Thomas Sandlaß)
HaloO, On Thursday, 26. June 2008 18:46:25 Larry Wall wrote: > Neither "is" nor "does" is quite right here, because the mathematicians > have seen fit to confuse representation semantics with value semantics. :) Hmm, but the uppercase types should hide the representation type. IOW, there's only

Re: fallback semantics of list methods

2008-06-16 Thread TSa (Thomas Sandlaß)
HaloO, On Saturday, 14. June 2008 18:43:05 Daniel Ruoso wrote: > Moritz convinced me that there's actually no real reason to support > > $nonlist.listmethod I wouldn´t do that either. But I come to that conclusion from the line of thought that it is generally a bad idea to block an Any slot in

Re: constraint imperative programming (CIP)

2008-06-16 Thread TSa (Thomas Sandlaß)
HaloO, On Monday, 16. June 2008 10:03:13 Ovid wrote: > --- TSa <[EMAIL PROTECTED]> wrote: > ... why do you think that > > the way to get at the constraint programming paradigm are the subset > > type definitions? > > Because I can't think of any other way to do it :) So I´ll try to come up with s

Re: Google index and subsets (two topics for the price of one!)

2008-06-16 Thread Thomas Sandlaß
HaloO, On Monday, 16. June 2008 10:11:49 Ovid wrote: > For example, should the pre/postfix '++' be > listed as having a side-effect? I think so. But the scope where these side-effects take place is important as well. In your second example below the side-effect is restrained to the subs scope. Th

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

2005-08-09 Thread TSa (Thomas Sandlaß)
HaloO, Stevan Little wrote: Here is a 10,000 ft view of the metamodel prototype I sketched out the other day (http://svn.openfoundry.org/pugs/perl5/Perl6-MetaModel/docs/ 10_000_ft_view.pod). It should shed a little light on this discussion. There you have i(Foo) - instance of Foo

Re: Container model - pictures and questions

2005-08-08 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: If I'm mistaken, please let me know, preferably by suggesting new arrangements on the diagram. :-) Without judging your mistakes, here are my comments to the container picture. 1) I would move the ::name to the Pad level. The idea is that ::name is some less spe

Re: Elimination of Item|Pair and Any|Junction

2005-08-08 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: On Thu, Jul 28, 2005 at 09:27:00AM -0700, Larry Wall wrote: Or maybe Any really does mean "Object" and we're just viewing our hierarchy too strictly if we make every relationship "isa". That's one thing that neither this formulation nor Thomas's are making very cle

Re: Complete type inferencing

2005-08-08 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: Yes, I'm aware of Theta's static where clauses, but Perl 6's where clause is much more dynamic and almost always undecidable. I know, but what does that buy the programmer? I see a type system as support of a declarative programming style. Thus the dynamic part of t

TSa's Perl 6 type lattice version 1.0

2005-08-04 Thread TSa (Thomas Sandlaß)
HaloO, in case someone might be interested, here is my more or less complete idea of the Perl 6 type lattice as ASCII art. Enjoy. Comments welcome. ::Any ...| ... ___:___/|\__

Re: Do slurpy parameters auto-flatten arrays?

2005-08-04 Thread TSa (Thomas Sandlaß)
HaloO, Piers Cawley wrote: By the way, if flattening that way, what's the prototype for zip? We can after all do: zip @ary1, @ary2, @ary3, ... @aryn How about sub zip( List [EMAIL PROTECTED] ) {...} a slurpy List of Array of List. The return value is a not yet iterated Code object tha

Re: zip with ()

2005-08-04 Thread TSa (Thomas Sandlaß)
HaloO, Luke Palmer wrote: On 8/1/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: In general, (@foo, @bar) returns a new list with the element joined, i.e. "@foo.concat(@bar)". If you want to create a list with two sublists, you've to use ([EMAIL PROTECTED], [EMAIL PROTECTED]) or ([EMAIL PROTE

Re: Do slurpy parameters auto-flatten arrays?

2005-08-04 Thread TSa (Thomas Sandlaß)
HaloO, Luke Palmer wrote: On 8/3/05, Aankhen <[EMAIL PROTECTED]> wrote: On 8/3/05, Piers Cawley <[EMAIL PROTECTED]> wrote: So how *do* I pass an unflattened array to a function with a slurpy parameter? Good question. I would have thought that one of the major gains from turning arrays and

Re: If topicalization

2005-08-03 Thread TSa (Thomas Sandlaß)
HaloO, Luke Palmer wrote: I vaguely recall that we went over this already, but I forgot the conclusion if we did. I have a proposal about block owner and block topic pending. But I guess no one noticed it, ... In Damian and Larry's talk here at OSCON, I saw the example: if foo() -> $fo

Re: Eliminating &{} and *{}

2005-08-03 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: All this led us to think about whether (my &foo) can be merely treated the same as (my Code $foo). The mutable form will enable convenient notations such as: I think (my Code $foo) should be an error on the same reason as (my Array $foo) is an error. A $var can onl

Re: sub foo ($x) returns ref($x)

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: On Mon, Aug 01, 2005 at 03:16:50PM +0200, "TSa (Thomas Sandla�)" wrote: sub equitype ( ::a $x, a $y) { ... } That's not a bad idea at all. I rather like it. I'd just still like an explicit type-unifying parens around ::a, just so people won't say I try to m

Re: sub foo ($x) returns ref($x)

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: [..] For example, assuming argument types are unified in a single phase, the example below does nothing useful: sub equitype ((::a) $x, (::a) $y) { ... } It won't not help even if we replace the implicit "does" with "of": sub equitype ($x of (::a), $y of (:

Re: zip with ()

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Andrew Shitov wrote: TTS> BTW, you didn't mean originally: TTS>say zip (@odd), (@even); # prints 13572468 or 12345678? That is exactly like with similar printing result of sub() call: print sqrt (16), 5; # shout print 45. That all hinges on the type of the symbol. I guess &s

Re: zip with ()

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Ingo Blechschmidt wrote: Whitespace is significant: say zip @odd, @even;# &zip gets two arguments, result is # 12345678. say zip(@odd, @even); # &zip gets two arguments, result is # 12345678. say zip (@odd, @even);

Re: zip with ()

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Andrew Shitov wrote: Is it possible to avoid significance of whitespaces? Yes, with: say zip .(@odd, @even); Looks like a method and *is* a method in my eyes. First &zip is looked-up and then bound as block owner. Arguments are of course two array refs to @odd and @even respectively

Re: [S29] Mutating map and grep

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Ingo Blechschmidt wrote: Is this a bug in S29 or will this be feature removed from Perl 6 and you'll have to say (for example) use listops :mutating; my @result = map { $_++; 42 } @array; # works now Why not just my @result = map -> $_ is rw { $_++; 42 } @array; # works

Re: Complete type inferencing

2005-07-29 Thread TSa (Thomas Sandlaß)
HaloO Autrijus, you wrote: Interested readers can consult Manfred Widera's similar work for Scheme, in his "Complete Type Inference in Functional Programming" paper. Uih, you call a 300 page book a paper? I'm impressed. If that is the thing you read between tramp stations here's one of my favo

Re: Slurpy "is rw" arrays ([EMAIL PROTECTED] is rw)

2005-07-29 Thread TSa (Thomas Sandlaß)
HaloO, Adriano Ferreira wrote: Only sub foobar (@args) { push @args, 42 } would change @some_array in foobar @some_array; That is how I undestood that. Can someone confirm this belief? I share your belief. It's up to others to confirm it. I just want to add that I f

Re: Type::Class::Haskell does Role

2005-07-28 Thread TSa (Thomas Sandlaß)
HaloO Luke, you wrote: All in all, generic equality and comparison is something that Perl 5 did really poorly. Some people overloaded eq, some overloaded ==, some wrote a ->equal method, and there was no way to shift between the different paradigms smoothly. This is one of the times where we h

Re: The meaning of "returns"

2005-07-28 Thread TSa (Thomas Sandlaß)
HaloO Autrijus, you wrote: D) Make the return type observe both #2 and #3 at compile time, using type variables: sub id ( (::T) $x ) returns ::T { return($x) } And this is a natural extension to guide the inferencer so it won't be totally giving up on polymorphic functions such a

Re: Messing with the type heirarchy

2005-07-28 Thread TSa (Thomas Sandlaß)
HaloO Michele, you wrote: On Wed, 27 Jul 2005, [ISO-8859-1] TSa wrote: value to carry on a useless imaginary part. And Complex should consistently return undef when compared to other Nums or Complexes. And the Compare role My 0.02+0.01i: in mathematics it is commonly used to write e.g. z<3

Re: Inferring (Foo of Int).does(Foo of Any)

2005-07-28 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: [..much better explaination of the co/contra prob then mine skipped..] Hence, my proposal is that Perl 6's generics should infer its variancy, based on the signature of its methods, and derive subtyping relationships accordingly. Yes!! That would be great. But I wou

Re: Elimination of Item|Pair and Any|Junction

2005-07-28 Thread TSa (Thomas Sandlaß)
Larry Wall wrote: On Wed, Jul 27, 2005 at 06:28:22PM +0200, "TSa (Thomas Sandlaß)" wrote: : Since we are in type hierachies these days, here's my from ::Any : towards ::All version. That's pretty, but if you don't move Junction upward, you haven't really addr

Re: Elimination of Item|Pair and Any|Junction

2005-07-27 Thread TSa (Thomas Sandlaß)
HaloO, Larry Wall wrote: Yes. The only thing I don't like about it is that any() isn't an Any. Maybe we should rename Any to Atom. Then maybe swap Item with Atom, since in colloquial English you can say "that pair of people are an item." Since we are in type hierachies these days, here's my

Re: execution platform object? gestalt?

2005-07-27 Thread TSa (Thomas Sandlaß)
Randal L. Schwartz wrote: This is similar to the OS-9's "gestalt" tables, which got smarter as the operating system had more features, but was a consistent way to ask "do we have a color monitor here?". Is something like this already planned? From my bubble in the Perl6 Universe this thing is

Re: Messing with the type heirarchy

2005-07-27 Thread TSa (Thomas Sandlaß)
HaloO, Ingo Blechschmidt wrote: I've probably misunderstood you, but...: role Complex does Object {...} Num does Complex; # That should work and DWYM, right? My 0.02: Complex should provide e.g. a + that, when called with two Nums, doesn't bother the return value to carry on a use

Re: Exposing the Garbage Collector (Iterating the live set)

2005-07-27 Thread TSa (Thomas Sandlaß)
Luke Palmer wrote: On 7/26/05, "TSa (Thomas Sandlaß)" <[EMAIL PROTECTED]> wrote: Piers Cawley wrote: I would like to be able to iterate over all the objects in the live set. My Idea actually is to embedd that into the namespace syntax. The idea is that of looking up non

block owner, topic and the referential environment

2005-07-27 Thread TSa (Thomas Sandlaß)
ating some code, some revamping or other &DEEP_MAGIC. Hmm, debug exceptions come to mind... -- TSa (Thomas Sandlaß)

Re: Do slurpy parameters auto-flatten arrays?

2005-07-27 Thread TSa (Thomas Sandlaß)
d is in that view a *metric* dispatcher on the middle ::Any between the selector before the dot and the return type after the arrow. say bar(@array, "z");# 2 (or 5?) I opt for 2. say bar([EMAIL PROTECTED]);# 4 Yep. -- TSa (Thomas Sandlaß)

Re: Exposing the Garbage Collector (Iterating the live set)

2005-07-26 Thread TSa (Thomas Sandlaß)
. allows to define the boolean "type" as *::false ::= *::bit::0; *::true ::= *::bit::$_??$_::*false; or so. And whitespace around ?? and :: doesn't matter! ?? just means skip next lookup if "lookup" fails. Regards, -- TSa (Thomas Sandlaß)

Re: Exposing the Garbage Collector (Iterating the live set)

2005-07-26 Thread TSa (Thomas Sandlaß)
s that the current meaning needs parens like ($condition ?? $value :: $other) for preventing strange tokenization. OTOH would the barebone structure of Perl6 revolve around ?? :: ::= () ; and namespace lookup. -- TSa (Thomas Sandlaß)

Re: Exposing the Garbage Collector

2005-07-25 Thread TSa (Thomas Sandlaß)
o verbose. Should be condensed to: has $.hidden is rw from %private_data; BTW, I would like to coin the term 'onboard method' for a code slot of type Method. # initialized from class has $.cache is rw from source; # virtual per instance has $.value from {...}; } -- TSa (Thomas Sandlaß)

Re: Exposing the Garbage Collector

2005-07-25 Thread TSa (Thomas Sandlaß)
t authority. But it's not my private opinion anymore ;) By posting it, it has become part of our @opinions since this $email does ::Perl6::Language :) BTW, this also gives us: my @twodim has shape(2); -- TSa (Thomas Sandlaß)

Re: Do I need "has $.foo;" for accessor-only virtual attributes?

2005-07-22 Thread TSa (Thomas Sandlaß)
forgets about the Foo role itself. Ups, I hoped that the type system would find out mismatches of the objects actual structure and the methods expectations of it. Essentially rendering the method in question not applicable to the object anymore. BTW, what is the inverse operation of bless? Expel? -- TSa (Thomas Sandlaß)

Re: Do I need "has $.foo;" for accessor-only virtual attributes?

2005-07-22 Thread TSa (Thomas Sandlaß)
ublicly visible method is called. The private method must be in scope there. The only requirement on the name is to not leak out into public namespace. The problem with $?SELF.:foo() is that people see that as a .: operator on the foo method. Which is a *BIG* problem in an Operator Oriented Language! -- TSa (Thomas Sandlaß)

Re: Do I need "has $.foo;" for accessor-only virtual attributes?

2005-07-21 Thread TSa (Thomas Sandlaß)
SELF that Foo is composed into obviously is a subtype of Foo. What happens with this hidden payload if the object changes its type such that it is no Foo anymore? E.g. by undefining the slot &.Foo::foo? Regards, -- TSa (Thomas Sandlaß)

Re: Do I need "has $.foo;" for accessor-only virtual attributes?

2005-07-21 Thread TSa (Thomas Sandlaß)
ch requires a self type of ::FooDefiner and I think that Int.does(FooDefiner::foo) is false. So an invocation of &FooDefiner::foocaller would simply produce a type error or six warnings and no printout if the foo calls are dispatched over $_, right? Regards, -- TSa (Thomas Sandlaß)

Re: Referring to package variables in the default namespace in p6

2005-07-21 Thread TSa (Thomas Sandlaß)
ny confusion over whether $::foo was your 'closest' $foo variable or something else. So to conclude, for reading they amount to the same result but through different paths. But since the symbolic lookup might result in undef the behaviour for writing is indeed a Very Different Thing. @

Re: MML dispatch

2005-07-21 Thread TSa (Thomas Sandlaß)
); for some_values { say } Hmm, looks somewhat unperlish :)) -- TSa (Thomas Sandlaß)

Re: More on Roles, .does(), and .isa() (was Re: Quick OO .isa question)

2005-07-21 Thread TSa (Thomas Sandlaß)
chromatic wrote: On Tue, 2005-07-19 at 18:47 +0200, "TSa (Thomas Sandlaß)" wrote: I strongly agree. They should share the same namespace. Since code objects constitute types they also share this namespace. This means that any two lines of class Foo {...} roleFoo {...} s

Re: Referring to package variables in the default namespace in p6

2005-07-21 Thread TSa (Thomas Sandlaß)
alence of $foo and $::foo as TIMTOWTWI. I dought that assigning two different meanings just because their are two syntactical forms is a good idea. in their behaviour, and I (and other future legions of newbies) would despair. :) You consider yourself a 'legion of newbies' ;) -- TSa (Thomas Sandlaß)

Re: Referring to package variables in the default namespace in p6

2005-07-21 Thread TSa (Thomas Sandlaß)
g that does the Scalar/Item role! We can consider the sigils as lookup filters. Regards, -- TSa (Thomas Sandlaß)

Re: Referring to package variables in the default namespace in p6

2005-07-20 Thread TSa (Thomas Sandlaß)
d when. I think the compiler has the information about all lexicals and could put them in the right place in the name space tree *before* execution. Would that be at CHECK or INIT time? -- TSa (Thomas Sandlaß)

Re: User-defined behaviour of hashes in list context

2005-07-20 Thread TSa (Thomas Sandlaß)
; my @array = %hash; # should call my own routine I hope the initialisation in my also calls the overloaded operator. But why shouldn't it? -- TSa (Thomas Sandlaß)

Re: More on Roles, .does(), and .isa() (was Re: Quick OO .isa question)

2005-07-19 Thread TSa (Thomas Sandlaß)
l for Method... hmm have to think about that! -- TSa (Thomas Sandlaß)

Re: How do subroutines check types?

2005-07-19 Thread TSa (Thomas Sandlaß)
y instanciating the class Foo. -- TSa (Thomas Sandlaß)

Re: MML dispatch

2005-07-19 Thread TSa (Thomas Sandlaß)
the type system. If Perl6 wants to live up to the claim of (optional) strong typing then the dispatch must be first on the type lattice and then on the class hierarchy. The folks who don't want to adhere to typing might avoid the type dispatch and appear to the type dispatchers as Anys or some scoped package or module type. Regards, -- TSa (Thomas Sandlaß)

Re: MML dispatch

2005-07-19 Thread TSa (Thomas Sandlaß)
allow a compile time detection. Note that the ambiguity doesn't go away with a metric approach because there are no other parameters that could compensate. Regards, -- TSa (Thomas Sandlaß)

Re: MML dispatch

2005-07-13 Thread TSa (Thomas Sandlaß)
p;l=50&co1=AND&d=ptxt&s1=ferragina.INZZ.&OS=IN/ferragina&RS=IN/ferragina I haven't check the relevance to Perl6 yet. Has someone access to the STOC'99 paper? -- TSa (Thomas Sandlaß)

Re: MML dispatch

2005-07-13 Thread TSa (Thomas Sandlaß)
HaloO Larry, you wrote: On Tue, Jul 12, 2005 at 08:13:22PM +0200, "TSa (Thomas Sandlaß)" wrote: : Actually it's a pitty, that the multi method call syntax isn't as : rich as the single method call syntax where we have .?method, .+method : and .*method. Something like (S

Re: MML dispatch

2005-07-12 Thread TSa (Thomas Sandlaß)
Mark Reed wrote: On 2005-07-12 12:22, "TSa (Thomas Sandlaß)" <[EMAIL PROTECTED]> wrote: I am also interested in the rationale behind the approach to manage MMD my means of a metric instead of a partial order on the types. Metric is a geometric concept which in my eyes doesn&#

Re: How to write a self.pm (Re: method calls on $self)

2005-07-12 Thread TSa (Thomas Sandlaß)
lways coming in out of band? So .bar is always invoked on the invocant of &foo if we think that there is an implicit $_ := $?SELF before the call to &baz in &foo. And I hope the binding of $_ to $?SELF is a read-only binding! -- TSa (Thomas Sandlaß)

Re: MML dispatch

2005-07-12 Thread TSa (Thomas Sandlaß)
does(Num) }) {...} beeing the same as multi sub foo (Num $x) {...} -- TSa (Thomas Sandlaß)

Re: MML dispatch

2005-07-12 Thread TSa (Thomas Sandlaß)
compensated by a good match. -- TSa (Thomas Sandlaß)

Re: Hackathon notes

2005-07-08 Thread TSa (Thomas Sandlaß)
n-invocant params, in assignments etc. For research on the topic see e.g. http://www.cs.washington.edu/research/projects/cecil/www/Papers/predicate-classes.html -- TSa (Thomas Sandlaß)

Re: Hackathon notes

2005-07-08 Thread TSa (Thomas Sandlaß)
stant I assumed lvalue subs would implicitly return void and an assignment goes to the function slot of the args used in the assignment and subsequent calls with these args return exactly this value. In that respect arrays and hashes are the prime examples of lvalue subs. Other uses are interpolated data, Delauny Triangulation etc. Regards, -- TSa (Thomas Sandlaß)

Re: Type variables vs type literals

2005-07-07 Thread TSa (Thomas Sandlaß)
be instanciable? I guess the explicit forms are: FooStuff[Int]::foo(1,2); &strfoo ::= (FooStuff[Str].new)::new; # from Autrijus Hackathon notes Will re-instanciation be prevented when the latter is spelled &strfoo := (FooStuff[Str].new)::foo; # or with = Actually this syntax might be wrong usage of ::. But do I get you right that the lazy forms are does FooStuff; # lazy role instanciation into current scope foo(1,2); # &FooStuff[Int]::foo:(Int,Int) foo(1,'blahh'); # type error? Regards, -- TSa (Thomas Sandlaß)

Re: Time::Local

2005-07-06 Thread TSa (Thomas Sandlaß)
. chars in strings depending on the Unicode level and index arithmetic of arrays. Some unification of the underlying math would be nice, indeed. And that typically involves starting from 0 and the positive remainder pointing into the day. Regards, -- TSa (Thomas Sandlaß)

Re: Submethods

2005-07-06 Thread TSa (Thomas Sandlaß)
Stevan Little wrote: You seem to indicate that submethods are not to be used on instances, and instead to be used on the underlying metaclass. I did not see anything of the sort in (Syn|Apoc)12 or in my (limited) search of the mailing list. Can you point me to that information? S12 says in th

Re: Type variables vs type literals

2005-07-06 Thread TSa (Thomas Sandlaß)
e(Int, 17); my @a = make(Array, [1,2,3]); # single element array? # or three element array? my $e = make(Int 'string'); # type error in &make? With the automatic binding of a ::Type variable to the type of it's argument the definition of &make could be shortend to sub make ( ::Type $value ) returns Type { ... } and called like this my $i = make(17); which at least prevents type errors ;) Regards, -- TSa (Thomas Sandlaß)

Re: Submethods

2005-07-06 Thread TSa (Thomas Sandlaß)
ctical distinction possible because of: my $object = new Foo; my $meta = $object.meta; $meta.bar() # calls submethod but looks like method call I guess the type of $meta is Ref of Class or somesuch. Regards, -- TSa (Thomas Sandlaß)

Re: return() in pointy blocks

2005-07-04 Thread TSa (Thomas Sandlaß)
Larry Wall wrote: On Wed, Jun 08, 2005 at 12:37:22PM +0200, "TSa (Thomas Sandlaß)" wrote: : BTW, is -> on the 'symbolic unary' precedence level : as its read-only companion \ ?. No, -> introduces a term that happens to consist of a formal signature and a blo

Re: Type variables vs type literals

2005-07-04 Thread TSa (Thomas Sandlaß)
bj; my T $y = $x; With my proposal from above the short form could be :[T] $x := $obj; my T $y = $x; or the current form with :() :(T) $x := $obj; my T $y = $x; Regards, -- TSa (Thomas Sandlaß)

  1   2   >