Roles and Trust

2005-10-05 Thread Ovid
uite I'm working on and it would be nice to be able to do stuff like this. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

Re: Roles and Trust

2005-10-05 Thread Ovid
t now, I can't see that it would be an issue. Still, I'm not entirely convinced that not allowing roles to assign trust is a good thing. It feels a bit arbitrary. Is there a compelling reason why roles should not do this? Cheers, Ovid -- If this message is a response to a question on

Re: Roles and Trust

2005-10-12 Thread Ovid
the "my" on there that this would affect those data types only locally? That seems like it would be a nice compromise. Is this legal syntax? Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

Private behavior in roles

2005-11-17 Thread Ovid
t requires *and* what it provides. Are Perl 6 roles really going to blindly export everything they contain? This seems a serious mistake. I didn't see anything addressing this issue in http://www.perl.com/pub/a/2004/04/16/a12.html?page=12 Cheers, Ovid -- If this message is a respons

Re: relational data models and Perl 6

2005-12-16 Thread Ovid
strong typing, we may still have something good, but it won't be the relational model. Of course, all of this would put us on the doorstep of logic programming but, if I recall correctly, a decision was already made that Perl 6 wouldn't be delayed for its inclusion. A sad, but necessar

Re: relational data models and Perl 6

2005-12-16 Thread Ovid
. Otherwise, into > C-land you will go, my son! I'm not entirely sure, but I think we agree here. You have to have, at minimum, one selector for each new datatype if for no other reason than to cast a string to your new data type. Otherwise, your data types would only be constants because

Fw: Logic Programming for Perl6 (Was Re: 3 Good Reasons... (typo alert!))

2006-05-25 Thread Ovid
Larry pointed out that this topic is better suited for perl6-language instead of perl6-users, so I'm forwarding this along. Feel free to exercise your "delete" key. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questi

Re: Fw: Logic Programming for Perl6 (Was Re: 3 Good Reasons... (typo alert!))

2006-05-27 Thread Ovid
;t know how their monads work or if they would be applicable :) > There's some information about this in S05, with more info promised: > http://dev.perl.org/perl6/doc/design/syn/S05.html#Matching_against_non-strings Ooh, looks promising. In that scenario, is a hash viewed as an array

Runtime role issues

2006-10-11 Thread Ovid
rl6/doc/design/syn/S12.html says: You can also mixin a precomposed set of roles: $fido does Sentry | Tricks | TailChasing | Scratch; Should that be the following? $fido does Sentry & Tricks & TailChasing & Scratch; Cheers, Ovid -- Buy the book -- http://w

Re: Runtime role issues

2006-10-11 Thread Ovid
ork, instances of objects in the M, V, or C portions might want to exhibit different behaviors, depending upon what I'm doing with them, but I don't necessarily want those behaviors to bleed over to the other layers of my application. Whether or not this is a clean way of looking at the p

S12: can(), signatures and casting

2007-04-28 Thread Ovid
that you're really getting back the exact type you want. As such, it seems like we'd need return values to guarantee that the returned type is exactly what we claimed. method foo(Int $bar, Int $baz) returns Int { return $foo/$baz; } Since the return value might be a Float, does i

Re: xml and perl 6

2007-11-29 Thread Ovid
ich doesn't suit my needs? If you'll pardon the tautology, when complex types are involved, what any user needs is dependent on what that user needs. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Perl and CGI - http://users.easystreet.com/ovid/cgi_course/ Persona

$obj.can("bark"); # or can it?

2008-01-03 Thread Ovid
tely deal with this? Though I could be in the minority, this does seem like a glaring hole in Perl 6's OO behavior. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Perl and CGI - http://users.easystreet.com/ovid/cgi_course/ Personal blog - http://publius-ovidius.livejournal.com/ Tech blog - http://use.perl.org/~Ovid/journal/

Instance and Class disambiguation?

2008-01-20 Thread Ovid
If I call this: if $class.^can('wibble') { ... } Does Perl 6 return false if that's only an instance method? Will the WALK iterator returned by .^can return references to instance methods? Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Perl

Re: Instance and Class disambiguation?

