Re: Persistance of superpositions?

2002-10-30 Thread Damian Conway
!perl6/one) # !perl.yaml.org/super-none (longer type name, no format) sane: !perl/super-none - Larry - Damian - Brian ... Urk. It might be more forward thinking to allow any|all|one|none into the yaml.org type repository. That's my view. Danmian

Re: [RFC] Perl6 Operator List, Take 5

2002-10-30 Thread Damian Conway
Larry mused: On Tue, 29 Oct 2002, David Whipp wrote: : Larry Wall [mailto:larry@;wall.org] wrote: : > : unary (postfix) operators: : > :... - [maybe] same as ..Inf [Damian votes Yes] : > : > I wonder if we can possibly get the Rubyesque leaving out of : > endpoints by s

Re: [RFC] Perl6 Operator List, Take 5

2002-10-30 Thread Damian Conway
could overload and do whatever they liked with. In creating my operator list I deliberated shied away from the unary and binary multimorphic forms. But I do see Graham's point and would favour retaining polymorphic unary C<^> at least. Damian

Re: [RFC] Perl6 Operator List, Take 5

2002-10-30 Thread Damian Conway
-specific) + - force to numeric context - - force to numeric context, negate ~ - force to string context Correct? that was what I was advocating, yes. Damian

Re: [RFC] Perl6 HyperOperator List

2002-10-30 Thread Damian Conway
es? Sure (for sufficiently complex values of simple ;-) Here's how to find the love of your life: $requirements = "tall" & "dark & "handsome" | "old" & "rich" | "Australian"; for <> -> $candidate { my $traits = any( split //, $candidate ); print "True love: $candidate\n" if $requirements eq $traits; } Of course, not everyone can hope to be lucky enough to meet an Australian, but you get the idea. ;-) Damian

Re: [RFC] Perl6 HyperOperator List

2002-10-30 Thread Damian Conway
orrected version instead: $requirements = "tall" & "dark" & "handsome" | "old" & "rich" | "Australian"; for <> -> $candidate { my $traits = any( split //, $candidate ); print "True love: $candidate\n" if $requirements eq $traits; } Damian

Re: [RFC] Perl6 Operator List, Take 5

2002-10-30 Thread Damian Conway
Larry elucidated: In general, for any type, how do you write [$min .. $max - $step : $step] when you don't even necessarily have subtraction defined? We don't know how to do "z" - 1 in Perl 5, for instance. Okay. I buy that. Damian

Re: [RFC] Perl6 HyperOperator List

2002-10-30 Thread Damian Conway
x27;ve already said that appending to a junk of the same type doesn't add "parentheses". This may be one of those situations where the assignment operators are overloaded separately from the basic ops. I don't believe that's necessary or appropriate. I think it's important to be able to "append" consistently, regardless of the current value of the LHS. Damian

Re: worth adding collections to the core language?

2002-10-30 Thread Damian Conway
%> always meaning "hash" is exactly why I *wouldn't* like to see it! Damian

Re: Perl6 Operator List, Damian's take

2002-10-30 Thread Damian Conway
ors rather than being illegal. ETOOCLEVERBYHALF, IMHO. ;-) I'd much rather see these common reductions be predefined C, C, and C methods of Array, and the more obscure and bizarre reductions be explicitly marked with a C: my $countersequence = reduce {$^x-$^y}, @b Damian

Re: plaintive whine about 'for' syntax

2002-10-31 Thread Damian Conway
ty for increased semantic complexity, but only really improves the readability of a comparatively rare case. Damian

Re: [RFC] Perl6 HyperOperator List

2002-10-31 Thread Damian Conway
ince that would involve giving up my first vacation in two years, and consequently getting divorced...no. ;-) Damian

Re: UTF-8 and Unicode FAQ, demos

2002-11-02 Thread Damian Conway
$a + $b that's equivalent to the multimethod call: operator:+($a,$b) This way you also get to choose which of the multimethods gets applied for free... Err, no you don't. The whole point of multimethods is that *they* choose, based on the dynamic types of *all* their arguments. Damian

