Re: Hackathon notes

2005-07-08 Thread Rod Adams
multi method foo#fiz (String x) {...} $y = 42; $obj.foo#fiz($y); # even though $y looks like a Num $obj.foo($z); # let MMD sort it out. It's unclear if $obj.foo($y); even works, or should work, even if it does. It be no means solves all of Yuval's problems, but it would be a handy workaround to un-multi your calls. -- Rod Adams

Re: MMD handling (was Re: Hackathon notes)

2005-07-08 Thread Rod Adams
David Storrs wrote: On Jul 8, 2005, at 4:25 PM, Dave Whipp wrote: Rod Adams wrote: multi method foo#bar (Num x) {...} multi method foo#fiz (String x) {...} $y = 42; $obj.foo#fiz($y); # even though $y looks like a Num $obj.foo($z); # let MMD sort it out. Instead of

Re: Perl 6's for() signature

2003-07-31 Thread Rod Adams
At 10:05 AM 7/31/2003 -0600, Luke Palmer wrote: Well, I don't think it's possible, actually. There's a flattening list context at the beginning (implying a sugary drink from 7 eleven), followed by a code block. But, as we know, slurpy arrays can only come at the end of positional parameters. Anyo

RE: Perl 6's for() signature

2003-07-31 Thread Rod Adams
about. -- Rod Rob -Original Message- From: Rod Adams [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2003 12:56 PM To: Perl 6 Language Subject: Re: Perl 6's for() signature At 10:05 AM 7/31/2003 -0600, Luke Palmer wrote: >Well, I don't think it's possible, actually. Th

What to do....

2003-11-14 Thread Rod Adams
nly don't want the language to loose the internal cohesiveness that all languages need, and am suitably scared of "design by committee"... but I'd like to think that there's something that could be done to help matters. Comments? Suggestions? -- Rod Adams PS -- I'm willing to commit several hrs a week to the effort.

Re: What to do....

2003-11-15 Thread Rod Adams
At 10:40 PM 11/14/2003 -0800, chromatic wrote: I'd really like to see people start turning the existing design documents into story cards and programmer tests for Perl 6. That'll make it much easier to implement the thing. So basically go back through the existing Apoc/Exeg's and break it down in

Re: The C Comma

2003-11-24 Thread Rod Adams
At 04:40 PM 11/24/2003 -0800, Michael G Schwern wrote: I definately agree that this is used rarely enough that it should be a word and not a single character. "then" sounds too much like "if/then" which is confusing. Its exactly the opposite from what you're trying to convey. It also doesn't conve

Re: [perl] Re: Object Order of Precedence (Was: Vocabulary)

2003-12-20 Thread Rod Adams
Luke Palmer wrote: Joe Gottman writes: - Original Message - From: "Jonathan Lang" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, December 20, 2003 3:41 PM Subject: [perl] Re: Object Order of Precedence (Was: Vocabulary) Larry Wall wrote: If DangerousPet doesn't define a

Re: Perl 6 using Perl 5 modules

2003-12-21 Thread Rod Adams
PerlDiscuss - Perl Newsgroups and mailing lists wrote: When the official release of Perl 6 is released and I start to write some Perl 6 programs using Perl 5 modules, will I get any errors? How will this be handled? Will all of the Perl 5 modules have to be ported over and converted to Perl 6 code?

Re: Semantics of vector operations

2004-01-29 Thread Rod Adams
Luke Palmer wrote: Austin Hastings writes: I think you guys may be talking at cross purposes. Robin, I think, is talking primarily about coding, while Damian talks of reading. Perhaps Damian's solution is a Unicode2Ascii perl script that emits formal names, combined with the implementation in P

Re: Unicode under Windows (was RE: Semantics of vector operations)

2004-01-30 Thread Rod Adams
Austin Hastings wrote: From: Rod Adams [mailto:[EMAIL PROTECTED] Question in all this: What does one do when they have to _debug_ some code that was written with these lovely Unicode ops, all while stuck in an ASCII world? That's why I suggested a standard script for Unicode2Asc

Re: The Sort Problem (was: well, The Sort Problem)

2004-02-13 Thread Rod Adams
Here's my stab at a sort syntax, pulling syntax over from REs: @out <== sort key:ri($_->[2]), key:s($_->[4]) <== @in; Basicly, you have a list of RE syntax like C values, whilch take various modifiers to say how to play with that key, and then an expr on how to generate the key given element $

Re: The Sort Problem

2004-02-14 Thread Rod Adams
generate a sortkey. Albeit considerably rare. Also, I think there is utility in have a compare sub supported so that: 1) porting P5 code is easier. (a minor design rationale, but it exists) 2) people used to thinking in terms of compare subs (from C, P5, and points of the programming universe) can still think that way. 3) most importantly to me, so that There's More Than One Way to Do It. -- Rod Adams

