Re: the handiness of undef becoming NaN (when you want that)

2001-10-22 Thread Sam Vilain
On Mon, 22 Oct 2001 12:18:16 -0400 Aaron Sherman [EMAIL PROTECTED] wrote: $z[0] = 50; $z[2] = 20; @x = @y[@z]; In your code, should @x contain (@y[50,0,20]) or (@y[50,20]) or (@y[50,undef,20]) ? @y[50,undef,20], which in Perl5 is @y[50,0,20]. An arbitrary and perhaps

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Sam Vilain
On Mon, 29 Oct 2001 11:03:33 +1100 (EST) Damian Conway [EMAIL PROTECTED] wrote: The Real Damian is the Damian inside each of us. You need to get in touch with your *own* inner Damian. SETTING: Trendy bar. DC: Hey, beautiful, how's it going? Say, do you have a little Damian in you?

Re: NaN semantics

2001-10-10 Thread Sam Vilain
On Wed, 10 Oct 2001 11:32:02 -0400 Dan Sugalski [EMAIL PROTECTED] wrote: Great idea, as well as sqrt(-1) returning 1i istead of raising the exception. If we do them, yep. Currently no promises there. If you do that, make sure it has to be enabled with a pragma. Having complex numbers

RFC: new logical operator

2002-02-21 Thread Sam Vilain
I think Perl 6 should have a but keyword, as in: if (defined $foo but $foo eq ) { } :-)

Re: RFC: new logical operator

2002-02-21 Thread Sam Vilain
On Thu, 21 Feb 2002 06:50:13 -0600 [EMAIL PROTECTED] wrote: On Thu, Feb 21, 2002 at 12:30:11PM +, Sam Vilain wrote: I think Perl 6 should have a but keyword, as in: if (defined $foo but $foo eq ) { *scratches head* so... it negates the left side, then ANDs it with the right

Re: RFC: new logical operator

2002-02-21 Thread Sam Vilain
[EMAIL PROTECTED] (Randal L. Schwartz) wrote: Sam No, but is syntactically equivalent to and in English. It just Sam implies that the second condition is not generally what you'd Sam expect if the first was true. Maybe in the interest of huffman encoding, we could make it even_though. :)

Re: RFC: new logical operator more syntactic maple syrup

2002-02-21 Thread Sam Vilain
Aaron Sherman [EMAIL PROTECTED] wrote: An off-the-wall thought... If this is not the expected condition, should it have the extra meaning of an assertion? For example, could set $! to 'defined $foo but $foo eq ' and, if -w was in use, issue 'warn Exceptional condition: $!' Interesting idea;

Re: [PRE-RELEASE] Release of 0.0.7 tomorrow evening

2002-07-22 Thread Sam Vilain
people are happy that 5.005 is obsolete. -- Sam Vilain, [EMAIL PROTECTED] WWW: http://sam.vilain.net/ 7D74 2A09 B2D3 C30F F78E GPG: http://sam.vilain.net/sam.asc 278A A425 30A9 05B5 2F13 I regret to say that we of the FBI are powerless to act in cases of oral-genital intimacy

Re: Civility, please. (was Re: L2R/R2L syntax)

2003-01-18 Thread Sam Vilain
, and we're still a long way from that. In the very young field of programming, aren't we all ignorant amateurs? Any programmer who doesn't know that they are ignorant are almost certainly instead arrogant. -- Sam Vilain, [EMAIL PROTECTED] You're either part of the solution, or part of the precipitate

An ignorant opinion from an amateur [was: Re: Civility, please]

2003-01-19 Thread Sam Vilain
, Attributes, Methods and Associations. How many of these elements does Perl deal in? And don't take offence at being called an amateur - the word literally means `for the love of it'. -- Sam Vilain, [EMAIL PROTECTED] Thesaurus: ancient reptile with an excellent vocabulary

Re: Spare brackets :-)

2003-01-29 Thread Sam Vilain
On Wed, 29 Jan 2003 18:04, Michael G Schwern wrote: On Tue, Jan 28, 2003 at 12:11:18PM +1300, [EMAIL PROTECTED] wrote: This may sound like a silly idea but ... Has anyone considered removing with the syntactic distinction between numeric and string indexing -- that is, between array and

Re: summarizing the obvious (was: arrays, hashes unified ...)

2003-02-02 Thread Sam Vilain
BAD: code that you have to rewrite if you change a key type -- Sam Vilain, [EMAIL PROTECTED] A closed mouth says nothing wrong; a closed mind does nothing right. - anon.

Object spec

2003-03-04 Thread Sam Vilain
the concepts into the language :-). my 2c. -- Sam Vilain, [EMAIL PROTECTED] I like a man who grins when he fights. - Winston Churchill -

Re: Object spec