Re: Flexops as information preserving Bitops

2002-11-02 Thread Damian Conway
will collapse in a 'mash everything together in bitop fashion' way. Yes. This was more-or-less the solution I proposed last week in http://archive.develooper.com/perl6-language%40perl.org/msg11835.html Damian

Re: UTF-8 and Unicode FAQ, demos

2002-11-02 Thread Damian Conway
't we? Hmmm...I wonder if one could then write: $str = <<<>; to make the heredoc terminator *really* stand out ;-) > Or we could change here docs to vv"TAG" or some such that points downwards to where the text actually is. Urk. Damian

Re: UTF-8 and Unicode FAQ, demos

2002-11-02 Thread Damian Conway
agreement, because that's the plan, as I understand it. Great minds obviously think alike. That's what it *will* do. Except it's: $a + $b that's equivalent to the multimethod call: operator:+($a,$b) So, in fact, totally different. Well, yeah. But only at the syntactic level. Which, as Dan will tell you, is completely irrelevant. ;-) Damian

Re: Primitive Boolean type?

2002-11-02 Thread Damian Conway
er true or false (or some junction thereof). $.is_plugged_in = true but false; So that probably won't even parse. Thank goodness! Of course, this *will* parse: $perplexing = false "true" but false; >;-) Damian

Re: vectorization (union and intersection operators)

2002-11-04 Thread Damian Conway
Ed Peschko asked: ps - as an aside, are the apocalypses going to be backdated as changes to the design come up? Yes. Or are the apocalypses just a first draft for more enduring documentation? Yes. ;-) Damian

Re: UTF-8 and Unicode FAQ, demos

2002-11-04 Thread Damian Conway
Interestingly, I find it just the opposite. The use of symbolic operators makes it easier for me to differentiate the "nouns", "verbs", and "punctuation" of a piece of code. Damian

Re: UTF-8 and Unicode FAQ, demos

2002-11-04 Thread Damian Conway
Or something similar '>>*'<<, [>*<], etc... Much as I hate the notion of di- and trigraphs, this is a possibility. Though I'd much rather we just allowed POD escapes (e.g. E and E) in code. And, yes, I'm aware that makes E*E incredibly ugly. I'm rather *counting* on it, in fact ;-) Damian

Re: Unifying invocant and topic naming syntax

2002-11-04 Thread Damian Conway
a syntax like: method f ($self : $a is topic, $b) is given($c) { ... } which clearly marks all the irregularities. Not to mention that this more explicit syntax doesn't inject a spurious pseudoparameter into the parameter list. Damian

Re: UTF-8 and Unicode FAQ, demos

2002-11-04 Thread Damian Conway
at's why I semi-seriously suggested replacing C by C<×>. For some reason alphabetic operators (at least, those that are pretending to be symbols) really bug me. It would be really funny to use cent ¢, pound £, or yen ¥ as a sigil, though... H. Given that a pound is worth more than a dollar, maybe £ is the sigil for pairs. ;-) Damian

Re: Possible Vector Operator Notations

2002-11-04 Thread Damian Conway
which give the same functionality. Damian

Re: Supercomma! (was Re: UTF-8 and Unicode FAQ, demos)

2002-11-04 Thread Damian Conway
other than that it expects 3 scalar arguments. And Simon will be happ(y|ier) that we've removed an exception. and reinstituted the previous exception that a semicolon in an parameter list marks the start of optional parameters! :-) Damian

Re: Unifying invocant and topic naming syntax

2002-11-05 Thread Damian Conway
egardless of which character is used for the purpose) Damian

Re: Keywords global or only in context?

2002-11-05 Thread Damian Conway
pposite of yacc.) Is this a valid assumption? Sure. It's a valid assumption for Perl 5: sub print { my ($print, @print) = @_; ${print}->{print}->print(@{print}); } so I'm sure it will be for Perl 6 too. Damian

Re: [RFC] Perl6 Operator List, Take 5

2002-11-05 Thread Damian Conway
inary ?^: ! Synonym for binary ?^^: !! Incidentally, that leaves C<^> free to be the unambiguous vectorizing prefix (modulo the C<^+=> ambiguity). I still vastly prefer C<»op«> though. Damian