Re: The Sort Problem

2004-02-16 Thread Rod Adams
::= Code(Any, Any) returns Int; become type Comparator ::= Code(Any, Any) returns Int | '!' Code(Any, Any) returns Int; where the '!' sets the reverse/descending trait? So we could get things like: @out = sort {!~ $_} @in; @out = sort {!+ -M} @in; @out = sort {! &complex} @in; Overall, Damian's proposal looks very good. Yeah Damian! -- Rod Adams PS -- Only pure and utter insanity would lead someone to not make string the default sort comparator, and I don't think I've heard anyone here mention they are in favor of doing anything else.

Re: Exegesis 7: Fill Justification

2004-03-01 Thread Rod Adams
Damian Conway wrote: Richard Nuttall suggested: An alternative is to have "fill rightmost gaps" and "fill leftmost gaps" on alternate lines. This produces more balanced looking columns, so they don't all look heavier on the left. That's a *very* interesting idea. What do people think? The Ve

Re: Compile-time undefined sub detection

2004-03-05 Thread Rod Adams
Larry Wall wrote: On Fri, Mar 05, 2004 at 06:45:58PM -, Rafael Garcia-Suarez wrote: : Of course :) the main problem is not that CHECK blocks are executed : late (just at the end of the compilation phase); it's that they're : executed too early, notably in some persistent environment, notably :

A12: Single Dispatch over Mult Dispatch

2004-04-23 Thread Rod Adams
mizer. Or more likely, makes MMD optimization a lot more important. But that's a p6i problem, not a p6l one. Another way to interpret this post is "When is SMD preferred over MMD? And is that enough to make it the default?" If I'm missing something basic feel free to correct me. -- Rod Adams

Re: Compatibility with perl 5

2004-04-26 Thread Rod Adams
Larry Wall wrote: In general it's probably a lousy idea to rely on #!/usr/bin/perl6 to select language since you want the version number to select the version of Parrot you're running, not the version of Perl. One thing that occurred to me over the weekend is that we could fix all the one-liners u

Re: RFC eq and ==

2004-05-17 Thread Rod Adams
Luke Palmer wrote: Admittedly, if you use == for everything, you can force string or numeric comparison this way: if +$a == +$b {...} # numeric if ~$a == ~$b {...} # string Hmm. In my head, I would expect == to have implicit numification on the operands (unless user-overloaded to some

Re: RFC eq and ==

2004-05-17 Thread Rod Adams
Luke Palmer wrote: Oh, sorry, wasn't clear. That's *if* eq was eliminated and == became a polymorphic operator. You're correct in terms of the current (and hopefully continuing) state of things. Went back and re-read your first post, and that is indeed what you were saying, I just read it too

Re: FW: Periodic Table of the Operators

2004-05-30 Thread Rod Adams
Smylers wrote: Gabriel Ebner writes: Joe Gottman wrote: The zip operator is now the Yen sign (¥). How are those without a US keyboard supposed to type this? On Windows you can probably press Alt Gr then type in some number. Close. AltGr-Minus. If you're using the US-Interna

Re: FW: Periodic Table of the Operators