2003-03-05 Thread Sam Vilain
different, non-interchangable approaches to associating classes. -- Sam Vilain, [EMAIL PROTECTED] If you think the United States has stood still, who built the largest shopping center in the world? RICHARD M NIXON

Multiple Inheritance eq Interfaces [was: Re: Object spec]

2003-03-05 Thread Sam Vilain
, then this enables this test. In Perl 5, the approach taken with MI namespace clashes is to cross one's fingers ;). -- Sam Vilain, [EMAIL PROTECTED] Understanding is a kind of ecstasy. -- Carl Sagan

Associations between classes [was: Re: Object spec]

2003-03-05 Thread Sam Vilain
{ $car-owner-includes($joe) }; ok($@, Refs cannot behave like real Sets); To make the last test work would need associations in the object core, I think. -- Sam Vilain, [EMAIL PROTECTED] Whatever you do will be insignificant, but it is very important that you do it. -- Mahatma Gandhi

Re: Object spec

2003-03-05 Thread Sam Vilain
approaches exist? UML does not deal with persistence. It deals with specifying and modelling objects. I think that right now persistence fairly and squarely belongs outside of Parrot :-). -- Sam Vilain, [EMAIL PROTECTED] I dont have any solution, but I certainly admire the problem

Re: Associations between classes [was: Re: Object spec]

2003-03-05 Thread Sam Vilain
with this? The paper appears to me to describe using serialisation of memory structures to achieve persistence, which is another approach entirely. Serialisation is good, but fails for more complicated memory structures. -- Sam Vilain, [EMAIL PROTECTED] The meek shall inherit the earth

Re: Multiple Inheritance eq Interfaces [was: Re: Object spec]

