[PATCH] [RFC] add a simple metamodel test

2007-07-29 Thread Sam Vilain
make a humble beginning on the tests for the Perl 6 metamodel, adding a README for the work. This chooses the top-level names Class and MetaClass for the names of the perl6 metamodel. API largely stolen from Class::MOP Signed-off-by: Sam Vilain [EMAIL PROTECTED] --- This was almost a direct

[PATCH] [library/Test::More] add isnt() to test inequality - str and float

2007-03-15 Thread Sam Vilain
Continue the previous factoring out of the comparison and test function, by adding _cmp_ok() for other types --- runtime/parrot/library/Test/More.pir | 233 +++--- t/library/test_more.t| 39 ++- 2 files changed, 222 insertions(+), 50 deletions(-)

[PATCH] [t/library/Test::More] move skip test to be first

2007-03-15 Thread Sam Vilain
The tested output from test_skip() depends on the number of tests that ran in the unrelated sections before it. Tidy this up. --- t/library/test_more.t | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/t/library/test_more.t b/t/library/test_more.t index

[PATCH] [library] Test::More: use hllmacros.pir in man page example

2007-03-15 Thread Sam Vilain
From: Sam Vilain [EMAIL PROTECTED] Use current best practice for importing symbols in the example. --- runtime/parrot/library/Test/More.pir | 26 -- 1 files changed, 12 insertions(+), 14 deletions(-) diff --git a/runtime/parrot/library/Test/More.pir b/runtime/parrot

[PATCH] [lib/Test::More] base comparison type on expected, not received PMC type

2007-03-15 Thread Sam Vilain
The type of the 'left' argument was being used for the selection of which comparison function to use. This does not agree with the typical usage of the second argument to is() to mean the expected value (as in English). --- runtime/parrot/library/Test/More.pir |8 1 files changed, 4

[PATCH] [library/Test::More] add isnt() to test inequality - ints only

2007-03-15 Thread Sam Vilain
refactor the is() :multi for integers into a _cmp_ok() function, and then use that to provide is() and isnt() --- runtime/parrot/library/Test/More.pir | 53 -- t/library/test_more.t| 16 +- 2 files changed, 59 insertions(+), 10

[PATCH] [lib] Test::More - add isa_ok()

2007-03-15 Thread Sam Vilain
--- runtime/parrot/library/Test/More.pir | 80 ++ t/library/test_more.t| 38 - 2 files changed, 117 insertions(+), 1 deletions(-) diff --git a/runtime/parrot/library/Test/More.pir b/runtime/parrot/library/Test/More.pir index