2004-06-13 Thread Rod Adams
s. If, however, you remap your keyboard (easily doable in X and Win32, I'd assume Macs can as well), then the common Unicode characters are an AltGr away. Thus, « one shifted keystroke (AltGr-[), << is two shifted keystrokes (Shift-, Shift-,). -- Rod Adams

Slices

2004-06-24 Thread Rod Adams
Come the glorious age of Perl6, will hash slices be enhanced to allow things like the following? [EMAIL PROTECTED]'expected'} = [EMAIL PROTECTED]; Specifically, having the slice be something other than the last element. This likely dictates having {} be able access a list of of hashrefs, not jus

Re: undo()?

2004-07-01 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: David Storrs wrote: Well, at least that's a nice simple explanation. Why couldn't anyone have explained it to me that way before? Unfortunately, it means that continuations are a lot less useful than I thought they were. :< Actually, I think you're underestimatin

Re: undo()?

2004-07-01 Thread Rod Adams
Austin Hastings wrote: --- Rod Adams <[EMAIL PROTECTED]> wrote: A guess from my current understanding: You're wanting to play with a database. You take a continuation. You see if have a database handle open and good to go, if so you do your thing. (can you then dismiss the conti

Re: Why do users need FileHandles?

2004-07-18 Thread Rod Adams
txt" :excl ); Not that having wrapper classes for file handles is a bad idea, it just doesn't relate to what I saw being discussed. Oh, and "TextFile" should be spelled "IO::File::Text", IMHO. -- Rod Adams

Re: Why do users need FileHandles?

2004-07-18 Thread Rod Adams
Dave Whipp wrote: "Rod Adams" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Uhm, my impression was that most of the "huffmanization" discussion was centered around declaring a file handle to be read only, write only, read-write, exclusive, etc. Masking

Re: Why do users need FileHandles?

2004-07-19 Thread Rod Adams
s available to open as arguements seems a much better idea to me. It's "Open a file with these specifications", not "Open a file, and then apply these specifications to it". I do admit there is merit to your abstraction system, but IMO, it belongs in a library. -- Rod Adams

Re: Why do users need FileHandles?

2004-07-19 Thread Rod Adams
Austin Hastings wrote: --- Rod Adams <[EMAIL PROTECTED]> wrote: I think part of the "mental jam" (at least with me), is that the read/write, exclusive, etc, are very critical to the act of opening the file, not only an after the fact restriction on what I can do later. Bu

Re: Progressively Overhauling Documentation

2004-08-23 Thread Rod Adams
at to foo up."), Quux::Xyzzy $xyzzy :doc("Xyzzy to foo bar with"), +$verbose, +$foo } returns Array | undef { # real code here } -- Rod Adams

Pipeline Performance

2004-08-30 Thread Rod Adams
;d want to be able to construct my own map like functions, and have creating them with pipeline performance in mind to be easy. Just a thought, since with the creation of ==> and <==, pipelining is bound to become an even more common construct. -- Rod Adams Randy Sims's test case:

Re: Pipeline Performance

2004-08-31 Thread Rod Adams
Aaron Sherman wrote: On Mon, 2004-08-30 at 16:34, Rod Adams wrote: @x = @y ==> map lc ==> grep length == 4; I would think you actually want to be able to define grep, map, et al. in terms of the mechanism for unraveling, and just let the optimizer collapse the entire pipeline dow

Re: Synopsis 9 draft 1

2004-09-03 Thread Rod Adams
Larry Wall wrote: On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote: : What happens when the Pascal programmer declares : : my int @ints is shape(-10..10); : : Does it blow up? No. : If not, does @ints[-1] mean the element with index -1 or the last element? The element with ind

Re: parameter contexts (was: Synopsis 9 draft 1)

2004-09-03 Thread Rod Adams
Larry Wall wrote: I'm still thinking A is the first one and Z is the last one. Someone talk me out of it quick. I had thought about A and Z before my previous post. I dismissed it for two reasons: 1) Using Alphas as an index for something that should be numeric can be very confusing. Especially