2003-03-05 Thread Sam Vilain
a `method not defined' error. It just goes to show that MI is an ugly hack compared to using a servant class. But that is not the point here; the point here is making good MI semantics. Sorry, know I said I'd shut up :-) But this is still too interesting ;-) -- Sam Vilain, [EMAIL PROTECTED

Re: Object spec

2003-03-05 Thread Sam Vilain
, indicating that Directory objects are composed of files. Associations *are* fundamental object things. Presenting them in terms of attributes is the real hack. -- Sam Vilain, [EMAIL PROTECTED] It is necessary for me to establish a winner image. Therefore, I have to beat somebody. RICHARD M

Re: Object spec [x-adr][x-bayes]

2003-03-06 Thread Sam Vilain
. Speak now or hold your peace for another generation of Perl. ] -- Sam Vilain, [EMAIL PROTECTED] Two Commandments for the Molecular Age 1. Thou shalt not alter the consciousness of thy fellow men. 2. Thou shalt not prevent thy fellow man from altering his or her own consciousness. - Dr

Re: Object spec [x-adr][x-bayes]

2003-03-07 Thread Sam Vilain
On Sat, 08 Mar 2003 06:58, Dan Sugalski wrote: At 2:08 PM +1300 3/7/03, Sam Vilain wrote: As long as mechanisms are put in place to allow modules to bypass object encapsulation and private/public constraints, and given that Parrot will have no XS, It wouldn't be wise to jump from Parrot

Re: Junctions - feedback and desires

2005-03-10 Thread Sam Vilain
Rod Adams wrote: I do not believe that is possible. This is the filtering or unification behavior that people keep wanting junctions to have, which they do not. Aww! But what about all the great problems that could be expressed with them? I know of two languages that consider this to be a core

SEND + MORE = MONEY (works now in pugs with junctions!)

2005-03-10 Thread Sam Vilain
Rod Adams wrote: And as one who recently proposed a way of getting Prolog like features in Perl (through Rules, not Junctions), I understand the appeal completely. Junctions are not the way to that goal. They are something different. Taking multiple values at once is what junctions are all

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-17 Thread Sam Vilain
Aaron Sherman wrote: Sam mugwump Vilain refers to each of these syntaxes as /Pod dialects/. He is working on more formally defining the common model or AST that these dialects map to. Why? Seriously, why on earth do you want to encourage the proliferation of variant markup languages?! There aren't

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-17 Thread Sam Vilain
Damian Conway wrote: [No, I'm not back; I'm just passing by. But I feel that I need to comment on this whole issue] Thanks! This message has lots of useful information that I would have otherwise probably missed. It seems that the basic premise of the POD document object model gels well with

Re: identity tests and comparing two references

2005-03-31 Thread Sam Vilain
Darren Duncan wrote: Now I seem to remember reading somewhere that '===' will do what I want, but I'm now having trouble finding any mention of it. So, what is the operator for reference comparison? As someone who wrote a tool that uses refaddr() and 0+ in Perl 5 to achieve the same thing, I

Re: Documentary annotations: $what docwhy

2005-04-01 Thread Sam Vilain
Luke Palmer wrote: Supposing I had a doc trait, could I say: sub f2c (Num $temp docTemperature in degrees F) docConvert degress F to degrees C {...} Or would I be forced to spell it doc('stuff') ? Well, first you need an `is` somewhere in there. And after that I think you'll need

Re: Whither use English?

2005-04-13 Thread Sam Vilain
Juerd wrote: According to Wikipedia there are around 400 million native English speakers and 600 million people who have English as a second language. Should the remaining ~5.5 billion humans be exluded from writing perl code just so that we English speakers can understand all the code that is

Macros [was: Whither use English?]

2005-04-14 Thread Sam Vilain
Larry Wall wrote: (B Well, only if you stick to a standard dialect. As soon as you start (B defining your own macros, it gets a little trickier. (B (BInteresting, I hadn't considered that. (B (BHaving a quick browse through some of the discussions about macros, many (Bof the macros I

Re: Sun Fortress and Perl 6

2005-04-27 Thread Sam Vilain
Luke Palmer wrote: `is pure` would be great to have! For possible auto-memoization of likely-to-be-slow subs it can be useful, but it also makes great documentation. It's going in there whether Larry likes it or not[1]. There are so incredibly many optimizations that you can do on pure functions,

Re: Threading in Parrot vs Perl

2005-04-28 Thread Sam Vilain
Rod Adams wrote: I would be dismayed if autothreading used threads to accomplish it's goals. Simple iteration in a single interpreter should be more than sufficient. For sure. No point in doing 10_000 cycles to set up a scratch area for a single boolean test that might take 10 cycles. A

Re: S29: punt [pwned!]

2005-05-12 Thread Sam Vilain
Rod Adams wrote: It looks like I'm going to have to punt on finishing S29. On behalf of pugs committers, we will gladly adopt this task, which is in the pugs repository already at docs/S29draft.pod, as well as having a set of foundation classes that correspond to all these object methods in

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Sam Vilain
Rob Kinyon wrote: If that's the case, then if I change a variable that isa Str (that isa Num), does it change what it inherits from? Please don't use inherits when talking about these core types. Classical inheritance just doesn't work with the varied sets of numbers. All those stories you were

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Sam Vilain
Larry Wall wrote: : pugs '1.28' * '2.56' : 3.2768 : What is (or should be) going on here here? : [1] role NumRole { : method infix:* returns Num (NumRole $x, NumRole $y: ) { ... } : } : Str.does(NumRole); : [3] multi sub prefix:+ (Str $x) returns Num { ... } : multi sub

Re: Default precedence level of user defined infix ops

2005-05-18 Thread Sam Vilain
Luke Palmer wrote: And how do I explicitly define the precedence? Using the `tighter`, `looser`, and `equiv` traits. You specify precedence in terms of the precedence of other existing ops. sub infix:.(f, g) is looser(infix:+) {...} This is interesting. So, infix: is similar to Haskell's ()

Re: reduce metaoperator on an empty list

2005-05-19 Thread Sam Vilain
Edward Cherlin wrote: Here is the last answer from Ken Iverson, who invented reduce in the 1950s, and died recently. file:///usr/share/j504/system/extras/help/dictionary/intro28.htm [snip] Thanks for bringing in a little history to the discussion. Those links are all local to your system; do

Re: reduce metaoperator on an empty list

2005-05-19 Thread Sam Vilain
Stuart Cook wrote: In Haskell, there is a distinction between foldl and foldl1 (similar remarks apply to foldr/foldr1[1]): The former (foldl) requires you to give an explicit 'left unit'[2], which is implicitly added to the left of the list being reduced. This means that folding an empty list will

Re: Complex Arithmetic

2005-05-19 Thread Sam Vilain
Edward Cherlin wrote: There was a discussion of the principal value of square root on this list some time back, making the point that for positive [...] It turns out that the domain and range and the location of the cut lines have to be worked out separately for different functions.

Re: [S29] uniq

2005-05-19 Thread Sam Vilain
Mark Overmeer wrote: 'uniq' differs from 'sort' because there is no order relationship between the elements. A quick algorithm for finding the unique elements in perl5 is sub uniq(@) { my %h = map { ($_ = 1) } @elements; keys %h; } ...and an even quicker one is: use Set::Object;

Junctive and Higher order Types

2005-05-19 Thread Sam Vilain
Hi all, While trying to convert Haskell statements like this to Perl 6: data Cxt = CxtVoid -- ^ Context that isn't expecting any values | CxtItem !Type -- ^ Context expecting a value of the specified type | CxtSlurpy !Type -- ^ Context expecting multiple values of

Re: Sets

2005-05-26 Thread Sam Vilain
Patrick R. Michaud wrote: The continuing exchanges regarding junctions, and the ongoing tendency by newcomers to think of them and try to use them as sets, makes me feel that it might be worthwhile to define and publish a standard CSet class and operations sooner rather than later in Perl 6

Re: function signatures?

2005-05-29 Thread Sam Vilain
Ingo Blechschmidt wrote: Are signatures going to be an exposed first class object in Perl 6? I hope so, too. ~foo.signature; # Signature objects should stringify to a canonized form, e.g.: # ~sub (Str $bar, CoolClass $z where {...}) {...}.signature == # 'Str $bar, ANONCLASS(0xDEADBEEF)'

Re: Strongly typed containers?

2005-05-30 Thread Sam Vilain
Yuval Kogman wrote: We already have the Set class, how do we say what it contains? class Set { has $.type; method members returns $.type () { ... } } my Set of Int $s = Set.new; # is this how you call it? You are describing Higher Order types, also called Generic Algebraic Data

Re: Unicode Operators cheatsheet, please!

2005-05-31 Thread Sam Vilain
Rob Kinyon wrote: I would love to see a document (one per editor) that describes the Unicode characters in use and how to make them. The Set implementation in Pugs uses (at last count) 20 different Unicode characters as operators. I have updated the unicode quickref, and started a Perlmonks

Re: date and time formatting

2005-05-31 Thread Sam Vilain
Rob Kinyon wrote: What I'm trying to get at isn't that DateTime's API should be preserved. I'm saying that the concept of DateTime should be ported. Core or not core - it doesn't matter. When use'd (or installed), it should override now() (and anyone else we can think of) to return an object

Re: returns and context

2005-05-31 Thread Sam Vilain
Rod Adams wrote: How do I specify the signature of a context-sensitive function? sub foo() returns (what?) { return want ~~ Scalar ?? cheap_integer_result :: List_of_Sheep; } I suspect a typed junction would look like : Junction of Int|Str. Not quite. AIUI that means a

Re: What the heck is... wrong with Parrot development?

2005-06-06 Thread Sam Vilain
Fagyal Csongor wrote: With all respect, I think this is a very important thing which needs attention, and I hope that you will help us to clarify the situation. I am pretty sure Dan did not leave because he had a bad day - we know he Dan's position was very stressful, he had people from all

Re: reduce metaoperator on an empty list

2005-06-06 Thread Sam Vilain
Damian Conway wrote: What you want is: $product = ([*] @values err 0); Or: $factorial = ([*] 1..$n err 1); The err operator bind only to the point on the instruction it is attached to, ie it's not a shortcut for eval(), right? I'm just seeing some edge cases here for custom defined

Re: reduce metaoperator on an empty list

2005-06-07 Thread Sam Vilain
Luke Palmer wrote: and still don't make sense as reduce operators. Observe the table: # of args | Return (type) 0 | -Inf 1 | Num (the argument) 2 | bool ... | bool Let's look at the type of one of the many `reduce'