2008-01-21 Thread Ovid
--- Jonathan Lang <[EMAIL PROTECTED]> wrote: > Ovid wrote: > > If I call this: > > > > if $class.^can('wibble') { ... } > > > > Does Perl 6 return false if that's only an instance method? Will > the > > WALK iterator retur

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread Ovid
1], seeing it in an otherwise good paper is very jarring. Could this merely be a strange rendering artifact? Cheers, Ovid [1] Well, the monospaced bit isn't since I'm not used to programmers programming in word processors instead of text editors. Perhaps I'm spoiled :) -- Buy t

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread Ovid
ttp://i82.photobucket.com/albums/j275/publius_ovidius/Random/polymorphism.png Glad to see the nice work, though. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Perl and CGI - http://users.easystreet.com/ovid/cgi_course/ Personal blog - http://publius-ovidius.livejournal.com/ Tech blog - http://use.perl.org/~Ovid/journal/

Re: treatment of "isa" and inheritance

2008-04-30 Thread Ovid
cted to it. In this group, I'm > preaching to the choir anyway. So, isn't "isa" and the "£" merely things which can be added by programmers by changing the grammar? That was one of the design goals of the language. Cheers, Ovid -- Buy the book - http://www.or

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread Ovid
rk either since we're not specifying that we only need a subset of the behavior to work properly. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Perl and CGI - http://users.easystreet.com/ovid/cgi_course/ Personal blog - http://publius-ovidius.livejournal.com/ Tech blog - http://use.perl.org/~Ovid/journal/

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Ovid
n different objects. This is the false cognate problem. At its core, you have no syntactic difference and reflection can't tell you that these are radically different. The only difference is semantic, and that's what the programmer has to provide. Otherwise, we're all out of

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Ovid
functionality and the procedural/OO interfaces are clearly split). I can usually use the latter in place of the former, but since semantic meaning isn't attached, restricting me to roles doesn't work. Requiring others to use roles in this case is also too restrictive. Cheers, O

Re: treatment of "isa" and inheritance

2008-05-02 Thread Ovid
to be stealing a number of linguistic ideas (with the side effect of transforming our entire language from a pidgin to a creole), then we might as well consider that a couple of extra letters to introduce clarity may not be all that bad. Cheers, Ovid -- Buy the book - http://www.oreilly.

Re: Where is "Manhattan Dispatch" discussion?

2008-05-06 Thread Ovid
Can someone point to the discussion, position papers, etc.? This this: http://use.perl.org/~luqui/journal/27362 Luke makes some interesting comments, but you'll want to click the "Great Multimethod Debate" link (http://tinyurl.com/5hm4ze). Cheers, Ovid -- Buy the book - h

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

2008-06-09 Thread Ovid
5 with tie, but tied variables are no fun) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Personal blog - http://publius-ovidius.livejournal.com/ Tech blog - http://use.perl.org/~Ovid/journal/

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

2008-06-09 Thread Ovid
--- Moritz Lenz <[EMAIL PROTECTED]> wrote: > Ovid wrote: > > Anyone have any idea why Google is not indexing the official Perl 6 > > documentation at perlcabal.org/syn? I checked the robots.txt and > it > > looks fine: > > > > http://www.perlcabal.org

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

2008-06-09 Thread Ovid
--- Jonathan Worthington <[EMAIL PROTECTED]> wrote: > Ovid wrote: > > By default, block parameters (including $_) are readonly, I hope that is a deep readonly? In other words, if $_.position returns an array reference, can I mutate a value in that reference and the state o

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

2008-06-16 Thread Ovid
tric assertion instead of asymmetric, imperative > assignment. Now it's my turn to say that I can't follow that statement. > Could you give some hints on these fascinating wins, please. I explain in more detail at http://use.perl.org/~Ovid/journal/36667 You asked why I think that co

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

2008-06-16 Thread Ovid
de, not Perl's "context"). For example, should the pre/postfix '++' be listed as having a side-effect? sub side_effect{ return $_[0]++ } sub no_side_effect { my $x = shift; return $x++ } In Perl 6, since arguments to subs would have to be specifically written as 

Building Junctions from Junctions

2008-06-23 Thread Ovid
the old junction, but with some values removed. How do I do that in Perl 6? I can't see that in the docs. Clearly we don't this to be done destructively as I suspect this will break autothreading, but building new junctions based on old junctions seems reasonable. Cheers, Ovid -- B

Re: Should C and C work in C ?

2008-06-30 Thread Ovid
d new junctions based on the values of old junctions. grep and map would make that trivial. If I've misunderstood, feel free to print this out and burn it :) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/j

