Re: handling undef better

2005-12-23 Thread TSa
HaloO, Nicholas Clark wrote: I think that Larry is referring to slightly larger and more expensive rockets than regular fireworks: http://www.siam.org/siamnews/general/ariane.htm I know. But where would we put Perl 6 onto a range of programming languages parrallel to rockets ranging from

Re: Problem with dwimmery

2005-12-23 Thread Ruud H.G. van Tol
Jonathan Lang: could we huffman-code do nothing clauses by leaving out the appropriate argument? while $x-- some_condition($x); Heheh, I often code like that, and then silence the complaint by adding the {}. -- Grtz, Ruud

Re: Problem with dwimmery

2005-12-23 Thread TSa
HaloO, Nicholas Clark wrote: Well, I assume that the do-nothing sub is assigned into the variable, and gets re-evaluated each time the variable is use. Which would mean that you'd get a new (different) empty hash each time. Whereas an empty hash constructor gives you a hash reference to keep.

Re: Problem with dwimmery

2005-12-23 Thread Nicholas Clark
On Fri, Dec 23, 2005 at 10:43:23AM +0100, TSa wrote: HaloO, Nicholas Clark wrote: Well, I assume that the do-nothing sub is assigned into the variable, and gets re-evaluated each time the variable is use. Which would mean that you'd get a new (different) empty hash each time. Whereas an

Match objects

2005-12-23 Thread Luke Palmer
What sort of match object should this return, supposing that it didn't infinite loop: x ~~ / [ [ (x) ]* ]* / Should $/[0][0] be x, or should $/[0][0][0] be x? If it's the latter, then when do new top-level elements get added? / [ [ { say +$/[0][] } # is this

Deep copy

2005-12-23 Thread Luke Palmer
Does .clone do deep or shallow copying of objects? I'm going to argue for shallow. I know there's a obvious tendency to say that we should go with deep, because it's useful sometimes. However, I think that would be ignoring the amazing prevelance of the shallow copy idioms in perl 5: [

Re: Deep copy

2005-12-23 Thread Juerd
Luke Palmer skribis 2005-12-23 16:16 (+): However, I think that would be ignoring the amazing prevelance of the shallow copy idioms in perl 5: [ @array ] { %hash } It's a great idiom. Not much typing, easy on the eyes and easy to understand. There's little, if any, reason to use

real ranges

2005-12-23 Thread TSa
HaloO Everybody, here's a an idea from me about makeing range object a bit like junctions. That is a range object has a $.min and $.max and the following comparison behaviour: str num lt strictly inside -+ gt strictly outside --+ | eq == exactly on boundary --+ | |

Re: real ranges

2005-12-23 Thread TSa
Ups, I forgot to mention things like +('a0',,'e3') == +( a0 a1 a2 a3, b0 b1 b2 b3, c0 c1 c2 c3, d0 d1 d2 d3, e0 e1 e2 e3 ) == +( 'a0','a1','a2','a3',

Re: Deep copy

2005-12-23 Thread Luke Palmer
On 12/23/05, Juerd [EMAIL PROTECTED] wrote: Luke Palmer skribis 2005-12-23 16:16 (+): However, I think that would be ignoring the amazing prevelance of the shallow copy idioms in perl 5: [ @array ] { %hash } It's a great idiom. Not much typing, easy on the eyes and easy to

Re: real ranges

2005-12-23 Thread Juerd
TSa skribis 2005-12-23 17:33 (+0100): lt strictly inside -+ gt strictly outside --+ | eq == exactly on boundary --+ | | | | | negation ne != not on boundary --+ | | le = inside or on boundary --+ | ge = outside or on

Re: Deep copy

2005-12-23 Thread TSa
HaloO, Luke Palmer wrote: That's an interesting idea. A deep reference. I also instantaniously loved the idea to dinstinguish between the types Hash and Ref of Hash. Or Array etc. --

Re: Deep copy

2005-12-23 Thread Juerd
Luke Palmer skribis 2005-12-23 16:42 (+): I'd want something that clones this, somewhere between shallow and deep. .c should be deep, but .d shallow. Perhaps this can be determined using some attribute, that for a referenced hash defaults to the opposite of what it defaults to for a

Re: real ranges

2005-12-23 Thread Luke Palmer
On 12/23/05, TSa [EMAIL PROTECTED] wrote: HaloO Everybody, here's a an idea from me about makeing range object a bit like junctions. That is a range object has a $.min and $.max and the following comparison behaviour: str num lt strictly inside -+ gt strictly outside

Re: Deep copy

2005-12-23 Thread Nicholas Clark
On Fri, Dec 23, 2005 at 04:16:44PM +, Luke Palmer wrote: Does .clone do deep or shallow copying of objects? I'm going to argue for shallow. I know there's a obvious tendency to say that we should go with deep, because it's useful sometimes. However, I think that would be ignoring the

Re: Deep copy

2005-12-23 Thread Juerd
Nicholas Clark skribis 2005-12-23 17:18 (+): Why not call the shallow copy .copy, and the deep copy .clone? Because using (almost-)synonyms for different things leads to infinite confusion. List/Array is a good example. Juerd -- http://convolution.nl/maak_juerd_blij.html

Re: Problem with dwimmery

2005-12-23 Thread Larry Wall
On Thu, Dec 22, 2005 at 03:19:03PM -0800, Jonathan Lang wrote: : As a third possibility, could we huffman-code do nothing clauses by : leaving out the appropriate argument? That is: : : while $x-- some_condition($x); : : or : : loop ( ; some_condition($x) ; $x--); We could, except that

Re: Iterating over complex structures

2005-12-23 Thread Brad Bowman
But in Perl 5 to navigate complex structures one needs ad-hoc solutions. I wonder if something is planned in Perl 6 as a means to do that through a syntactically convenient construct with ad-hoc-isms pluggable in in the form of suitable hooks (e.g. .on_node( { code; ... } ), etc.) that would

Re: Iterating over complex structures

2005-12-23 Thread Brad Bowman
Well, @Larry has been researching attribute grammars for a month or two now, which are an efficient (programmer-wise, not necessarily processor-wise) method for specifying computations over trees. The only syntax we've seen is that of Language::AttributeGrammar and TGE, whose roots come from

Re: Deep copy

2005-12-23 Thread Larry Wall
I think that deep copying is rare enough in practice that it should be dehuffmanized to .deepcopy, perhaps with optional arguments saying how deep. Simple shallow copy is .copy, whereas .clone is a .bless variant that will copy based on the deep/shallow preferences of the item being cloned. The