Re: Supercomma! (was Re: UTF-8 and Unicode FAQ, demos)

2002-11-05 Thread Damian Conway
Which would take 2 elements from @a, and one from @b, until both arrays were exhausted. As Buddha Buck suggested elsewhere, and as I have coded above, I would imagine that this functionality would be mediated by pairs and merged into a single C function. So that last example is just: for zip(@a=>2,@b=>1) -> $x,$y,$z { ... } Damian

Re: Supercomma!

2002-11-05 Thread Damian Conway
Michael Lazzaro asked: So how could we say "take 2 elements from @a, stepping 10 indices at a time, plus one from @b"? I think it's overreaching to try and fold this into C. I'd suggest that hyperslicing @a within a C will probably take care of that (presumably uncommon) case. Damian

Re: 'for' clarification, summary...

2002-11-05 Thread Damian Conway
ff of the ark\n"; } my $arksubs = $twoByTwo | $threeByThree; for @a, pick($arksubs); It picks either the 2-by-2 state or the 3-by-3 state of the $arksubs junction before the loop begins and then iterates through @a accordingly. BTW, that last line should probably use either: pick($arksubs:) or: $arksubs.pick Damian

Re: Unicode operators [Was: Re: UTF-8 and Unicode FAQ, demos]

2002-11-05 Thread Damian Conway
ested that we might allow POD escapes in code as well. Thus: $campers = $a E<263a> $b # make $a and $b happy Damian

Re: Unicode operators [Was: Re: UTF-8 and Unicode FAQ, demos]

2002-11-05 Thread Damian Conway
Michael Lazzaro proposed: It's up to Larry, and he knows where we're all coming from. Unless anyone has any _new_ observations, I propose we pause the debate until a decision is reached? I second the motion! Damian

Re: Continuations

2002-11-05 Thread Damian Conway
? The re-entry point isn't stored in the subroutine itself. It's stored (indexed by optree node) in the current subroutine call frame. Which, of course, is preserved when recursive iterator invocations recursively yield. Damian

Re: Unifying invocant and topic naming syntax

2002-11-07 Thread Damian Conway
r: $foo = { print $^_ }; such that $^_ is effectively converted to an 'is given($^_)'. No, that doesn't work. The placeholder $^_ is entirely unrelated to $_. Besides, what's wrong with: $foo = sub { print $_ } is given($_); ??? Damian

Re: list comprehensions

2002-11-07 Thread Damian Conway
sired: %a_students = grep {.key ~~ /:i^a/} %grades; or: %a_students = grep {.key ~~ m:i/^a/} %grades; or: %a_students = grep sub($k,$v){$k ~~ m:i/^a/}, %grades.kv; Damian

Re: Superpositions and laziness

2002-11-07 Thread Damian Conway
ubroutine did, or whether the argument was a simple number, some species of junction, or some mysterious object of a class derived from Num. Damian

Re: String -> Numeric conversion

2002-11-07 Thread Damian Conway
to test for, and "int" a subclass? The latter would be my expectation. Though it's C, not c, I believe. Damian

Re: Superpositions and laziness

2002-11-08 Thread Damian Conway
: sub square ( Num $n ) is same {...} whereas others feel that: sub square ( Num $n ) is memoized {...} is more appropriate. Damian

Re: Superpositions and laziness

2002-11-08 Thread Damian Conway
> Wow, I've never seen such a compact implementation of such a thing. I > love you, Perl 6 :-) Damian

Re: Unifying invocant and topic naming syntax

2002-11-11 Thread Damian Conway
ind of *anti*-placeholder. Introducing that kind of inconsistency would be playing straight into Simon's hands! ;-) Why bother with currying? You mean placeholders. Currying is something else entirely. Why bother with the "it" concept? None of these are necessary. They simplify code generation, but their more general feature is enabling brevity. Of usage, yes, but not necessarily of declaration. Damian

Re: Primitive Vs Object types