Re: Should C and C work in C ?

2008-06-30 Thread Ovid
--- On Mon, 30/6/08, Ovid <[EMAIL PROTECTED]> wrote: > --- On Sun, 29/6/08, Patrick R. Michaud > <[EMAIL PROTECTED]> wrote: > > > Do C and C act like the > > C method, in that > > they work for C object and not just objects > of > > type

Running Perl 6 Tests

2008-10-20 Thread Ovid
ot; to fail, even though it's merely a parse error. The Test.pm module appears to work (I've only checked it superficially), so why not use that to make some of these tests a bit easier to write? Are we trying to avoid loading modules while testing core features? Cheers, Ovid

Re: Running Perl 6 Tests

2008-10-20 Thread Ovid
with "use Test;" to at least ensure that "make perl6" passes and people don't get confused when trying to build. I'd be happy to update that test and send a patch. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog

Bug or feature? Hash autovivification

2008-12-31 Thread Ovid
); sub foo ($obj is rw) {...} # same thing, basically my %hash; %hash = "foo"; # duh So is this a bug? Revision: 34706 $ uname -a Darwin curtis-poes-computer-3.local 9.5.1 Darwin Kernel Version 9.5.1: Fri Sep 19 16:19:24 PDT 2008; root:xnu-1228.8.30~1/RELE

Not a bug?

2009-01-11 Thread Ovid
I really don't think this is a bug, but it did confuse the heck out of me at first. This *is* expected behavior due to how {} is interpolated in strings, yes? $ perl6 -e 'my $foo = "foo";say "<" ~ $foo ~ ">"' $ perl6 -e 'my $foo =

Extending classes in a lexical scope?

2009-01-12 Thread Ovid
l6 -e 'my @a = ; @a .= pick(*); @a.perl.say' ["g", "a", "f", "c", "e", "d", "b"] Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message > From: Ovid > > This patch implements the .trim() method for strings. > > Now that I'm reading S29, I see there is no .trim() method there. I got that > because it was referenced in pugs in the cookbook (not in tests, though) and >

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
meters aren't there. I'm happy to finish the work according to whatever spec is agreed upon. I want this badly enough that it's important to me :) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
at you're going to trim, you'd couldn't just set variables to do it, though. You'd have to figure out which methods to call. Or all could be allowed and $string.trim(:leading<0>) could all $string.rtrim internally. Cheers, Ovid -- Buy the book - http://www.ore

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
does > > both). So maybe trim_start and trim_end if we wanted to take that lead... > > How about .trim(:start) and .trim(:end)? So if: 1. No params, trim all 2. :start or :end, only trim that bit (not a negated option :) 3. If both, goto 1 Sound good? Cheers, Ovid -- Buy the book

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
ing". > > That of course raises the question of how one *would* properly override > trim's concept of whitespace Change your locale to one with a different concept of whitespace (are there any?) Otherwise, would this be trying to stuff too much into one function? Cheers

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
empty list"); Results in: not ok 10 - trim on empty list # have: "" # want: [] Note that this output is from my locally hacked version of Test.pm which is kind enough to tell you what the failure is. I'll submit a patch for that later. Cheers, Ovid -- Buy the book

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
jobbie, so it's important to get it RIGHT or it will be LEFT out. (I kill me. I really do :) Beers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
left/right, leading/trailing, Catholic/Protestant implementation. I'll submit a patch for trim with the spectest data updated and work on the rest after the dust settles. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message > From: jesse > > On Mon, Jan 12, 2009 at 07:01:25AM -0800, Ovid wrote: > > > > > I could optionally make the following work: > > > > > > > > > > $string.trim(:leading<0>); > > > > > $st

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message > From: Larry Wall > On Mon, Jan 12, 2009 at 05:04:50AM -0800, Ovid wrote: > : ...the trivial $string.trim and trim($string) case. > > Hmm, I'd think .trim should work like .chomp, and return the trimmed > string without changing the original

Re: Extending classes in a lexical scope?

2009-01-12 Thread Ovid
ecified. Actually, I'd prefer to go much further than this: use Core 'MyCore'; And have that override core classes lexically. That solves the "but I want it MY way" issue that many Perl and Ruby programmers have, but they don't shoot anyone else in the foot.

Trimming arrays