Re: Pipeline Performance

2004-09-18 Thread Rod Adams
Luke Palmer wrote: Jonadab the Unsightly One writes: Rod Adams <[EMAIL PROTECTED]> writes: One solution I see to this would be to have a "lazy return" of some kind, where you can send out what results you have so far, but not commit that your execution is over and sti

Re: S5 updated

2004-09-21 Thread Rod Adams
for it, though I suspect it may be lacking in the Impatience department. (I need more sleep) -- Rod Adams

Re: S5 updated

2004-09-24 Thread Rod Adams
e "Core support" needed would already be there (I may be wrong.). But it doesn't need to be core. A friendly side project, possibly mentioned in the core documentation as a learning tool, would do the job nicely. And it doesn't need to be discussed on p6i, p6l, or p6c, at least not for a very long time. Or we could just burn a RE parser into everyone's brain, as you mentioned. That'd also work. -- Rod Adams

S10/11 Questions

2004-11-09 Thread Rod Adams
had massively distributed mod_perl servers, where all the code past a simple stub was stored in a central RDBMS. Made releases and version control much nicer. - By saying #!/usr/bin/perl6 forces Perl 6, I assume you mean : "The compiler sees /:i ^#! .* perl6/ on the first line". - -- Rod Adams

Re: S10/11 Questions

2004-11-10 Thread Rod Adams
Larry Wall wrote: On Tue, Nov 09, 2004 at 09:18:47PM -0600, Rod Adams wrote: : Can we get an AUTOCLASS/AUTOCLASSDEF hook pair? Considering a class is just a variable in another symbol table, seems like an AUTOVAR in the container might cover it. I guess I don't understand enough of how

Re: can gather/take have multiple bins

2004-11-25 Thread Rod Adams
d a lazy list? I think it's better to leave a 1::1 gather::list ratio, as that will cover some {insert randomly high %age} of all cases. For the other cases, you're likely better off building a class with two emitter methods, and possibly even use C to make it look like two lazy lists.

Hyper Here-Docs? (was: Re: angle quotes for here-docs ?)

2004-11-25 Thread Rod Adams
g looks like Perl code, or if you have different < btw, should it be »<<, <<«, or »<<«? -- Rod Adams

Re: Angle quotes and pointy brackets and heredocs

2004-11-28 Thread Rod Adams
P6REs, much to the chagrin of those of us who parse html on a regular basis, using them as such in the rest of P6 makes sense as well. Parsing should not be hindered since one would occur in operator context, and the other in expression context. -- Rod Adams

Re: Angle quotes and pointy brackets

2004-11-30 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: I like this in general. However... Larry Wall <[EMAIL PROTECTED]> wrote: * Since we already stole angles from iterators, «$fh» is not how you make iterators iterate. Instead we use $fh.fetch (or whatever) in scalar context, and $fh.fetch or @$fh

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Rod Adams
if( $a<$b && $c<$d ) {...} if( $a < $b && $c < $d ) {...} In line2, my mind has to stop and ask: is that "($a < $b) && ($c < $d)", or "$a < ($b && $c) < $d". It quickly comes to the right answer, but the question never comes up in the first line. If I wanted to use more parens for clarity, I'd use LISP. -- Rod Adams

Re: pull & put (Was: Angle quotes and pointy brackets)

2004-12-04 Thread Rod Adams
C in standard implementations. So C and C? yeck. -- Rod Adams

Required whitespace issues.

