Re: What will the Perl6 code name be?
What about Hexane? Arthropod (or some insect)? These do habve meaning, Hexane is a six carbon hydocarbon. Anthropods(esp. insects) have six legs... perl object-oriented language horrible! a) you're using an acronym within an acronym: Practical Extraction and Report Language Object-Oriented Language which should then be PERLOOL b) It's not object oriente, it allows object oriented syntax, but it is not OO. -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Sweetmorn, the 4th of The Aftermath, in the YOLD 3166: "A pessimist is a man who looks both ways when he's crossing a one-way street."
RE: renaming local to hold
How about: scratch #doesn't really imply what it's doing overload#accurate, kinda long though some might say this is good dup/duplicate #nasty for the compiler, and perhaps for the newbies, #but dup'ing var's makes sense, esp. from the C stance clone/mycopy#(like filehandles with flags) -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Sweetmorn, the 4th of The Aftermath, in the YOLD 3166: "A pessimist is a man who looks both ways when he's crossing a one-way street."
Re: What will the Perl6 code name be?
Perl, which allows object oriented syntax, written in C++ language, ^^ Did I miss something, or did the world go *totally* gaga overnight? I think he's referring to Topaz. All together now: Topaz is dead, Topaz never was (public). -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Sweetmorn, the 4th of The Aftermath, in the YOLD 3166: "A pessimist is a man who looks both ways when he's crossing a one-way street."
Re: What will the Perl6 code name be?
How about the traditional birthstone for the 6th month (June)? That would be Alexandrite. This has the added advantage of being named after Tsar Alexander I, who, like Perl, was ruler over a vast domain. Ha ha ha, obscure pun http://www.birthstones.com/stone_jun.html However come perl 7 (if Larry's RFC for 2*PI were broken) that would be Ruby, which might cause some confusion since their is a language called ruby that professes to be Perl-like. http://freshmeat.net/projects/ruby/?highlight=ruby What about Hexane? Arthropod (or some insect)? -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Pungenday, the 1st of The Aftermath, in the YOLD 3166: "Bite the wax tadpole." --Coca-Cola as originally translated into Chinese
Re: RFC 333 (v1) Add Cheader and Cunheader funtions to core distribution
Personally I think this is probably a bad idea. But if such a thing WERE to be implemented, I don't see why you have to have two words... header(a1, b=2); #options list, returns a string with formatted headers header($foo); #scalar option $foo is parsed and a list is returned #(for assignment to a hash most likley) header(); #implied scalar option $_, if this is a hash reference, #header acts in the format sense... else parse header(header(a=1, b=2)); #essentially a NOOP PS un is such a lame prefix and very un perl like... unjoin? unpush? okay so unshift, but still... hey wait I want undelete! -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Sweetmorn, the 52nd of Bureaucracy, in the YOLD 3166: No civilized person ever goes to bed the same day he gets up
Re: Perl6Storm: Intent to RFC #0101
You suggested: file($file, 'w'); # is it writeable? Not that I'm advocating it but you do something like: test($file, WRITEABLE); test($file, WRITEABLE READABLE); ... where constants are defined for various "attributes" to be tested for... Currently 23, or 3 bytes... (not that it matters ;-) This seems rather readable and less (name-space) cluttery, and if it suits you it could be named ftest or somesuch... Hell you could even make it magical and allow the -X switched enlieu of constants... Where use English would be required to get the constants. -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Setting Orange, the 51st of Bureaucracy, in the YOLD 3166: No, just the nipple-cones, officer, just the nipple-cones.
Re: RFC 226 (v2) Selective interpolation in single quotish context.
What's wrong with extending current syntax such that: $a = "Hello"; print q(@{[$a]} World), "\n"; outputs Hello World instead of @{[$a]} World yes, it's a few extra char's but IMHO it's a logical extension it makes you think twice before doing it, do you really need to do this, or is there a smarter way? -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Boomtime, the 38th of Bureaucracy, in the YOLD 3166: "Are you calling me crackers? Are you saying I'm a large, sodium-covered square, here to nourish you?" --Goodfeathers,Animaniacs
Re: RFC 226 (v2) Selective interpolation in single quotish context.
Oh yeah I forget to outline what it currently does for those whom may not have seen it... It's usally used for evaluation and interplation of code/subroutines in "", qq() and HERE. And of course works fine on hashes, scalars, and arrays. So it's simply changing perl to check for this in q(). not add a whole other set of tags and meaning... -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Boomtime, the 38th of Bureaucracy, in the YOLD 3166: "Are you calling me crackers? Are you saying I'm a large, sodium-covered square, here to nourish you?" --Goodfeathers,Animaniacs
Re: $a in @b
Pardon my repetitiousness, but I'm puzzled at the total lack of response AFAICS to my proposal for a second argument to next/last/redo. Was it so stupendously moronic as to be beneath anyone's dignity to rebut, or what? Either I'm out of it, or it looks a whole lot more appealing than a new keyword. IMHO THAT (two args) would be overkill. These are operators, simple flow control words that also make the source very easy to read. i really can;t see adding a second arg because ythen you're going to have to do stuff like next undef, 1 etc. which is wholly unappetizing. The only way I myself see extending current words is to use some special label name. not that that is very nice... Only if this special name perhaps contained a character which is not valid in a label... (are there any? [:*] ?) I personally like the idea of somehting like feign (or whatever it's called), nice and generic. But if not that and not 2 arg next etc. And I may have missed this thread if someone hit upon it, but what's wrong with allowing something like grep ITEM: { /^[1-9]/ || next ITEM } @list; -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Prickle-Prickle, the 35th of Bureaucracy, in the YOLD 3166: Were that I say, pancakes? --JP
[OT} Universal shell configuration
It's called meta shell ftp://www.guug.de/pub/members/truemper/metash -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Setting Orange, the 26th of Bureaucracy, in the YOLD 3166: Learnin' to fly but I ain't got wings. Comin' down is the hardest thing...
Re: Proposal: use Perl5
Since everyone seems intent on breaking backward compatibility I don't think this is at all true, but I also don't think the overall you seem to have ignored the paranthetical clause idea of a Perl5 module is necessarily a bad one. However, my hope would be that we do Perl 6 smoothly enough and get the docs written well enough to make it fairly obvious what has changed and That would be my hope too, but as I mentioned, it is seeming somewhat unlikely. bad. My fear would be once people start using this, they lose sight of what's changed, and every Perl 6 script starts with a 'use Perl5' "just in case". a) It's not out place to say what people should and should not do, merely to provide the capabilities b) That is not what it is intended for. What I envision it for is somehting like: I have a buttload of legacy scripts. I just upgraded to RedHat n. It ships with Perl 6, great! But wait Perl 6 doesn't play nice. So I just change #!/usr/bin/perl to #!/usr/bin/perl -MPerl5 or the equivalent, and voila! No more tears. Regardless, I *don't* think this should go in there. Some things *need* to look different if people are going to realize they're different. Bareword filehandles should be replaced with first-class $fileobjects (finally!). A 'use Perl5' that changes this would be doing the programmer a great disservice. See above. Instead, Perl 6 should print out a warning like: A Cwanting or a Cdie? Warnings are fine, people will just keep using what they want... $/ If this went away, it would probably be for such a fundamental reason that keeping $/ and $\ around in any form would be a Very Bad Idea. So again, if we ditch this one, we should just ditch it. Plus, keep in mind that some things are rough 1:1 swaps, like date() for localtime(). Keep in the mind that this is not INTENDED to prevent programmers from using new abilities, but simply to provide a high-level of compatibility for legacy code. Hey! This is Perl 6! It's not Perl 5, deal. But it's cool, check the docs. Which is exactly the kind of attitude I described at the beginning. (Only half-kidding...) Yes, I see the kidding partg. It's the half that bothers me... -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Pungenday, the 24th of Bureaucracy, in the YOLD 3166: Snoochie Boochie Noochies!
RE: RFC 176 (v1) subroutine / generic entity documentation
Wohoo! REBOL-isous sub foo : doc( EOS ) Function: Foo In:scalar - int - foo identifier Out:array - decomposed foo Effects: Queries Foo DB Exceptions: DBI, "bad foo id" EOS { And the liste alternatives really seem rather ugly though How about sub foo ($$,DOC) { } Since; currently; , is not used in proto-typing... Where DOC is any valid string sysntax, heredoc, a scalar, q(), even a function call. Though at first glance you might read that $, as $OFS Or, given named parameters you might even want something like: sub foo ( "Output"= * :'!! Opens in clobber mode.', "Input" = * :'Must be sorted', "The answer"= $ :'How many roads must a man walk?'; "Seed" =\@ :q(I should have known what fruit would spring from such a seed. --Lord Byron);; "General function info") { } -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Boomtime, the 23rd of Bureaucracy, in the YOLD 3166: Those students who have become one with the universe will be allowed to go on and become two with the universe.
Globs, (brrr) scalar filehandles, prototypes.
Not a huge issue, but I hadn't seen anyone else bring it up. If in fact: bareword filehandles are ditched globs are killed prototypes are potentially touched. perlsub sub myopen (*;$) myopen HANDLE, $name sub mypipe (**) mypipe READHANDLE, WRITEHANDLE You have things to consider: you make prototyping even more of a five-pound weakling, and provide no filehandle prototyping you preserve the current syntax, using what will in the future be an obscure syntax since globs are gone. (fun perl trivia) concoct a new magical incantation to represent filehandles Not fond of any of them myself, just something to think about -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Boomtime, the 23rd of Bureaucracy, in the YOLD 3166: Those students who have become one with the universe will be allowed to go on and become two with the universe.
Proposal: use Perl5
Since everyone seems intent on breaking backward compatibility (Okay, so no one is explicitly setting out to do so, it is merely often dismissed as a non-issue). How about an RFC be done proposing that perl6 ship with a module named Perl5. Which one can use to remedy most breakings between the two? Things it could do (based on current proposals): open BAREWORD support through overloading of open sub chop($) { chomp ($_[0] ? $_[0] : $_), "\n"; } glob... $/ (It's a valid variable, things just need to be overloaded to default to it) etc... And if $^W is set, it warns about non Perl5 syntax; multiple foreach variables, etc I know this would make me happier and more apt to submit to various attrocities ;-) Anyone else? -- #!/usr/bin/perl -nl BEGIN{($,,$0)=("\040",21);@F=(sub{tr[a-zA-Z][n-za-mN-ZA-M];print;}); $_="Gnxr 1-3 ng n gvzr, gur ynfg bar vf cbvfba.";{$F[0]};sub t{*t=sub{}; return if rand().5;$_="Vg'f abg lbhe ghea lrg, abj tb.";{$F[0]};$_=0;} sub v{print map sprintf('%c', 2**7-2**2),(1 .. $0);}v;}{$_++;$_--;$_||=4; if($_2||($_212)){$_="Vainyvq ragel";{$F[0]};last;}t;$0-=$_;$_="Lbh jva"; die({$F[0]}) if !($0-1);$0-=$0%2?$02?2:1:$0=5?$02?3:1:rand.5?1:3; $_="V jva";die({$F[0]}) if !($0-11);}v __END__ http://pthbb.org/ MOTD on Boomtime, the 23rd of Bureaucracy, in the YOLD 3166: Those students who have become one with the universe will be allowed to go on and become two with the universe.
Re: functions that deal with hash should be more liberal
In reply to your message from the not too distant future: next Monday AD Reply-to: [EMAIL PROTECTED] Return-receipt-to: [EMAIL PROTECTED] Organization: a) Discordia b) none c) what's that? Content-Typo: gibberish, charset=ascii-art Date: Tue, 22 Aug 2000 10:15:48 EDT From: Jerrad Pierce belg4mit So, you're saying to dispense with prototypes, even in the core, and leave us with the slowest language known to man? No and no. If you have internal prototypes, why can't it attempt a type conversion IFF you didn't satisfy the prototype. It's like doing math with strings, it checks to see if it really can use it as a number first... Why is this so hard? So the internals stay almost the same, but before resorting to die, you attempt a cast, if it works you warn that's inefficient under strict, and of course in the docs. If I occasionally want to be inefficient, I should have the license to do so. But I really don't think it'll be that less efficient, considering the alternative is to do the casting myself, which will almost certainly use more memory, and run slower than anything in the core. No? I don't see that flying. All it requires is forgetting to hit the ground. -- * __* . \ | / .. . . . ((_ _ . . . -- / \ -- .. . +. . _/\ oo. | * . . . * / ;M\_ . ..oo. . .. . /\. / :IMM\ ....oo. Jerrad Pierce /\ / \ / ;IIWMM ..oo... 209 North Street +/ \ / \ . / ;WM ...o... Randolph, MA 02368/ \ \ ___/ :;IWM oooo.../\\ / :: ;;IIIMI .ooo.http://www.pthbb.org /\ \ : :::;IIIM ..ooo __ || || ::.:: MOTD on Prickle-Prickle, the 15th of Bureaucracy, in the YOLD 3166: "God is too big for only one religion." -- A. Weysman
Re: functions that deal with hash should be more libera
In reply to your message from the not too distant future: next Tuesday AD Reply-to: [EMAIL PROTECTED] Return-receipt-to: [EMAIL PROTECTED] Organization: a) Discordia b) none c) what's that? Content-Typo: gibberish, charset=ascii-art Date: Tue, 22 Aug 2000 11:06:21 EDT From: Jerrad Pierce belg4mit It will show that you are doing what you *want* to do, not letting automagic error-blind spoofery behind the curtains flummux up your life unnecessarily. Umm no.. for what I *want* to do is take the keys of the hash returned as a list by a block. That's what I want. And yes I can do it with %{{}}. But it's hardly symmetrical to working with arrays, and definitely not obvious. Especially to a newbie, and even to lightly seasoned veterans. How is it error-blind? Someone proposed that it complain if the cast was performed on an odd-element list. But even that could be valid (the last key has undef as a value). And I proposed making strict catch this. What other errors might there be? Whatever happened to making easy things easy, out of the box? And if I want to be a masochist and have my code scrutinized like hell, using strict, -wT ? use strict 'hash'; no strict 'hash'; -- * __* . \ | / .. . . . ((_ _ . . . -- / \ -- .. . +. . _/\ oo. | * . . . * / ;M\_ . ..oo. . .. . /\. / :IMM\ ....oo. Jerrad Pierce /\ / \ / ;IIWMM ..oo... 209 North Street +/ \ / \ . / ;WM ...o... Randolph, MA 02368/ \ \ ___/ :;IWM oooo.../\\ / :: ;;IIIMI .ooo.http://www.pthbb.org /\ \ : :::;IIIM ..ooo __ || || ::.:: MOTD on Prickle-Prickle, the 15th of Bureaucracy, in the YOLD 3166: "God is too big for only one religion." -- A. Weysman
Re: functions that deal with hash should be more liberal
In reply to your message from the not too distant future: next Tuesday AD Reply-to: [EMAIL PROTECTED] Organization: a) Discordia b) none c) what's that? Content-Typo: gibberish, charset=ascii-art Date: Tue, 22 Aug 2000 12:58:38 EDT From: Jerrad Pierce belg4mit I think you are still confused as to the difference between arrays and hashes, which are variables, and lists, which are not. Lists are what the CORE or a subroutine throw back at you. Arrays and hashes are user data structures. Often, arrays and lists can be treated similarly, if not the same. Not so hard to get. The assigment operator can do explicit list to array or hash conversion, I'm just proposing that there be the ability for an implicit conversion when calling a function with a list. Other than the issue of semantics (array is not list), I still have not seen: a) why this is the Wrong Thing b) while not the Wrong Thing, it should not be done. c) something to refute Do What I Mean -- * __* . \ | / .. . . . ((_ _ . . . -- / \ -- .. . +. . _/\ oo. | * . . . * / ;M\_ . ..oo. . .. . /\. / :IMM\ ....oo. Jerrad Pierce /\ / \ / ;IIWMM ..oo... 209 North Street +/ \ / \ . / ;WM ...o... Randolph, MA 02368/ \ \ ___/ :;IWM oooo.../\\ / :: ;;IIIMI .ooo.http://www.pthbb.org /\ \ : :::;IIIM ..ooo __ || || ::.:: MOTD on Prickle-Prickle, the 15th of Bureaucracy, in the YOLD 3166: "God is too big for only one religion." -- A. Weysman
Re: functions that deal with hash should be more liberal
In reply to your message from the not too distant future: next Tuesday AD Reply-to: [EMAIL PROTECTED] Return-receipt-to: [EMAIL PROTECTED] Organization: a) Discordia b) none c) what's that? Content-Typo: gibberish, charset=ascii-art Date: Tue, 22 Aug 2000 13:48:36 EDT From: Jerrad Pierce belg4mit $n = pop fn() you are just obfuscating writing $n = (fn())[-1]; yes It should not be done because it is wrong to lose compile-time type checking save under grave environmental stress, the likes Why are you losing checking? It would seem right now keys would first check to make sure it'll be getting *something* OR die then to make sure that that something is a hash OR die And all I said was replace the last OR die with: OR warn (if under strict|-w) AND cast at run-time If you gave it hash you short-circuit right out and have not lost any time. If it in fact is not a hash, you may get warning under strict or -w. of which you are yet to demonstrate. The burden of proof rests with you to show why to turn perl dumber. This is *not* making it dumber, the only way it would make it dumber is if you lost your test. But you don't have to lose your compile-time test... But that comes with similar attendant problems. What then should while ( ($k,$v) = each fn() ) {} do? How often should fn() be called there? And what if it returns a hash ref versus a list? What about a list of one hash ref? It should be called once, otherwise you would loop indefinitely. It should then pass every other value into $k and $v, while you iterate over the contents. For example: while ( ($k,$v) = each fn() ){ push @F, $k; push @G, $v; } not being dissimilar from @F = fn(); unzip(2, \@F) Comflating values with variables is not always sensible: consider 4++, for example; this isn't (old) FORTRAN. :-) Well that's a different issue, since that always evaluates to the same thing... -- * __* . \ | / .. . . . ((_ _ . . . -- / \ -- .. . +. . _/\ oo. | * . . . * / ;M\_ . ..oo. . .. . /\. / :IMM\ ....oo. Jerrad Pierce /\ / \ / ;IIWMM ..oo... 209 North Street +/ \ / \ . / ;WM ...o... Randolph, MA 02368/ \ \ ___/ :;IWM oooo.../\\ / :: ;;IIIMI .ooo.http://www.pthbb.org /\ \ : :::;IIIM ..ooo __ || || ::.:: MOTD on Prickle-Prickle, the 15th of Bureaucracy, in the YOLD 3166: "God is too big for only one religion." -- A. Weysman
Re: functions that deal with hash should be more libera
In reply to your message from the not too distant future: next Monday AD Reply-to: [EMAIL PROTECTED] Return-receipt-to: [EMAIL PROTECTED] Organization: a) Discordia b) none c) what's that? Content-Typo: gibberish, charset=ascii-art Date: Mon, 21 Aug 2000 19:04:27 EDT From: Jerrad Pierce belg4mit No. keys() expects something that starts with a %, not something that starts with a . That's lame though because I can do stuff like: print join(' ', splice(@{[1,2,3,4,5,6,7,8,9,0]}, 3, 3)); Unless perl is internally checking that splice is a CORE function and thusly deemed magical, (seems unlikely, bad and un-perl like), join will allow me to give it something that "starts with " And sub foo { return (1,2,3,4); }; print join(' ', foo); certainly seems to work. So bascially my point is: If a hash array function is handed a list, it should treat that list as though it is the hash or array it would like it to be. You know, that inherrent sense of Doing The Right Thing. -- * __* . \ | / .. . . . ((_ _ . . . -- / \ -- .. . +. . _/\ oo. | * . . . * / ;M\_ . ..oo. . .. . /\. / :IMM\ ..oooo..oo. Jerrad Pierce /\ / \ / ;IIWMM ..oo... 209 North Street +/ \ / \ . / ;WM ...o... Randolph, MA 02368/ \ \ ___/ :;IWM oooo.../\\ / :: ;;IIIMI .ooo.http://www.pthbb.org /\ \ : :::;IIIM ..ooo __ || || ::.:: MOTD on Pungenday, the 14th of Bureaucracy, in the YOLD 3166: ``How did it get so late so soon? It's night before it's afternoon. December is here before it's June. My goodness how the time has flewn. How did it get so late so soon?'' -Dr. Seuss
Re: Cchomp() changes.
This had bugged me too. But the solution I had arrived at is slightly different. What do you think? ($retval, $scalar) = chomp $scalar; or ($retval, @list) = chomp @list; In list mode chomp returns a list whose first element is the return value, the remainder being the modified value(s). In current scalar mode, chomp acts upon the value(s) *in place* and returns a value. Pro's: Breaks nothing Fairly intuitive. To make it more so, perhaps perlrun should place an emphasis upon list mode usage...? Ref [1]: http://tmtowtdi.perl.org/rfc/58.pod -- * __* . \ | / .. . . . ((_ _ . . . -- / \ -- .. . +. . _/\ oo. | * . . . * / ;M\_ . ..oo. . .. . /\. / :IMM\ ....oo. Jerrad Pierce /\ / \ / ;IIWMM ..oo... 209 North Street +/ \ / \ . / ;WM ...o... Randolph, MA 02368/ \ \ ___/ :;IWM oooo.../\\ / :: ;;IIIMI .ooo.http://www.pthbb.org /\ \ : :::;IIIM ..ooo __ || || ::.:: MOTD on Setting Orange, the 11st of Bureaucracy, in the YOLD 3166: This statement is false.
Re: RFC 109 (v1) Less line noise - let's get rid of @%
In reply to your message from the not too distant future: next Friday AD Reply-to: [EMAIL PROTECTED] Return-receipt-to: [EMAIL PROTECTED] Organization: a) Discordia b) none c) what's that? Content-Typo: gibberish, charset=ascii-art Date: Fri, 18 Aug 2000 14:47:44 EDT From: Jerrad Pierce belg4mit That's pretty damn nifty, too problems though: print SCALAR $hashref-{key}, "\n"; is bogus, SCALAR eats the newline as an argument. Granted this could be fixed with parens, but somehwat disappointing. In this context it's hard to tell if SCALAR is a handle or a function (again parens are the solution). I was unable to conceive of a way to allow the {}. You get a hash ref back, which when dereferenced %{} contains your reference. That, when dereferenced returns nothing. sub ARRAY { return @{ shift() }; } sub SCALAR { #my $ref = shift(); #if( ref($ref) eq "HASH" ){ #$ref = (each %{$ref})[0]; } #return ${ $ref }; return ${ shift() }; } $hashref = { scl=\value, ary=[1,2] }; print SCALAR $hashref-{scl}; print "\n"; print join(',', ARRAY $hashref-{ary}), "\n"; -- * __* . \ | / .. . . . ((_ _ . . . -- / \ -- .. . +. . _/\ oo. | * . . . * / ;M\_ . ..oo. . .. . /\. / :IMM\ ....oo. Jerrad Pierce /\ / \ / ;IIWMM ..oo... 209 North Street +/ \ / \ . / ;WM ...o... Randolph, MA 02368/ \ \ ___/ :;IWM oooo.../\\ / :: ;;IIIMI .ooo.http://www.pthbb.org /\ \ : :::;IIIM ..ooo __ || || ::.:: MOTD on Setting Orange, the 11st of Bureaucracy, in the YOLD 3166: This statement is false.