2002-11-11 Thread Damian Conway
>{$attr}\n"; } You will. But they won't be entries of a hash. They'll be separate variables and associated accessor methods. So maybe something like this: foreach my $attr (qw(foo bar baz)) { print "$attr: $self.$attr()\n"; } Damian

Re: Primitive Vs Object types

2002-11-11 Thread Damian Conway
te!) C method, allowing something like: for $this.HAS -> $attr { print "$attr.key(): $attr.value()\n" } Or maybe not. ;-) Damian

Re: Superpositions and laziness

2002-11-11 Thread Damian Conway
27;t end in i[zs]e (or end ou?r or [cs]e :-) Except, of course, that many (near-)English speakers would be tempted to spell your suggestion "cachable". Hence I suspect that "cached" might be better. Then we will only have to contend with those few remaining Romantic poets who will want to write it "cachéd". ;-) Damian

Re: Superpositions and laziness

2002-11-11 Thread Damian Conway
be sure what optimizations the compiler is or isn't going to make, or even whether those optimzations will be the same from platform to platform [*]. So I can never be sure what the precise behaviour of my sub will be. :-( Damian [*] I can easily imagine architectures under which re-calling a p

Re: FMTWYENTK about := ( :-)

2002-11-11 Thread Damian Conway
refers to *the same containers* as the corresponding ( interlaced keys and values ) containers of %d. property example : e.g. $a is constant = 1; $b = 5; ($a,$b) := ($b,$a) ; $b = 7 # error cannot change constant . Correct. another issue : how we know that always under '@a' array variable is hanging array -type container ? Perl compiler creates and manipulate containers . So when we declare my @a = ( 1,2) ; it creates appropriate container. we cannot manipulate containers "directly" . only through names or something that refers them . so perl always takes care that the declared correspondence between name sigil ant type of container be preserved. Unless, of course, we specifically ask that it not be preserved: my @a is MagicArray; # @a implemented by MagicArray class, not Array class. If needet it destrys unnecessary contauiners and creates new. anyway this is my flow of (un) -consciousness. my feeling is that these things will be confusing for non-perl people. But only until they are explained to them properly. ;-) Damian

Re: Unifying invocant and topic naming syntax

2002-11-11 Thread Damian Conway
r. I think we should just agree to disagree here, and let Larry decide. Damian

re: This week's Perl 6 summary

2002-11-13 Thread Damian Conway
notice that one of the Cs has been renamed to C. And one of the Cs has become C. And I sincerely hope that the Cs and Cs will be similarly disambiguated. For several discussions of why this particular feature of natural languages *doesn't* map well onto programming

Re: More junctions

2002-11-14 Thread Damian Conway
hey're still two completely independent junctions. Damian

Re: Unifying invocant and topic naming syntax

2002-11-14 Thread Damian Conway
erl modules are doing something (typically a while loop) which tramples on $_, and so makes something go wrong in their caller. (possibly several levels down) Yes. That's why it's not the default in Perl 6, and you have to specify a verbose and slightly ungainly property in order to get the behaviour. Damian

Re: Continuations

2002-11-16 Thread Damian Conway
Peter Haworth asked: So to get the same yield context, each call to the coroutine has to be from the same calling frame. If you want to get several values from the same coroutine, but from different calling contexts, can you avoid the need to wrap it in a closure? I don't think so. Damian

Re: Superpositions and laziness

2002-11-16 Thread Damian Conway
Piers Cawley wrote: [Speculations elided] Which is somewhat dependent on being able to do C. Which you can't do, since C is compile-time. Damian

Re: Meta-operators

2002-11-16 Thread Damian Conway
also pondered general "adverbs", introduced by a colon, that modify a subroutine, method, or operator call. Damian

Re: Unifying invocant and topic naming syntax

2002-11-16 Thread Damian Conway
($def_foo) { ... } Or, if you stick with Perl5 convention, and I imagine this is what people will expect from the builtins at least: sub bar($foo; $baz) is given($baz) {...} I think this should definitely be a compile-time error. Damian

Re: More junctions