2004-12-04 Thread Rod Adams
Alexey Trofimenko wrote: On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams <[EMAIL PROTECTED]> wrote: Okay, this rant is more about the \s<\s than \s=\s. To me, it is easier to understand the grouping of line 1 than line 2 below: if( $a<$b && $c<$d ) {...} if( $a < $b &

Re: Required whitespace issues.

2004-12-04 Thread Rod Adams
Larry Wall wrote: On Sat, Dec 04, 2004 at 08:14:17PM -0600, Rod Adams wrote: : In fact, unary = imposes whitespace requirements on all ops that end in =. Not true. I guess not all cases. But several do in certain situations. $x ==<$foo>; # $x == <$foo>; $x = =<$foo>; @

Re: Required whitespace issues.

2004-12-05 Thread Rod Adams
Larry Wall wrote: <>On Sat, Dec 04, 2004 at 08:55:00PM -0600, Rod Adams wrote: : $x ==<$foo>; # $x == <$foo>; $x = =<$foo>; : @x <==<$foo>; # @x <= =<$foo>; @x <== <$foo>; : $x//=<$foo>; # $x // =<$foo>; $x //= <$foo>; : [EMAI

Re: pull & put (Was: Angle quotes and pointy brackets)

2004-12-06 Thread Rod Adams
but. For reference, I always have to do a 'perldoc perlvar' when I need a P5 $. -- Rod Adams

Auto My?

2004-12-18 Thread Rod Adams
Considering that "proper" and common usage, not to mention strictures, dictates a heavy insistence on 'my'. I will thus assume that creation of lexical variables with 'my' far out numbers the creation of package space globals. Should we not then have it where it's the default behavior, and crea

Re: Auto My?

2004-12-19 Thread Rod Adams
: bit @bits; int @ints; num @nums; int4 @nybbles; str @buffers; ref[Array] @ragged2d; complex128 @longdoublecomplex; Given that most of the stated reservations had to deal with explicit declaration better defining scope, what is wrong with drooping the my in this case? -- Rod Adams

Re: = vs <== [was: Perl 6 Summary for 2005-01-31 through 2004-02-8]

2005-02-09 Thread Rod Adams
, attempting to bring less monkish fellows up to enlightenment often encounters mental blocks. This might help, having a different syntax makes it significantly less 'magical'. (even though Magic is Good, imho) I should probably stop rambling now and get some sleep. -- Rod Adams

Pop a Hash?

2005-02-09 Thread Rod Adams
< each >>, except, of course, that it deletes the pair at the same time. If we do that, I'd also want to be able to push %x, %y; which would mean something like: %x{%y.keys} <== %y{%y.keys}; but be much easier to read. -- Rod Adams. (And now I'm really off to bed.)

Re: Fwd: Junctive puzzles.

2005-02-10 Thread Rod Adams
rays should be more than sufficient for editing junctions. -- Rod Adams

Sets vs Junctions (was Junctive puzzles.)

2005-02-10 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: The overall impression I'm getting here is that we need some syntax for saying: $x = any(1..1000) such_that is_prime($x); In standard Perl 6 that'd be: $x = any(grep {is_prime $^x} 1..1000); or, if you prefer your constraints postfixed: $x

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Rod Adams
Patrick R. Michaud wrote: On Sat, Feb 12, 2005 at 03:49:02AM -0600, Jonathan Scott Duff wrote: On Sat, Feb 12, 2005 at 01:03:26AM -0600, Rod Adams wrote: I also find the following incredibly disturbing: perl6 -e "$x = 'cat'|'dog'; say $x;" do

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Rod Adams
Patrick R. Michaud wrote: On Sat, Feb 12, 2005 at 12:41:19AM -0600, Rod Adams wrote: Of course we'll always have C. But this is Perl, and I want YAWTDI. After all, another way to test membership was just added, whereas before you pretty much just had C. ...another way to test membe

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Rod Adams
Patrick R. Michaud wrote: On Sat, Feb 12, 2005 at 01:18:53PM -0600, Rod Adams wrote: My issue is less that lists and sets are radically different. It is much more a matter of Junctions and Scalars are radically different. Getting me to accept that a Scalar holds several different values at once

Re: Fun with junctions (was Sets vs Junctions)

2005-02-11 Thread Rod Adams
somewhat inefficient?) is_prime test for $bar if is_factor(none(2..sqrt($bar)), $bar) { say "$bar is prime"; } But what happens when you try to escape the boolean context? I'll reiterate my autothreading concerns above. And in these, you still have to do something completely different to determine what the factors are. Sometimes a short loop is a good thing. btw, in my set notation, you get: @bar * {is_factor($^a, $foo)} -- Rod Adams