2009-01-12 Thread Ovid
What should this output? my @array = ' foo ', ' bar '; @array .= trim; say @array.perl; And what if I have an array of hashes of hashes of arrays? Currently you can call 'trim' on arrays, but it's a no-op. Similar issues with chomp and fri

Re: Trimming arrays

2009-01-12 Thread Ovid
7;trim' on arrays, but it's a no-op. Similar issues > with chomp and friends. > > It should probably say "No such method". We have hyperops now to apply > scalar operators to composite values explicitly: > > @array».=trim Won't that fail with &#x

Re: Extending classes in a lexical scope?

2009-01-12 Thread Ovid
'Bar' is coupled to 'Foo' and needs to know 'Foo's implementation (a charming anti-inheritance argument). See #1 :) Or did you mean something completely different? Note that Liskov is great, but has issues at times when composition is unclea

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
for keys or it needs to not be allowed (and thus fail with AoHoA and similar complex data structures). > By the way, good work on this. Everyone loves useful string functions. Thanks. It's been lots of fun :) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/

Re: Extending classes in a lexical scope?

2009-01-14 Thread Ovid
wrote the wrong class name in writing that email. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: Trimming arrays

2009-01-14 Thread Ovid
, but what if the values are pairs? Then wouldn't you effectively be apply the hyperop recursively throughout the data structure? That might be expensive and have unwanted side-effects ("what do you mean my hash had a reference to your ORM data?"). Cheers, Ovid -- Buy the b

Test.pm and skip()

2009-01-21 Thread Ovid
stick with named parameters, but that's a bit odd since every other function exported uses positional parameters. Thoughts? Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - htt

Re: RFD: Built-in testing

2009-01-21 Thread Ovid
nt. Then we could have the following diagnostics: perl6 $ perl -MTest::Most=no_plan -e 'cmp_ok 3, "eq","3"' not ok 1 # have: 3 # test: eq # want: "3" 1..1 And then it's crystal clear why it failed. Cheers, Ovid

Re: RFD: Built-in testing

2009-01-22 Thread Ovid
tion in the test description is very important on iterative tests or to distingiush similar tests (sometimes it would be nice to go so far as to ban identical test descriptions). Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: RFD: Built-in testing

2009-01-22 Thread Ovid
d. If the &referrals method has :ok in it, this shouldn't impact the overall plan, right? Side note: for the desugar, I'd still prefer we go with 'have/want' instead of 'got/expected'. We've been wanting to do this with TAP for a while. It reads well and also aligns nicely for fixed-width fonts. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: RFD: Built-in testing

2009-01-22 Thread Ovid
ut these points. I've been thinking about this and have realized that it also solves an intractable problem with Perl 5 tests: identifying tests. By promoting 'test' to a first class concept (not just adjectives), you can "name" a test. Right now, I'm trying to w

Re: RFD: Built-in testing

2009-01-22 Thread Ovid
aving different messages for different conditions will confuse me :) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: RFD: Built-in testing

2009-01-24 Thread Ovid
("hey, we keep failing out credit card tests. We should look into this more carefully!"). Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

.trim and 'gilding the lilly'

2009-01-24 Thread Ovid
ween convenience functions and the bare minimum? Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: .trim and 'gilding the lilly'

2009-01-24 Thread Ovid
joke. Mostly) I'd still opt for removing .chop, though. I think only once have I ever seen it used appropriately. All other times the user wanted .chomp. Cheers, Ovid

Re: .trim and 'gilding the lilly'

2009-01-24 Thread Ovid
#x27;s nice to get a slightly better idea of what others are thinking. (And a bit thanks to chromatic for regularly posting those updates. It helps a lot) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://use.perl.org/~Ovid/journal

Recursive Runtime Role Reapplication Really Rebounds

2009-03-08 Thread Ovid
something which can be addressed in perl instead of Perl? Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-09 Thread Ovid
- Original Message > From: Ovid > Eventually, the code broke and threw a bunch of weird "recursive inheritance" > warnings due to multiple anonymous classes being applied to the object. This > was *real fun* to debug, but I can imagine a scenario for this be

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Ovid
from Moose instead of Perl 6 and didn't know about this :) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Roles driven by events

2009-03-16 Thread Ovid
that in Perl 6? Or am I just looking at this wrong? Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

rakudo.org rss