2002-11-16 Thread Damian Conway
Cs) with exactly one eigenstate serialize to that. * Every other junction serializes to some representation of its junctive type and internal states (e.g. "all(1,2)", "none('Crosby', 'Stills', 'Nash', 'Young')", etc.) Damian

Re: Unifying invocant and topic naming syntax

2002-11-16 Thread Damian Conway
y useful but generally frowned on in a "don't do that" kind of way. My sentiments precisely. Though it may only be frowned upon in a "don't do that without documenting it" kind of way. ;-) Damian

Re: More junctions

2002-11-16 Thread Damian Conway
come up in practice, but I do see it as an issue. The question is: are junctions more useful if they do or don't collapse upon examination? I'm fairly solidly convinced that it's better if they don't. Damian

Re: More junctions

2002-11-16 Thread Damian Conway
ween: if $moe|$larry|$curly == $hurt {...} # i.e. any of them hurt and: if $moe|$larry|$curly != $hurt {...} # at least one not hurt and also between: if $moe&$larry&$curly == $hurt {...} # all hurt and: if $moe&$larry&$curly != $hurt {...} # none hurt Damian

Re: Control Structures I: given

2002-11-16 Thread Damian Conway
B~~C) && !(B~~D)) The logic is straightforward and the pattern not too hard to see: the type of the left operand determines the "top level" (i.e. lower precedence) logical connective whilst the type of the right operand determines the "bottom level" (higher precedence) logical connectives. BTW, the same table works for any boolean operation between junctives. And, of course, it generalizes to any number of states on either side. Damian

Re: String concatentation operator

2002-11-16 Thread Damian Conway
s ignored, or maybe optimized away). Damian

Re: Unifying invocant and topic naming syntax

2002-11-16 Thread Damian Conway
r/bin/perl -w $_ = ~time when &morning() { print "good morning" } Almost. You want: when &morning { print "good morning" } (i.e. no explicit call parens) Damian

Re: Hmm...

2002-11-16 Thread Damian Conway
added as an external module.) Junctions aren't quantum mechanical, so this doesn't apply. Damian

Re: is sigil user - extensible ? Was: UTF-8 and Unicode FAQ, demos

2002-11-16 Thread Damian Conway
and install the derived grammar as the caller's parser. Damian

Re: Continuations

2002-11-16 Thread Damian Conway
ersions of the same coroutine instantiated simultaneously, which strikes me as a terribly useful thing. Yep! Perhaps we'd be better with an explicit coroutine instantiation call, like: $foo = &bar.instantiate(1, 2, 3); or something. Ew! (Or not, as it is ugly) That'd be my vote! ;-) Damian

Re: String concatentation operator

2002-11-17 Thread Damian Conway
ertainly expect that the order of execution is undefined, since the states of a junction are not themselves ordered. Damian

Re: Unifying invocant and topic naming syntax

2002-11-17 Thread Damian Conway
e caller's topic). Finally, I would rather we did not have more than one syntax for specifying default values for parameters. I still think my original: sub bar(; $foo = $topic) is given($topic) {...} is the appropriate compromise. Damian

Re: String concatentation operator

2002-11-17 Thread Damian Conway
# in a disjunction Damian

Re: Continuations

2002-11-17 Thread Damian Conway
instantiate(1, 2, 3); @array = $foo.as_array; Well, I think it has to be much less ugly than that! ;-) Damian

Re: Continuations

2002-11-17 Thread Damian Conway
if the iterator's C method is invoked without arguments, use the old parameters; if it's invoked with arguments, rebind the parameters. And the use of the <$foo> operator to mean $foo.next cleans up teh syntax nicely. I must say I rather like this formulation. :-) Damian

Re: Continuations

2002-11-17 Thread Damian Conway
yield them. Nearly. Filehandles are just iterator objects, each attached to a coroutine that reads lines constantly and yields them. I'm really starting to like the concept of those co-routines :) Likewise. They elegantify stuff. If you're going to talk Merkin, talk it propericiously: "They elegantificatorize stuff" ;-) Damian

Re: Unifying invocant and topic naming syntax