Re: Fun with junctions (was Sets vs Junctions)

2005-02-11 Thread Rod Adams
Patrick R. Michaud wrote: Rod Adams wrote: I would argue that this sort of relational comparison is of limited usefulness. Well, except junctions hold more information than the simple comparisons I've given here. For example, a junction can have a value like: $x = ($a &

Re: Fun with junctions (was Sets vs Junctions)

2005-02-11 Thread Rod Adams
tion hold values of completely different types, or just different values of the same type? If evaluation of one value of a junction causes an error, is $! now a junction as well? -- Rod Adams

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: I also find the following incredibly disturbing: >perl6 -e "$x = 'cat'|'dog'; say $x;" dog cat That would be disturbing if that's what happened. C is just a shorthand for C. So saying a junction is the same as printing

Containers vs Objects.

2005-02-15 Thread Rod Adams
es. So I'm interested in hearing what pushes Arrays and Hashes over the edge for needing their own container and sigil, whereas Junctions/Sets do not. -- Rod Adams

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Rod Adams
Damian Conway wrote: >Rod Adams wrote: > >> However, what if what you're calling a non-Perl Parrot based function? >> Do we disable junctions from playing with non-PurePerl functions? Or do >> we autothread over them? How do we tell if a non-Perl function outputs &g

Re: Containers vs Objects.

2005-02-15 Thread Rod Adams
At 01:04 PM 2/15/2005 -0800, chromatic wrote: On Tue, 2005-02-15 at 14:26 -0600, Rod Adams wrote: > So I'm interested in hearing what pushes Arrays and Hashes over the edge > for needing their own container and sigil, whereas Junctions/Sets do not. Perl isn't a "pure" ob

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Rod Adams
e was different from yours in almost every respect. You put limits on unsuspectedly storing a junction in a scalar. I made a new place to put them. -- Rod Adams

Re: Containers vs Objects.

2005-02-15 Thread Rod Adams
e a relatively easy way to create a user-defined class with it's own sigil? (w/o having to modify half the parse rules). -- Rod Adams

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Rod Adams
Patrick R. Michaud wrote: On Tue, Feb 15, 2005 at 03:07:53PM -0600, Rod Adams wrote: I see it this way: When perl sees a function call, and one of the arguments is a junction, there are three basic options: 1) If the junction is wrapped up in some larger container, like a slurpy list, pass it

Junction Values

2005-02-15 Thread Rod Adams
$a,$b),any($c,$d)) == any($a,$b,$c,$d) all($a, $a) == $a all($a,$a,$b) == all($a,$b) all(all($a,$b),any($c,$d)) == all($a,$b,$c,$d) none($a, $a) == undef none($a,$a,$b) == none($a,$b) none(none($a,$b),none($c,$d)) == none($a,$b,$c,$d) one($a, $a) == false one($a,$a,$b) == ($a == $b ?? undef :: $b) -- Rod Adams

Re: Junction Values

2005-02-15 Thread Rod Adams
It's just a real pain to type chars that are not bound on your keyboard. As for the undef's, I didn't know what else to call the empty junctive. -- Rod Adams

Re: Junction Values

2005-02-15 Thread Rod Adams
implify a junction, by removing the nestedness of it, or removing terms outright. In the process, I'm making sure that I understand what they mean. -- Rod Adams

Re: Containers vs Objects.

2005-02-15 Thread Rod Adams
e, and each of them has a very limited number of values it can possess. Not any noun taking on the value of any two or more other nouns at once. 2) it is almost never in question that only one meaning was meant, and the other meaning was merely a cover, to prevent a faux-pas. -- Rod Adams

Re: Junction Values