2009-06-11 Thread Ovid
The RSS feed for rakudo.org shows the last update as Feb 28, 2009. Wasn't certain from the site where I should send a contact email. Thus, rss complaint list spam! http://rakudo.org/rss.xml Cheers, Ovid PS: Thanks for all of the fantastic work, folks! -- Buy the book -

YAPC::EU and Perl 6 Roles

2009-07-07 Thread Ovid
s a note that one can "simply to write a class method that overrides the conflicting role methods, perhaps figuring out which role method to call", but I don't understand how a particular role's methods would be called here. Cheers, Ovid -- Buy the book - http://www.orei

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Ovid
ch cleaner that what I see here. You see, with Jonathan's, you only have to provide methods for what you're disambiguating, It seems like your code would require that I specifically list every method which is handled, which would clearly get unwieldy with large roles or many ro

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Ovid
- Original Message > From: Jonathan Worthington > Ovid wrote: > > It needs the timed fuse() from a Bomb role and a non-lethal explode() from > > a > Spouse role, though each role provides both methods. > I'm curious... > > 1) How often do you in

Re: RFC: overriding methods declared by roles (Was: Re: Reusing code: "Everything but the kitchen sink")

2009-07-13 Thread Ovid
e pain in debugging might have been a side effect of the fast transformation from a complex inheritance hierarchy to a roles-based system. Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Freezing role methods

2009-10-14 Thread Ovid
That is to say, the x() in question would become private and statically bound to the invocants to ensure that they're always calling the correct x(). How would Perl 6 approach this issue? Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- h

Trait researches on "class wins" in role composition

2009-10-14 Thread Ovid
finally realized that Java needed to do: they provide an @Override annotation for methods which override parent methods. The compiler should warn if an overridden method is not annotated as such (http://java.sun.com/javase/7/docs/api/java/lang/Override.html). See http://use.perl.org/~Ovid/journal

Re: Freezing role methods

2009-10-14 Thread Ovid
cribed in the paper allows the consumer, C, to statically bind the method foo() in the methods in the appropriate role which call it. Dynamic binding defers the decision which causes implementation details to leak to consumers of C. This means that if you change your roles, your consumers will

Re: Freezing role methods

2009-10-15 Thread Ovid
y binding the other x() to its role, thus guaranteeing that no role can get the wrong x(), but still allowing classes full control over their composition. I need to read the other responses more closely to understand their reasoning. So far, they seem wrong to me, but that's probably bec

Re: Freezing role methods

2009-10-15 Thread Ovid
uding being code smells). However, if roles start making their way on to the CPAN, you won't necessarily have control over the source code, forcing you to fork or simply not use the role in question. Regrettably, that defeats the purpose of roles -- namely, to facilitate code reuse. Cheers

Re: unusual invocants

2009-10-21 Thread Ovid
where: 1. A class consumes two (or more) roles 2. Each roles provides a method with an identical signature 3. The methods are not equivalent and neither role can rely on the other's method With that, you have roles which cannot be composed. You must rewrite one (bad if you don't own

Debugging Grammars

2009-12-27 Thread Ovid
P token causes the grammar to fail to match. In short, just about anything I touch seems to break the grammar :) Any suggestions welcome. Cheers, Ovid-- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Re: Debugging Grammars

2009-12-27 Thread Ovid
It's a parsing error in Rakudo at the moment -- it *should* be > telling you that it found a '??' but no '!!'. Again, the new > version (arriving in a week or so) should be better about such > messages. Aargh! That one bugs me. I can see how I made that mist

Re: Debugging Grammars

2009-12-29 Thread Ovid
As a follow-up to this, I have my code posted at http://blogs.perl.org/users/ovid/2009/12/configini-in-perl-6.html While my admittedly clumsy grammar matches, transforming it into an AST has failed miserably. Aside from the advent calendar or the online docs at http://perlcabal.org/syn/S05

Custom errors on subsets?

2010-01-04 Thread Ovid
output: Houston, we have a filename: /Users/ovid/bin/perl6 Houston, we have a filename: /Users/ovid/bin/perl6 Constraint type check failed for parameter '$name' in Main (file src/gen_setting.pm, line 324) Obviously the error message can use some work, but how would I

Re: Custom errors on subsets?

2010-01-04 Thread Ovid
:OnFail { "Celsius temperature should be a Num >= -273.15, not '$_' " } With something akin to that, developers won't have to write extra boilerplate every time a constraint fails. Plus, the code is friendlier :) Cheers, Ovid -- Buy the book - http://www.oreilly