2002-11-18 Thread Damian Conway
Larry Wall wrote: On Mon, Nov 18, 2002 at 08:05:47AM +1100, Damian Conway wrote: : I still think my original: : : sub bar(; $foo = $topic) is given($topic) {...} : : is the appropriate compromise. Won't fly. Referring to something lexical before it's declared is a no-no. I woul

Re: Continuations

2002-11-18 Thread Damian Conway
Ken Fox wrote: Damian Conway wrote: my $iter = fibses(); for < <$iter> > {...} (Careful with those single angles, Eugene!) Operator << isn't legal when the grammar is expecting an expression, right? Right. The < must begin the circumfix <&

Re: Continuations elified

2002-11-18 Thread Damian Conway
filehandle-ish objects that happen to also stringify to the command-line strings. Hm. Proposal: Seemed very complex to me. That's "elify", to wit: "Z'at elify the code?" "Elify - no." Damian

Re: String concatentation operator

2002-11-18 Thread Damian Conway
pass a junction. Suppose I want to pass a junction to a subroutine instead of calling the sub with each value of the junction... how would I do that? Tell the sub that it's expecting an undistributed junction as its argument: sub foo($param is junction) {...} Damian

Re: String concatentation operator

2002-11-18 Thread Damian Conway
ates over them. (Potentially ad infinitum) The C loop is still single-threaded, only the values it's iterating are multiplexed. And here I thought Quantum INTERCAL was a joke... :) Junctions Aren't Quantum. Damian

Re: Continuations elified

2002-11-18 Thread Damian Conway
o C returns a new Iterator object. The solution is very simple, of course: my $nextfib = ; but we might want to contemplate issuing a warning when someone calls an argumentless coroutine within a scalar context <...>. Damian

Re: Continuations

2002-11-18 Thread Damian Conway
r coming from the author of "C++ Resyntaxed". Did the immodest proposal fix < <> > syntax? ;) But of course! In SPECS, type parameters live in unambiguously nestable (and yacc parsable) <[...]> delimiters. Damian

Re: Continuations

2002-11-18 Thread Damian Conway
ot; "c">>; Likewise. Is it illegal now to use quotes in qw()? Nope. Only as the very first character of a <<...>>. So any of these are still fine: print << "a" "b" "c" >>; print <<\"a" "b" "c">>; print «\"a" "b" "c"»; print qw/"a" "b" "c"/; Damian

Re: String concatentation operator

2002-11-18 Thread Damian Conway
e when given a junction. I've thought about it at considerable length, and played around with the Q::S module. I concluded that passing junctions into subroutines by default is a Very Bad Idea. The reason, as Luke has already pointed out, is that junctive logic is different from scalar logic. So most subroutines won't be able to "accept anything and DWIM" anyway. Damian

Re: Continuations elified

2002-11-18 Thread Damian Conway
t so. while {...} # I'm afraid to ask! Usually an infinite loop. C returns a new iterator every time, which <...> then calls C on. Damian

Re: Continuations elified

2002-11-18 Thread Damian Conway
David Wheeler asked: while <$fh> {...}# Iterate until $fh.readline returns EOF? That's a scalar context? Sure. C always evaluates its condition in a scalar context. Damian

Re: Continuations

2002-11-18 Thread Damian Conway
Luke Palmer asked: What was the final syntax for vector ops? @a ≪+≫ @b @a ≫+≪ @b The latter (this week, at least ;-). Damian

Re: Unifying invocant and topic naming syntax

2002-11-18 Thread Damian Conway
g $CALLER::_ ;-) Though I think: my sub foo($arg = $=) {...} would be even better. Damian

Re: String concatentation operator

2002-11-18 Thread Damian Conway
th a junction of the two exceptions. ;-) Damian

Re: Continuations

2002-11-18 Thread Damian Conway
Iain 'Spoon' Truskett wrote: @a ???+??? @b @a ???+??? @b Y'know, for those of us who still haven't set up Unicode, they look remarkably similar =) "Think Of It As Evolution In Action" ;-) Damian

Re: String concatentation operator