2005-02-16 Thread Rod Adams
=$b or $x==$c or $x==$d) { ... } The rest of the invention feels like "Magic", and is something the experienced will tell the inexperienced not to mess with until they really understand the consequences of using them. And even then, few of the experienced will make more use of it than the simple case. -- Rod Adams

Re: Junction Values

2005-02-16 Thread Rod Adams
Larry Wall wrote: That, and we'd like a novice to be able to write given $x { when 1 | 2 | 3 {...} when 4 | 5 | 6 {...} } Or just change C to accept a list of things to compare against, followed by a coderef. -- Rod Adams

Re: Junction Values

2005-02-17 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Rod Adams <[EMAIL PROTECTED]> wrote: Larry Wall wrote: That, and we'd like a novice to be able to write given $x { when 1 | 2 | 3 {...} when 4 | 5 | 6 {...} } Or just change C to accept a list of things to compare against,

Re: Junction Values

2005-02-17 Thread Rod Adams
Larry Wall wrote: On Thu, Feb 17, 2005 at 02:18:55AM -0600, Rod Adams wrote: : The simple if is: : : if $x ~~ (1,2,3,4) {...} # parens needed here since , is lower than ~~ : in precedence. That is asking if $x is a list containing 1,2,3,4. Quoting S04: $_ $xType of Match

Re: Junction Values

2005-02-18 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Rod Adams <[EMAIL PROTECTED]> wrote: Larry Wall wrote: Junctions can short circuit when they feel like it, and might in some cases do a better job of picking the evaluation order than a human. I was afraid someone was going to say that

Re: Junction Values

2005-02-18 Thread Rod Adams
mention, you've already defined P6 to be good at this multi-sub/method game, so take advantage of it. It's not like this table will be represented all in one function (at least I hope not) -- Rod Adams

Re: Junction Values

2005-02-18 Thread Rod Adams
Luke Palmer wrote: Rod Adams writes: Junctions are intended to be used mainly within conditionals and other statements; If the set of these "other statements" is limited, consider creating a Junction class (which needs a "use Junction;" to activate), which o

Re: Junction Values

2005-02-18 Thread Rod Adams
Jonathan Scott Duff wrote: On Fri, Feb 18, 2005 at 12:42:31PM -0600, Rod Adams wrote: No, but nor does it have a concept quite like a variable. Which significantly weakens the "mapping naturally to human linguistic structures" argument, IMO. Why exactly? It's ju

Re: Junction Values

2005-02-18 Thread Rod Adams
throw an exception. But that's likely not what this discussion is about. In the terms of junctions as defined, I expect that it would stop at the lowest value of $x greater than or equal to 4. Unless we start allowing junctive lists as well as junctive scalars... -- Rod Adams.

Re: Junction Values

2005-02-18 Thread Rod Adams
gt;, I'd say that it should handle junctions being fed into it by throwing an exception. -- Rod Adams

Re: Junction Values

2005-02-18 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Rod Adams <[EMAIL PROTECTED]> wrote: Luke Palmer wrote: 2..sqrt($x) What the hell does that mean? Do you get a junction of lists out? Or does sqrt die because it's not expecting a junction? What on earth does C< for (2..sqr

Re: Junction Values

2005-02-18 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Rod Adams <[EMAIL PROTECTED]> wrote: if $x == 3|4|5|6 {...} would thread over infix:<==> without any funkiness, since we'll assume operators are well written, and can take junctions as parameters, same as: if is_prime(3|

Re: Junction Values

2005-02-19 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Rod Adams <[EMAIL PROTECTED]> wrote: The caller is not in a position to know if the callee is internally structured in such a way that passing in a raw junction makes sense. Sure they are. It's called reading the documentation. If

Re: Junction Values

2005-02-19 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: All I want now is for autothreading to be explicit. It already *is*. The only way that: is_prime($x) can ever autothread is if $x holds a junction. But that can now only happen if there's an explicit C in scope where $x was assigned to (or the exp

Re: Junction Values

2005-02-19 Thread Rod Adams
ue to the side effects such behavior can generate. To keep the power of junctions viable, explicit threading should be trivially easy, but it should be explicit, none the less. -- Rod Adams