Re: reduce metaoperator on an empty list

2005-06-09 Thread Sam Vilain
TSa (Thomas Sandla) wrote: I'm not sure but Perl6 could do better or at least trickier ;) Let's assume that = = when chained return an accumulated boolean and the least or greatest value where the condition was true. E.g. 0 2 3 returns 0 but true 1 2 1 returns 1 but false 4 5

AUTLOAD and $_

2005-06-19 Thread Sam Vilain
From S10; In any case, there is no longer any magical $AUTOLOAD variable. The name being declared or defined can be found in $_ instead. The name does not include the package name. You can always get your own package name with $?PACKAGENAME. So, what is the prototype of AUTOLOAD? It is

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.

AUTOLOAD, this time distinct from AUTOSUB etc (and spelt correctly)

2005-06-20 Thread Sam Vilain
OK, that last discussion was productive, but I think we all (including myself) overlooked the fact that the AUTOLOAD and AUTOSUB methods are implied to have different calling conventions; There is still an AUTOLOAD hook that behaves as in Perl 5. The (AUTO*) routines are expected to return

Re: AUTOLOAD, this time distinct from AUTOSUB etc (and spelt correctly)

2005-06-20 Thread Sam Vilain
Rod Adams wrote: I never liked the idea of out-of-band arguments. Either something is passed, is available due to being in a broader scope, or can be gleamed from introspection. ok. First of all, I agree with the basic sentiment. However, to play devil's advocate and re-interpret what you

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: 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: 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

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: 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-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

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-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: 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-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

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: Do I need has $.foo; for accessor-only virtual attributes?

2005-07-18 Thread Sam Vilain
Larry Wall 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 that

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

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: 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: $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: 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: 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-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

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: new sigil

2005-10-20 Thread Sam Vilain
On Thu, 2005-10-20 at 08:45 -0700, Larry Wall wrote: More info. ¢T is a scalar variable just like $T, but enforces a class view, so you can use it as a class parameter, and pass any object to it, but only access the classish aspects of the object. The only other big difference is that you can

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

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: 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: 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: 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: 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: 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: 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: 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 (

  1   2   >