Re: [perl #41818] [PATCH */4]: [t/op] add tests for string memory layout

2007-03-14 Thread Sam Vilain
Jerry Gay via RT wrote: +.end + +#.constant STRINGINFO_STRSTART 2 +#.constant STRINGINFO_BUFLEN 3 +#.constant STRINGINFO_FLAGS4 +#.constant STRINGINFO_BUFUSED 5 +#.constant STRINGINFO_STRLEN 6 # Local Variables: # mode: pir -- 1.5.0.2.21.gdcde2 this patch looks

[PATCH 6/6] [lib] Test::More - add isa_ok()

2007-03-13 Thread Sam Vilain
Add the isa_ok() method --- runtime/parrot/library/Test/More.pir | 80 ++ t/library/test_more.t| 38 2 files changed, 117 insertions(+), 1 deletions(-) diff --git a/runtime/parrot/library/Test/More.pir

[PATCH 4/6] [library/Test::More] add isnt() to test inequality - ints only

2007-03-13 Thread Sam Vilain
refactor the is() :multi for integers into a _cmp_ok() function, and then use that to provide is() and isnt() --- runtime/parrot/library/Test/More.pir | 53 -- t/library/test_more.t| 16 +- 2 files changed, 59 insertions(+), 10

[PATCH 3/6] [lib/Test::More] base comparison type on expected, not received PMC type

2007-03-13 Thread Sam Vilain
The type of the 'left' argument was being used for the selection of which comparison function to use. This does not agree with the typical usage of the second argument to is() to mean the expected value (as in English). --- runtime/parrot/library/Test/More.pir |8 1 files changed,

[PATCH 5/6] [library/Test::More] add isnt() to test inequality - str and float

2007-03-13 Thread Sam Vilain
Continue the previous factoring out of the comparison and test function, by adding _cmp_ok() for other types --- runtime/parrot/library/Test/More.pir | 233 +++--- t/library/test_more.t| 39 ++- 2 files changed, 222 insertions(+), 50 deletions(-)

[PATCH 5/6] [library/Test::More] add isnt() to test inequality - str and float

2007-03-13 Thread Sam Vilain
Continue the previous factoring out of the comparison and test function, by adding _cmp_ok() for other types --- runtime/parrot/library/Test/More.pir | 233 +++--- t/library/test_more.t| 39 ++ 2 files changed, 222 insertions(+), 50 deletions(-)

[PATCH 3/6] [lib/Test::More] base comparison type on expected, not received PMC type

2007-03-13 Thread Sam Vilain
The type of the 'left' argument was being used for the selection of which comparison function to use. This does not agree with the typical usage of the second argument to is() to mean the expected value (as in English). --- runtime/parrot/library/Test/More.pir |8 1 files changed, 4

[PATCH 0/6] A round of Test/More updates

2007-03-13 Thread Sam Vilain
This patch series extends the Test/More.pir library in various ways. I'm sending it this way because it's trivial for me to do so, and potentially makes the patches easier for the list to review and comment on particular portions. Sam.

[PATCH 6/6] [lib] Test::More - add isa_ok()

2007-03-13 Thread Sam Vilain
--- runtime/parrot/library/Test/More.pir | 80 ++ t/library/test_more.t| 38 - 2 files changed, 117 insertions(+), 1 deletions(-) diff --git a/runtime/parrot/library/Test/More.pir b/runtime/parrot/library/Test/More.pir index

[PATCH 1/6] [library] Test::More: use hllmacros.pir in man page example

2007-03-13 Thread Sam Vilain
Use current best practice for importing symbols in the example. --- runtime/parrot/library/Test/More.pir | 26 -- 1 files changed, 12 insertions(+), 14 deletions(-) diff --git a/runtime/parrot/library/Test/More.pir b/runtime/parrot/library/Test/More.pir index

[PATCH 2/6] [t/library/Test::More] move skip test to be first

2007-03-13 Thread Sam Vilain
The tested output from test_skip() depends on the number of tests that ran in the unrelated sections before it. Tidy this up. --- t/library/test_more.t | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/t/library/test_more.t b/t/library/test_more.t index

[PATCH 1/6] [library] Test::More: use hllmacros.pir in man page example

2007-03-13 Thread Sam Vilain
Use current best practice for importing symbols in the example. --- runtime/parrot/library/Test/More.pir | 26 -- 1 files changed, 12 insertions(+), 14 deletions(-) diff --git a/runtime/parrot/library/Test/More.pir b/runtime/parrot/library/Test/More.pir index

[PATCH 2/6] [t/library/Test::More] move skip test to be first

2007-03-13 Thread Sam Vilain
The tested output from test_skip() depends on the number of tests that ran in the unrelated sections before it. Tidy this up. --- t/library/test_more.t | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/t/library/test_more.t b/t/library/test_more.t index

[PATCH 4/6] [library/Test::More] add isnt() to test inequality - ints only

2007-03-13 Thread Sam Vilain
refactor the is() :multi for integers into a _cmp_ok() function, and then use that to provide is() and isnt() --- runtime/parrot/library/Test/More.pir | 53 -- t/library/test_more.t| 16 ++ 2 files changed, 59 insertions(+), 10

[PATCH 0/6] A round of updates to Test::More

2007-03-13 Thread Sam Vilain
This patch series extends the Test/More.pir library in various ways. I'm sending it this way because it's trivial for me to do so, and potentially makes the patches easier for the list to review. Sam.

Re: [PATCH 1/6] [library] Test::More: use hllmacros.pir in man page example

2007-03-13 Thread Sam Vilain
Will Coleda wrote: FYI, all six patches were just opened as tickets. 01:33 @Coke do me a favor. Forward each of them to RT and open a ticket. HA! I followed this instruction, moments before you forwarded them. Where moments is a time period defined by the perl.org mailserver. So, 41809 is

Patches for review

2007-03-12 Thread Sam Vilain
I've submitted a set of changes to the ML for review. Do you really want tickets for all of those changes? Some of them are quite minor. Sam.

Re: Patches for review

2007-03-12 Thread Sam Vilain
arrive :) Obviously something on mx.develooper.com thought the e-mails weren't generated by a human or something. hmm. Does anyone know if there's a public trashed bin or something for the perl.org lists? Sam. Regards. On Mar 12, 2007, at 10:30 PM, Sam Vilain wrote: I've submitted