Lingering questions about Junctions.

2005-02-19 Thread Rod Adams
any(1,6), all(2,5), one(3,4); @x = @x.sort; Does sort() carp on junctions, or is it just one of the weird things you have to live with if you're playing with junctions? -- Rod Adams

Re: Junction Values

2005-02-19 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: Is this new, or yet another important detail I missed along the way? Or is this a side effect of not being able to store a Junction, and can go away if C< use Junctions > is turned on? Yes, it's a side-effect of the new default prohibition

Re: Junction Values

2005-02-19 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: I never want to see implicit threading. Ever. If this is the only stumbling block, then it's easily solved. Instead of ruining junctions by imposing all kinds of complex and annoying hoops and hurdles (i.e. C and C), we can just offer a C pragma

Re: Junction Values

2005-02-20 Thread Rod Adams
The ability to join several RE's together, into something that still acts like a single RE. Show me the equivalent code without junctions, and then we'll compare the power of junctions. btw, the examples above assume the ability to store a junction. So you either have to 'use junctions;', or convince Larry to rescind that restriction. HTH. -- Rod Adams

Re: Junction Values

2005-02-20 Thread Rod Adams
Damian Conway wrote: Rod Adams asked: > This sound reasonable enough? Frankly, no. ;-) Sorry, but your latest proposal sounds complex, multiply special-cased, and way too much of an imposition on the programmer (which is specifically what junctions are supposed to avoid). Funny. I thought it

Re: Junction Values

2005-02-20 Thread Rod Adams
Eirik Berg Hanssen wrote: Rod Adams <[EMAIL PROTECTED]> writes: $re1 = /^ <-[x]>* x <-[x]>* $/; # match a string with exactly one 'x' in it. $re2 = /^ <-[y]>* y <-[y]>* $/; # ditto 'y' $re3 = /^ <-[z]>* z <-[z]>* $/; #

Junctions, Sets, and Threading.

2005-02-22 Thread Rod Adams
was the big revelation I had the other night. The rest of this was the logical consequence spawned off that single thought to make it a complete idea. I think that overall in this process I've done the following: - Kept the real power of Junctions intact. - Provided fairly strong protection for newbies, without sacrificing power. - Kept Nasty surprises to a minimum. - Got rid of the need for "half on" features. - Provided back any power that the Prime Rule removed through sets and expanded hyper ops. -- Rod Adams

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: > The purpose of a junction is to allow for performing several tests at a > given time, with the testing code needing no knowledge of that junctions > are present. While a junction can represent several values at the same > time, such notions a

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: This is my major point of the post. In my opinion, your example of: # Print a list of substrings... my $substring = substr("junctions", any(1..3), any(3..6)); say $substring.values(); Is a perfect example of a place where saying: # Print

Re: scoping functions as list operators?

2005-02-24 Thread Rod Adams
Luke Palmer wrote: We have discussed making equals low precedence enough to eliminate the parentheses in the standard swap: $x, $y = $y, $x; $x, $y <== $y, $x; -- Rod Adams

Re: scoping functions as list operators?

2005-02-24 Thread Rod Adams
cratching their heads. (assuming that doesn't trigger a warning/error). Overall, I like the protection it provides, but dislike the extra three keystrokes it means for something I use so often. -- Rod Adams

Re: scoping functions as list operators?

2005-02-24 Thread Rod Adams
We should instead have a list attribute, so we can say: $x, $y, $z are mine! mine! mine!; (Must be spoken like a three year old when read.) -- Rod Adams

Re: Q: Junctions & send+more=money

2005-02-26 Thread Rod Adams
tent values as those inconsistencies are found. Most of them (all except all()) do not have to use the same value each time they are evaluated. If I'm wrong about this interpretation of this code, I apologize. But it certainly fits my understanding of junctions, which has grown by leaps and bounds over the last few weeks. HTH, -- Rod Adams

  1   2   3   >