2002-11-18 Thread Damian Conway
o guarantee which state of the junction is processed first (whether they're being processed in parallel or series). Damian

Re: Unifying invocant and topic naming syntax

2002-11-18 Thread Damian Conway
on't work. And, yes, I could make it an optional argument, but them I have no way of preserving my chosen interface. Or porting that code cleanly. Besides all that, ($_ = $_) where $_ means something different from $_ is Just Plain Wrong. ;-) Damian

Re: Continuations

2002-11-20 Thread Damian Conway
t the backslash here too. Maybe. It depends on whether Larry decides to make « and << synonyms in all contexts (in which case: no). Damian

Re: String concatentation operator

2002-11-20 Thread Damian Conway
ms. Perhaps. But we need to think through the issues so that we can eventually move to threaded implementations without changing the semantics. Damian

Re: Continuations elified

2002-11-20 Thread Damian Conway
"interface" : lazy array is an iterator object "inside" Array interface : That's one particular implementation of a lazy array, yes. Another implementation is an array interface with an subroutine that maps indices onto values. Perl 6 will undoubtedly need both, and maybe others as well. Damian

Re: Coroutines, continuations, and iterators -- oh, my! (Was: Re: Continuations elified)

2002-11-20 Thread Damian Conway
ust update the same iterator, so any "lazy array" bits have to update as well. It means that the lazy array will not contain the lines that were read by the inner iteration. So the code will behave as expected (i.e. process each line from the file exactly once). Damian

Re: Superpositions and laziness

2002-11-20 Thread Damian Conway
hope not! Damian

Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-04 Thread Damian Conway
Larry wrote: : But I think we'd definitely like to introduce \d. Can't, unless we change \d to in regexen. Which we ought to be very wary of, given how very frequently it's used in regexes. Damian

Re: Usage of \[oxdb]

2002-12-05 Thread Damian Conway
LF (conjectural) Damian

Re: purge: opposite of grep

2002-12-05 Thread Damian Conway
ntuitive to have to write: (@false, @true) := classify { $^x > 10 } @nums; I think it's a small price to pay to avoid tiresome special cases. Especially since you then get your purge/vrep/antigrep for free: (@members) := classify {$_->{'quit'}} @members; ;-) Damian

Re: In defense of zero-indexed arrays.

2002-12-06 Thread Damian Conway
ther than 0. Perhaps even the built-in types can just take a range property: my @array is range(1...); Surely, that would be: my @array is domain(1...); ??? Damian

Re: purge: opposite of grep

2002-12-06 Thread Damian Conway
y much as a name for this built-in. Must be the vaguely biblical association ;-) Headed off in another direction, having a sub distribute its results like this reminds me of: ... -> ... Can arrays on the rhs of a -> ever mean something useful? Sure. It means that the key of the pair is an array reference. Damian

Re: Usage of \[oxdb]

2002-12-06 Thread Damian Conway
Nicholas Clark mused: I just had this thought - can I interpolate in there? Something like "\c[$(call_a_func())]" Why not just: "$(chr call_a_func()]" ??? Damian

Re: purge: opposite of grep

2002-12-06 Thread Damian Conway
for @input -> $v { push ($v < 10 ?? @under :: $v > 20 ?? @over :: @in_range), $v; } Also, can I return superpositions (sorry, junctions), to provide multiple classifications? Or would I return an array for that? A (dis)junction ought to work there. Damian

Re: purge: opposite of grep

2002-12-06 Thread Damian Conway
Michael Lazzaro wrote: How would you do something like: (@foo,@bar,@zap) := classify { /foo/ ;; /bar/ ;; /zap/ } @source; Since I don't understand what that's supposed to do, I probably *wouldn't* do something like it. What effect are you trying to achieve? Damian

Re: purge: opposite of grep

2002-12-07 Thread Damian Conway
index: (@foo,@bar,@zap) := part { /foo/ => 0, /bar/ => 1, /zap/ => 2 }, @source; or even a arrayed form, when the corresponding index was implicit: (@foo,@bar,@zap) := part [/foo/, /bar/, /zap/], @source; Damian

<    6   7   8   9   10   11   12   13   >