Re: [svn:parrot-pdd] r17312 - trunk/docs/pdds/draft

2007-03-04 Thread Sam Vilain
[EMAIL PROTECTED] wrote: (When you extend an existing class, it actually creates +a new class, that replaces the old class in the Namespace, but the old +class can't be thrown away if it has objects instantiated in it. The old +objects still point to the old class and do their method

Re: [PATCH]: tools for using Subversion branches; ops2c.pl refactored

2007-03-04 Thread Sam Vilain
James Keenan wrote: The patch attached is really two patches in one: 1. A resubmission in patch form of my refactoring of tools/build/ ops2c.pl into lib/Parrot/Ops2c/Utils.pm and lib/Parrot/Ops2c/ Auxiliary.pm, along with a test suite in t/tools/ops2cutils/. 2. 4 new files which provide

Re: class interface of roles

2006-10-01 Thread Sam Vilain
TSa wrote: HaloO, is this subject not of interest? I just wanted to start a discussion about the class composition process and how a role designer can require the class to provide an equal method and then augment it to achieve the correct behavior. Contrast that with the need to do the same

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Sam Vilain
Darren Duncan wrote: Unless I'm mistaken, you may be going about this the wrong way. Within a system that already has an underlying set-like type, the Junction in this case, a test for uniqueness is (pardon any spelling): all(@items).elements.size === @items.size The all() will strip

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Sam Vilain
Miroslav Silovic wrote: TSa wrote: role Set[::T = Item] does Collection[T] where { all(.members) =:= one(.members); }; Nice usage of junctions! But buggy - one means *exactly* one. So for an array of more than 1 element, all(@array) never equals one(@array) -

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Sam Vilain
TSa wrote: HaloO, Sam Vilain wrote: perl -MPerl6::Junction=one,all -le '@foo=qw(1 2 3 4); print yes if (all(@foo) eq one(@foo))' yes But does it fail for duplicates? I guess not because junctions eliminate duplicates and you end up testing unique values as above. E.g. all(1,1,2

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Sam Vilain
Darren Duncan wrote: Perhaps, but then Junctions might not assume elements have equality or identity operations defined. As I recall, every type in Perl 6 has an equality and identity operation defined because the Object superclass provides one. If nothing else, the type's equality

Nitpick my Perl6 - parametric roles

2006-09-25 Thread Sam Vilain
Anyone care to pick holes in this little expression of some Perl 6 core types as collections? I mean, other than missing methods ;) role Collection[\$types] { has Seq[$types] @.members; } role Set[::T = Item] does Collection[T] where { all(.members) =:= one(.members); };

Re: Nitpick my Perl6 - parametric roles

2006-09-25 Thread Sam Vilain
TSa wrote: role Collection[\$types] { has Seq[$types] @.members; } This is a little wrapper that ensures that collections have got a @.members sequence of arbitrary type. This immediately raises the question how Seq is defined. [...and later...] Are you sure that the underlying

Re: Mutability vs Laziness

2006-09-25 Thread Sam Vilain
Aaron Sherman wrote: Carried over form IRC to placeholder the conversation as I saw it: We define the following in S06 as immutable types: ListLazy Perl list (composed of Seq and Range parts) Seq Completely evaluated (hence immutable) sequence Range

Re: Udates to Perl 6 and Parrot Essentials

2006-09-21 Thread Sam Vilain
Agent Zhang wrote: On 9/19/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Have there been any significant changes since the 2nd. edition of Perl 6 and Parrot Essentials? If so, where should I look for a summary? Yes, there have. That book is completely out of date. Please check

Re: Capture sigil

2006-09-21 Thread Sam Vilain
Larry Wall wrote: Okay, I think this is worth bringing up to the top level. Fact: Captures seem to be turning into a first-class data structure that can represent: argument lists match results XML nodes anything that requires all of $, @, and % bits. Also; role

Re: META vs meta

2006-09-12 Thread Sam Vilain
Larry Wall wrote: : There is currently a mismatch between S12 and Pugs. The former specifies $obj.META, the latter has implemented $obj.meta. .META is more correct at the moment. Does making it all upper caps really help? It's still a pollution of the method space, any way that you look

Re: binding operators and related introspection

2006-07-17 Thread Sam Vilain
Darren Duncan wrote: But I would also like to have an easy way to change all bindings to the same variable at once to point to the same new variable. [...] my $x = 'foo'; my $y = 'bar'; my $z := $x;# $x and $z point to same 'foo', $y to a 'bar' $z.rebind_all_aliases_to( $y

Re: features of and declaring Mapping|Set|Hash values|variables

2006-06-29 Thread Sam Vilain
Darren Duncan wrote: 1. Looking at the language in Synopsis 6 for data types, I see: Set Unordered Seqs that allow no duplicates JunctionSets with additional behaviours PairSeq of two elements that serves as an one-element Mapping Mapping Pairs

Re: lvalue functions and lvalue parameters

2006-06-20 Thread Sam Vilain
Jonathan Scott Duff wrote: sub cond(Bool $c, $a, $b) is rw { if $c return $a else return $b; } Will this fail because $a and $b are not rw? If so, will it fail at run- or compile-time? What about this: That looks like it should be a compile-time failure to me. Depends on the

Re: easier duck typing in .can

2006-06-18 Thread Sam Vilain
Yuval Kogman wrote: Since CANDO is a multimethod, IMHO this can be safely extended to allow: $object.can(Class); $object.can(Role); to better support duck typing. Why would you not use .does or .isa there? Are you wanting this to go through all of the Class/Role's

Re: Perl5 - Perl 6 Translations Design Document

2006-06-05 Thread Sam Vilain
Sage La Torra wrote: Hello all, I'm the student picking up on the translation work lwall started. Since the perl 5 parser is more or less complete, I've headed straight to the translation work. I'm going to be taking on the translations a few at a time, starting with the easiest translations and

Re: Concurrency: hypothetical variables and atomic blocks

2006-05-31 Thread Sam Vilain
Jonathan Lang wrote: How does an atomic block differ from one in which all variables are implicitly hypotheticalized? I'm thinking that a retry exit statement may be redundant; instead, why not just go with the existing mechanisms for successful vs. failed block termination, with the minor

Re: Concurrency: hypothetical variables and atomic blocks

2006-05-31 Thread Sam Vilain
Daniel Hulme wrote: How does an atomic block differ from one in which all variables are implicitly hypotheticalized? I assume that the atomicness being controlled by some kind of lock on entry, it also applies to I/O and other side-effecty things that you can't undo. The lock on entry

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

2006-05-25 Thread Sam Vilain
[EMAIL PROTECTED] wrote: +In either case this sets the Cof property of the container to CDog. +Subroutines have a variant of the Cof property, Creturns, that +sets the Creturns property instead. The Creturns property specifies +a constraint to be checked upon calling Creturn that, unlike the Cof

Re: packages vs. classes

2006-05-22 Thread Sam Vilain
Larry Wall wrote: 'Course, I left out everything about prototype objects there... The name Foo also (in context) represents an uninitialized object of the class in question. Any object, initialized or not, can get at its type handlers by saying Foo.meta $foo.meta and, in fact, the

Re: hyp-op examples of a Bag type in S03

2006-05-22 Thread Sam Vilain
Darren Duncan wrote: $bag1 - 1; # Bag(2,7,[1,Seq(8,2)],7) $bag2 - (1,1,1,1); # probably the same $bag3 - (1,1,2,1); # ? Bag's won't .does(Array) or .does(Coll[Seq,...]), so that hyperoperator won't work - if anything it would try to add the (1,1,1,1) list to all of the

Re: ACID transactions for in-memory data structures

2006-05-17 Thread Sam Vilain
Rob Kinyon wrote: On 5/15/06, Audrey Tang [EMAIL PROTECTED] wrote: Rob Kinyon wrote: I'm pretty sure it wouldn't be very feasible to do this natively in P5. But, would it be possible to do it natively in P6? As in, supported within the interpreter vs. through some sort of overloading.

Re: using the newer collection types

2006-05-07 Thread Sam Vilain
Darren Duncan wrote: Also, I don't agree with the notion of a header of each relation. It has a type for each tuple item, sure, but header just sounds like the sort of thing you want in a ResultSet, not a Relation. Sam. A relation's heading is essentially the definition of the relation's

Re: using the newer collection types

2006-05-05 Thread Sam Vilain
Darren Duncan wrote: Is there a reference for the meaning of these methods? There are many written references to these methods; just type relational algebra into Google. I will add that the first hit on such a search, the Wikipedia page on relational algebra (

Re: using the newer collection types

2006-05-04 Thread Sam Vilain
Darren Duncan wrote: Speaking a little more technically, a Relation has 2 main components, its heading and its body. The heading is a set of 0..N keys (called attributes in relation-land), and the body is a set of 0..N Mappings (called tuples in relation-land), where they set of keys of each

Re: Another dotty idea

2006-04-10 Thread Sam Vilain
Damian Conway wrote: I'm not enamoured of the .# I must confess. Nor of the #. either. I wonder whether we need the dot at all. Or, indeed, the full power of arbitrary delimiters after the octothorpe. Agreed. What if we restricted the delimiters to the five types of balanced brackets?

Re: Another dotty idea

2006-04-10 Thread Sam Vilain
Larry Wall wrote: On Tue, Apr 11, 2006 at 12:26:13PM +1200, Sam Vilain wrote: : This does mean that if you comment out blocks with s/^/#/, you mess up on: : : #sub foo : #{ : # if foo { } : #} Well, actually, that still works. Oh, true :-) But this fragment dies: #sub foo #{ # bar

Re: Another dotty idea

2006-04-10 Thread Sam Vilain
Larry Wall wrote: : But this fragment dies: : : #sub foo : #{ : # bar { } unless baz : #} I don't see how that's different at all from the first example. “#sub foo” is parsed as a comment token “#{ # bar { }” is the next comment token then we get “unless baz” Unless you are balancing

Re: Obsoleting require 'Some/Module.pm'

2005-12-19 Thread Sam Vilain
On Mon, 2005-12-19 at 14:58 +0200, Gaal Yahas wrote: Can we make this work? my $mod = Some::Module; require $mod; What about casting it to a package; require ::{$mod}; (not sure if the syntax is quite right) Sam.

Re: handling undef - second draft

2005-12-18 Thread Sam Vilain
On Sat, 2005-12-17 at 17:27 -0800, Darren Duncan wrote: 3. A flag that says we know that some operation failed, such as would be exploited in the failing-expr err deal-with-it-or-die situations. This concept is like an exception which isn't thrown but returned. Dropping an exception,

Re: Some thoughts on threading

2005-12-11 Thread Sam Vilain
On Thu, 2005-12-08 at 17:16 +0100, Ron Blaschke wrote: The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software. [1] He starts with The biggest sea change in software development since the OO revolution is knocking at the door, and its name is Concurrency. Perhaps have a read

Re: scalar/array contexts in perl5 vs. perl6

2005-12-04 Thread Sam Vilain
On Sun, 2005-12-04 at 13:10 -0500, Mike Li wrote: what is a good translation of the following C into perl6? code [...] int x = 0; int y[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; y[x++]++; /* line that matters */ [...] /code in perl5, i would've written something like: code my $x = 0; my @y =

Re: $_ defaulting for mutating ops

2005-11-02 Thread Sam Vilain
On Wed, 2005-11-02 at 11:46 -0700, John Williams wrote: It is not so much an operator, as it is a subroutine with really strange syntax, and the side-effect of changing the $_ variable. You need to use an operator to get it to affect a different variable. operators _are_ subroutines. There

Re: $_ defaulting for mutating ops

2005-11-02 Thread Sam Vilain
On Wed, 2005-11-02 at 09:03 -0500, Rob Kinyon wrote: I think the difference comes from the Principle of Least Surprise. The various operators being discussed in this thread are all operators which are in languages that have common use - C, C++, Java, the .Net stack, etc. Regexen and the

Re: Why submethods

2005-10-30 Thread Sam Vilain
On Sat, 2005-10-29 at 17:30 -0400, Stevan Little wrote: However, it could also be that the creator of Foo did not intend for subclasses to be able to Just Work, and that the whole idea of Foo is to do a Template Method style pattern in which subclasses must implement the

Complex types

2005-10-12 Thread Sam Vilain
Hi all, Is it intentional that S09 lists unboxed complex types, but equivalent Boxed types are missing from the Types section in S06? Sam.

Re: Time::Local

2005-08-17 Thread Sam Vilain
On Wed, 2005-08-17 at 01:28 -0500, Dave Rolsky wrote: Why on earth would you want to encourage such a short sighted programming practise? The earth wobbles like a spinning top. In fact It's hardly short sighted to want leap seconds to be abandoned (not in Perl but world wide). The few

Re: Time::Local

2005-08-16 Thread Sam Vilain
On Mon, 2005-08-15 at 22:24 -0700, Larry Wall wrote: : That's my leaning--if I thought it might encourage the abandonment of : civil leap seconds, I'd be glad to nail it to Jan 1, 2000, 00:00:00.0 UTC. : If we're going with TAI, can't we just nail it to the epoch it defines, : instead?

Re: Time::Local

2005-08-15 Thread Sam Vilain
On Mon, 2005-08-15 at 16:33 -0700, Larry Wall wrote: : I would assume that you would choose time 0.0 = Jan 1, 2000 at 00:00:00.0 : TAI (December 31, 1999 at 23:59:29.0 UTC), making the whole thing free of : any UTC interferences. But there is an argument for making the zero point a :

RE: $object.meta.isa(?) redux

2005-08-10 Thread Sam Vilain
On Wed, 2005-08-10 at 21:00 -0400, Joe Gottman wrote: Will there be an operator for symmetric difference? I nominate (^). That makes sense, although bear in mind that the existing Set module for Perl 6, and the Set::Scalar and Set::Object modules for Perl 5 use % for this (largely due to

Re: Definition of containers.

2005-07-30 Thread Sam Vilain
Autrijus Tang wrote: Containers come in two flavours: Non-tieable and Tieable. Both are typed, mutable references. There is no way in runtime to change the flavour. data Container s a = NCon (STRef s (NBox a)) | TCon (STRef s (TBox a)) A Non-tieable container is comprised

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

2005-07-24 Thread Sam Vilain
Stevan Little wrote: Yes, we have. One thing to consider is that it is much easier to get the Role order doesn't matter thing when they are composed. Once you start keeping the roles around, you run into the possiblity for such things as next METHOD being executed in Role context. I wont even

Re: Database Transactions and STM [was: Re: STM semantics, the Transactional role]

2005-07-24 Thread Sam Vilain
Yuval Kogman wrote: everyone gets to choose, and another thing I have in mind is the Transactional role... DBI::Handle does Transactional; To the STM rollbacker and type checker thingy this means that any IO performed by DBI::Handle invoked code is OK - it can be reversed using the

Re: Subroutine and Method Introspection

2005-07-24 Thread Sam Vilain
chromatic wrote: A12 and S12 describe introspection on objects and classes. The metaclass instance has the method getmethods() which returns method descriptors. The design specifies several traits queryable through these descriptors. [...] Currently, there's no way to query these traits

Re: Exposing the Garbage Collector

2005-07-24 Thread Sam Vilain
Piers Cawley wrote: Let's say I have a class, call it Foo which has a bunch of attributes, and I've created a few of them. Then, at runtime I do: eval 'class Foo { has $.a_new_attribute is :default10 }'; Assuming I've got the syntax right for defaulting an attribute, and lets assume I have,

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

2005-07-24 Thread Sam Vilain
Stevan Little wrote: This is extended into the other sigil types; has %.foo; is sugar for this: has Hash $foo; # or has %foo, but really, the point is it's # an implementation detail, right? method foo is rw { return Proxy.new( :FETCH{ $foo }, # or a facade

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

2005-07-21 Thread Sam Vilain
Larry Wall wrote: : Do the following exist then: :has @x; # private, lexically scoped [...] :has %y; # private, lexically scoped [...] Yes, the sigil is fairly orthogonal to all this, hopefully. Yes, for isn't the sigil just a compact form of saying does Hash or does Array ? (as

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

2005-07-20 Thread Sam Vilain
Piers Cawley wrote: Users of the class includes people subclassing the class, so to them they need to be able to use $.month_0 and $.month, even though there is no has $.month_0 declared in the Class implementation, only has $.month. We thought about defining the attribute variables

Database Transactions and STM [was: Re: STM semantics, the Transactional role]

2005-07-17 Thread Sam Vilain
Yuval Kogman wrote: everyone gets to choose, and another thing I have in mind is the Transactional role... DBI::Handle does Transactional; To the STM rollbacker and type checker thingy this means that any IO performed by DBI::Handle invoked code is OK - it can be reversed using the

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

2005-07-17 Thread Sam Vilain
Say I make an accessor method for an attribute that doesn't really 'exist'. For instance, a good example of this is the month_0 vs month properties on a date object; I want to make both look equivalent as real properties, but without the users of the class knowing which one is the real one.

Re: DBI v2 - The Plan and How You Can Help

2005-07-13 Thread Sam Vilain
Dean Arnold wrote: Column 3 is a BYTEA column in Pg and needs special peppering to work. What sort of peppering ? DBI provides SQL_BLOB, and SQL_CLOB type descriptors (as well as SQL_BLOB_LOCATOR and SQL_CLOB_LOCATOR), so presumably DBD::Pg (or any other DBD supporting LOBs) provides the logic

Re: MML dispatch

2005-07-13 Thread Sam Vilain
Larry Wall wrote: In addition to what chromatic said, I'd like to point out that you've got the abstraction levels backwards by my lights: these days I tend to think of the class as a restricted form of role. A class is restricted to having to provide a working interface to real objects. Can

Re: DBI v2 - The Plan and How You Can Help

2005-07-12 Thread Sam Vilain
Dean Arnold wrote: RE: LOBs and SQL Parse Trees: having recently implemented LOB support for a JDBC driver (and soon for a DBD), I can assure you that SQL parse trees are unneeded to support them. For databases Great! Perhaps you can shed some light on how to do it for this, then. SQL

Re: Raw bytes in perl6

2005-07-12 Thread Sam Vilain
Yuval Kogman wrote: By the way, a nice use case for using the rules engine could be parsing a stream of SAX events into a structure... XML::Simple in perl6 could be really as simple as it sounds =) Can anyone see this being retrofitted on top of current rules semantics? How does PGE relate to

Re: DBI v2 - The Plan and How You Can Help

2005-07-11 Thread Sam Vilain
Darren Duncan wrote: I should emphasize that I never expected to be able to send any type of ASTs over the pipe to the database. They would still be interpreted by the database driver for Perl and/or a wrapper thereon, into the database native format. Its just that, to an application, it

Re: [Fixed] Re: field `_crypt_struct' has incomplete type

2005-07-07 Thread Sam Vilain
Salvador Ortiz Garcia wrote: In the ghc docs I found that -Dsymbol=value does not affect -D macros passed to the C compiler when compiling via C, the mode used when optimization is on. So the perl5 ccflags defined must be passed using -optc. [...] -$ccdlflags .= qq[ -optl $_ ] +

Re: field `_crypt_struct' has incomplete type

2005-07-06 Thread Sam Vilain
Brent 'Dax' Royal-Gordon wrote: Sam Vilain [EMAIL PROTECTED] wrote: Has anyone got any more information to add to this problem? I'm particularly interested to know which platforms it affects. It seems to affect Debian and derivatives (including my distribution, Ubuntu). I'm seeing

Re: DBI v2 - The Plan and How You Can Help

2005-07-06 Thread Sam Vilain
Maxim Sloyko wrote: But this is not the point. The point was that usage of some file with passwords by *DEFAULT* is not the way to go, IMHO. It raises more problems than it solves. Can you give an example of such a problem that wasn't already there? Just to be clear, the file would only

Re: Dependency Injection

2005-07-06 Thread Sam Vilain
Piers Cawley wrote: Then the harness that actually sets up the application would simply do use Logger::DBI :dsn..., :user..., :password and Logger::DBI would install itself as the default Logger class. The question is, how does one write Injected to make this work? Or what features do we

Re: DBI v2 - The Plan and How You Can Help

2005-07-05 Thread Sam Vilain
Darren Duncan wrote: Okay, considering that using the same name prepare() like this may confuse some people, here is a refined solution that uses 3 methods instead; please disregard any contrary statements that I previously made: I think I'm beginning to like it. Allow me to suggest one or

Re: Time::Local

2005-07-05 Thread Sam Vilain
Darren Duncan wrote: Actually, there was a big oversight in my last message. It does not handle approximate or relative dates, such as when you don't know the details. FWIW, this is handled by DateTime::Incomplete, and also will be natively supported by Date::Gregorian. You're describing

Re: Time::Local

2005-07-05 Thread Sam Vilain
Craig DeForest wrote: Using the TAI epoch of 1958-01-01 00:00:00 has several advantages: - TAI is recognized by international standards-setting bodies (BIPM). - Perl6 will then shake out the 31-bit time rollover a full 12 years before I like this in principle, however I wonder of the

field `_crypt_struct' has incomplete type

2005-07-05 Thread Sam Vilain
Hi all, Many of you are familiar with the error during `make' of recent pugs: In file included from /usr/lib/perl/5.8/CORE/op.h:496, from /usr/lib/perl/5.8/CORE/perl.h:2600, from src/perl5/perl5.h:3, from /tmp/ghc23619.hc:6:

Re: DBI v2 - The Plan and How You Can Help

2005-07-04 Thread Sam Vilain
Richard Nuttall wrote: - support for automatically pulling database DSN information from a ~/.dbi (or similar) file. This is constantly re-invented poorly. Let's just do a connect by logical application name and let the SysAdmins sort out which DB that connects to, in a standard

Re: DBI v2 - The Plan and How You Can Help

2005-07-04 Thread Sam Vilain
Darren Duncan wrote: 3. Redefine prepare() and execute() such that the first is expressly for activities that can be done apart from a database (and hence can also be done for a connection handle that is closed at the time) while all activities that require database interaction are deferred to

Re: DBI v2 - The Plan and How You Can Help

2005-07-03 Thread Sam Vilain
Hey Tim. I've kept an eye on Perl 6 and Parrot developments but I'm no expert in either. What I'd like *you* to do is make proposals (ideally fairly detailed proposals, but vague ideas are okay) for what a Perl 6 DBI API should look like. Keep in mind that the role of the DBI is to provide

Re: SMD is for weenies

2005-06-30 Thread Sam Vilain
Yuval Kogman wrote: As I understand it SMD is now not much more than a mechanism to place a constraint on the MMD, saying that there can only be one method or subroutine with the same short name. Why is this the default? Otherwise you lose this quite useful warning if the signatures didn't

Magic mutators and my $var is Proxy( ... );

2005-06-26 Thread Sam Vilain
To me it is a trivial case that you want to provide a fake attribute which for all intents and purposes behaves exactly like there was a real attribute there, backing against another attribute. A Date object is a classic example of this; you want to provide 0-based and 1-based attributes, which

Re: takers wanted - a perl job

2005-06-26 Thread Sam Vilain
Joshua Juran wrote: scalar number (possibly complex) real rational integer Integer BigInt Ratio Float Complex Quaternion String ... Trying to fit every problem

Re: Magic mutators and my $var is Proxy( ... );

2005-06-26 Thread Sam Vilain
Sam Vilain wrote: To me it is a trivial case that you want to provide a fake attribute which for all intents and purposes behaves exactly like there was a real attribute there, backing against another attribute. A Date object is a classic example of this; you want to provide 0-based and 1-based

Re: AUTLOAD and $_

2005-06-26 Thread Sam Vilain
Piers Cawley wrote: For myself, I'd like to see AUTOLOAD with a signature along the lines of: sub AUTOLOAD (Symbol $sym, ArgumentCollection $args, Continuation $cc) returns (Code | Pair) { ... } This presupposes a deal of support infrastructure, but also provides flexibility.

Re: AUTLOAD and $_

2005-06-20 Thread Sam Vilain
Juerd wrote: I think there exists an even simpler way to avoid any mess involved. Instead of letting AUTOLOAD receive and pass on arguments, and instead of letting AUTOLOAD call the loaded sub, why not have AUTOLOAD do its thing, and then have *perl* call the sub? sub AUTOLOAD ($w) { return

Re: AUTLOAD and $_

2005-06-20 Thread Sam Vilain
chromatic wrote: Who says AUTOLOAD will always either call a loaded sub or fail? Maybe it should be passed a continuation too, then? Then it could choose exactly what to do with it. Sam.

  1   2   >