Re: Custom errors on subsets?

2010-01-05 Thread Ovid
_ is not a filename" }; sub foo (Filename $name) { say "Houston, we have a filename: $name"; } foo($*EXECUTABLE_NAME); say "before"; foo('no_such_file'); say "after"; Output: Houston, we have a filename: /Users/ovid/

Re: Custom errors on subsets?

2010-01-05 Thread Ovid
ut I'm still not expecting the sub call to be skipped silently due to a constraint failure. Silent failures are bad :) Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://use.perl.org/~Ovid/journal/ Twitter - http://twitt

Constructors and mixins

2004-08-22 Thread Ovid
The delegation syntax looked promising, but it seemed to be a compile-time tool. Cheers, Ovid = Silence is Evil http://users.easystreet.com/ovid/philosophy/indexdecency.htm Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl ht

Re: Synopsis 9 draft 1

2004-09-21 Thread Ovid
required that .01% of the time why force someone to reach for another language, regardless of how easy the languages are to integrate? Cheers, Ovid = Silence is Evilhttp://users.easystreet.com/ovid/philosophy/indexdecency.htm Ovid http://www.perlmonks.org/

Re: Perl 6 Summary for 2004-12-20 through 2005-01-03

2005-01-04 Thread Ovid
--- Jon Ericson <[EMAIL PROTECTED]> wrote: > Austin Hastings <[EMAIL PROTECTED]> writes: > > > s/conses/consensus/g ? > > I assumed it was a Lisp reference. ;-) contheth? (No, I'm not really *quite* that clueless.) Cheers, Ovid = Silence is Evil

Logic Programming in Perl 6

2005-02-03 Thread Ovid
problems. First, it only operates on strings. Second, I can't do all make all three examples work from the one regular expression. Is there more here that I am not seeing (I confess to not having paid close attention.) And feel free to correct my syntax. Cheers, Ovid = If this messag

Re: Perl 6 Summary for 2005-01-31 through 2004-02-8

2005-02-09 Thread Ovid
--- Matt Fowles <[EMAIL PROTECTED]> wrote: >Logic Programming in Perl 6 > Ovid asked what logic programming in perl 6 would look like. No > answer > yet, but I suppose I can pick the low hanging fruit: as a > limiting case > you could always back out the e

Re: Logic Programming with Rules (and Argument Patterns)

2005-03-09 Thread Ovid
nerally not available in the tools that most people use. SQL, regexen and makefiles all dance around logic programming -- well, makefiles sort of stumble -- but if LP was more readily available, people would be more likely to appreciate it. Unfortunately, while Prolog is a piece of cake to learn

Re: Logic Programming with Rules

2005-03-09 Thread Ovid
rot can do for Perl yet. I've been thinking that this would be a fun project for me to cut my Parrot teeth on. Specifically, porting AI::Prolog. However, porting a proper WAM (Warren Abstract Machine) would be a better choice. Now to find the tuits :) Cheers, Ovid -- If this message is a

say and print (pugs)

2005-04-07 Thread Ovid
t would be nice. I guess we can wait for the phantom volunteer on that :) In any event, where the heck do I find the docs for "say" and "print"? Perl6::say doesn't default to $_, but I'm not sure if that implementation is correct, either. Cheers, Ovid -- If this

(pugs) Managing pleac

2005-04-09 Thread Ovid
aintenance, but we're also less likely to spot syntax errors since a lot of code won't even compile. And please, if you have commit access, feel free to correct my code and add more. I don't want to do this by my Cheers, Ovid -- If this message is a response to a question on a maili

(pugs) Managing pleac

2005-04-09 Thread Ovid
aintenance, but we're also less likely to spot syntax errors since a lot of code won't even compile. And please, if you have commit access, feel free to correct my code and add more. I don't want to do this by myself. http://svn.openfoundry.org/pugs/examples/pleac/ Cheers, Ovid --

Re: Question about $pair.kv

2005-04-09 Thread Ovid
$age"; } That tends to suggest the former interpretation is correct. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

Aliasing swapped values

2005-04-10 Thread Ovid
$d) := ($y, $x); # later ($x,$y) := ($c, $d); # whoops! That's going to confuse the heck out of people. If we do as Perl5 does, we'll merely be swapping values since aliasing really doesn't make much sense here, but that means for this case, ":=" == "=". Chee