Re: Can I use my Perl5 .pm modules in Perl6?
On Wed, Jan 13, 2016 at 12:50:19PM -0800, ToddAndMargo wrote: > Hi All, > > I have written myself several Perl 5 modules (.pm). > Is there a way to call them from Perl6? Or should I > must I rewrite them? https://doc.perl6.org/language/faq#Can_I_use_Perl_5_modules_from_Perl_6%3F dha -- David H. Adler - <d...@pobox.com> - http://www.panix.com/~dha/ You're still hoping for a new, good Star Trek series??? You must be a Cubs fan. - Michael G. Schwern
Proposed doc for while/until
Note: Proposing to put this *above* repeat/while / repeat/until. https://gist.github.com/dha/0a0736b9da74a8e61e49 dha -- David H. Adler - <d...@pobox.com> - http://www.panix.com/~dha/ A feature is often a bug with seniority.- Chip Salzenberg
Re: Proposed docs for C
On Tue, Sep 15, 2015 at 11:28:59AM -0500, andy_b...@wiwb.uscourts.gov wrote: > [1 1 1 1] > next > [1 1 1 1 1 1] > next > [1 1 1 1 1 1 1 1] > > vs > > [1 2 3] > next > [1 2 3 3] > next > [1 2 3 3 3] > > I think the latter is clearer, though perhaps the problem is the original > code is a bit overly-contrived (I'm thinking ;-). It shows better the > variation after each call, maybe. my 2.00e-02 dollars worth. So, how about this perl6 -e 'sub a {state @x; @x.push(++$)}; say a for 1..6;' [1] [1 2] [1 2 3] [1 2 3 4] [1 2 3 4 5] [1 2 3 4 5 6] ? dha -- David H. Adler - <d...@pobox.com> - http://www.panix.com/~dha/ Pancakes is the better part of valor- Toothgnip
Re: Proposed docs for C
On Wed, Sep 16, 2015 at 04:42:27PM -0400, Parrot Raiser wrote: > On 9/16/15, David H. Adler <d...@pobox.com> wrote: > > > So, how about this > > > > perl6 -e 'sub a {state @x; @x.push(++$)}; say a for 1..6;' > > > > [1] > > [1 2] > > > > Even better, but how about 'for a..f'? That makes it clear that the > list values are being used, not some sort of subscript. (The less > ambiguity possible in an example, the better.) I like it. Thanks. dha -- David H. Adler - <d...@pobox.com> - http://www.panix.com/~dha/ There are 6 billion people in the world, and only 30 billion of those are Canadians - Headline in the Toronto Globe and Mail
Proposed docs for C
Maybe a bit long, but think it explains it in a way people will understand. Thoughts? https://gist.github.com/dha/8009c28d7bf2d1ca8875 dha -- David H. Adler - <d...@pobox.com> - http://www.panix.com/~dha/ I think the scale of relative badness is broken in this place. - Diablo
Re: Proposed docs for C
On Mon, Sep 14, 2015 at 03:13:21PM -0400, yary wrote: > Using different numbers for the examples helps visualize what's > initialized vs added later: ... > *[1 2 3]next[1 2 3 3]next[1 2 3 3 3]* I don't know. I think, by having it on separate lines, and watching the row of '1's extend, is less visually complicated and gets the point across more directly. [1 1 1 1] next [1 1 1 1 1 1] next [1 1 1 1 1 1 1 1] How strongly do people feel about this? dha -- David H. Adler - <d...@pobox.com> - http://www.panix.com/~dha/ Damn, if this doesn't win me "Pedant of the Year", I don't know what will.- Mark Rogaski
Suggestions on documentation for C and C
Well, the thing with C is more of a question... https://gist.github.com/dha/02f1f41b5f8937c0271e And for C some suggested documentation I'd like to get some extra eyes on before I commit. https://gist.github.com/dha/d8ab9b8cf852d358bfaf Thanks! dha -- David H. Adler - <d...@panix.com> - http://www.panix.com/~dha/ And, considering the prevalence of displaced psychiatric patients among the ranks of the homeless, the viewpoints are usually guaranteed to involve aliens or 7 foot tall magical cats. - Mark Rogaski
Re: What are Perl 6's killer advantages over Perl 5?
On Thu, Aug 27, 2015 at 10:35:27AM -0400, yary wrote: On Thu, Aug 27, 2015 at 4:45 AM, Marc Chantreux kha...@phear.org wrote: complete different usage but it would be nice to have a flag for use strict both in perl5 and 6 /me nominates -W as a bigger -w .. oh wait, -W already exists as a depreciated-in-my-view perl5 flag. In that case, I also like -E as run a one-liner, as if it was loaded from a file which would disable laxness in one-liners, for those who are so inclined. This is actually what I've been thinking during this discussion. I'm not really seeing a pressing need for strict in one-liners, but phiosophically, I can understand why one might want to have strict on in all cases. So, if we think this is something that actually needs solving, this mechanism seems reasonable to me. This discussion got me looking at http://design.perl6.org/S19.html which may need an update, it says perl6 has no -M but Rakudo supports it; which is correct? The 5to6.pod document in the doc directory says it does exist. I lean towards feeling the docs should be more correct/reliable than the design documents, as that's where people outside the p6 creation bubble will be looking for info (not that, at the moment, they necessarily *are* more correct/reliable - work in progress and all...). All that said, there doesn't, at a quck glance, seem to be any equivalent to Perl 5's perlrun document, which would detail the command line flags. Maybe I'll take a shot at something like that in the coming days. dha -- David H. Adler - d...@panix.com - http://www.panix.com/~dha/ Your point being... - Homer Simpson
Re: What are Perl 6's killer advantages over Perl 5?
On Tue, Aug 11, 2015 at 07:12:00AM -0500, Tom Browder wrote: I have seen several lists of new Perl 6 features (versus Perl 5) but they all seem to be lists that intermix features with varying degrees of value to ordinary Perl 5 users. If one wants to sell long-time Perl 5 users (already using the latest Perl 5, Moose, etc.) on the value of Perl 6, what should be on the important feature list? For me, stronger typing, named subroutine arguments, better classes and namespaces, object methods, and eventually better concurrency and compiled program persistence are among goodies long awaited. Thanks. -Tom The reason for my request is to help with a better introduction in my modest draft tutorial on converting Perl 5 to Perl 6 code at the Perl Monastery. I am comfortable with the example code I use there (which is not currently intended to showcase new features), but I am getting several comments on why one should even bother with Perl 6? In talking to Perl 5 people about my Perl 5 to Perl 6 docuentation, trying to get some feedback on it from people who aren't already doing Perl 6, I get this question a lot. So, yes, some kind of document saying these are reasons Perl 6 is actually useful would be very helpful. dha -- David H. Adler - d...@panix.com - http://www.panix.com/~dha/ When I went to open my suitcase I found a lock on it, which I never have. So I picked the lock, opened up the suitcase, and started pulling out all these dresses. After like the 10th dress, I thought, These aren't my dresses. - John Malkovich
slurpy hash
Given the code: use v6; sub speakhash (*%hash) { say %hash{}; } speakhash(1, 2, 3, 4, 5, 6); I get the error: Too many positional parameters passed; got 6 but expected 0 in 'speakhash' at line 3:slurphash.p6 in main program body at line 7:slurphash.p6 According to the UsingPerl6 draft document, *%hash slurps all the remaining unbound named arguments into a hash. So, it looks to me as though the arguments given to the speakhash() subroutine should be slurped into %hash. Regardless, it strikes me as odd that Rakudo* seems to think that the subroutine should expect *0* arguments. So... clearly there's a problem here, but I'm not sure if it's with Rakudo* or with my thinking. :-) Any thoughts on this matter would be appreciated. many thanks, dha -- David H. Adler - d...@panix.com - http://www.panix.com/~dha/ Why *isn't* there a Widget::Gonzo module?
Re: slurpy hash
On Mon, Aug 16, 2010 at 03:14:28PM -0400, Will Coleda wrote: On Mon, Aug 16, 2010 at 3:03 PM, David H. Adler d...@panix.com wrote: Given the code: ? ? ? ?use v6; ? ? ? ?sub speakhash (*%hash) { ? ? ? ? ? ?say %hash{}; ? ? ? ?} ? ? ? ?speakhash(1, 2, 3, 4, 5, 6); I get the error: ? ? ? ?Too many positional parameters passed; got 6 but expected 0 ? ? ? ? ?in 'speakhash' at line 3:slurphash.p6 ? ? ? ? ? ?in main program body at line 7:slurphash.p6 According to the UsingPerl6 draft document, *%hash slurps all the remaining unbound named arguments into a hash. The key here is named arguments; You've invoked the speakhash sub with positional args. Try this: sub speakhash (*%hash) { say %hash.perl; } speakhash(a = 1, b = 2, c = 3, d = 4, e = 5, f = 6); Hm. It just so happens that I tried speakhash(1 = 2, 3 = 4, 5 = 6) and that didn't work. It seems that, although one can create a hash with those pairs, you *can't* pass them as arguments. I'm not clear why. dha -- David H. Adler - d...@panix.com - http://www.panix.com/~dha/ i just ate a slice of key lime pie while drinking limeade scurvy can't touch me now - obnoxicant
Re: slurpy hash
On Mon, Aug 16, 2010 at 03:49:52PM -0400, Will Coleda wrote: On Mon, Aug 16, 2010 at 3:36 PM, David H. Adler d...@panix.com wrote: On Mon, Aug 16, 2010 at 03:14:28PM -0400, Will Coleda wrote: On Mon, Aug 16, 2010 at 3:03 PM, David H. Adler d...@panix.com wrote: Given the code: ? ? ? ?use v6; ? ? ? ?sub speakhash (*%hash) { ? ? ? ? ? ?say %hash{}; ? ? ? ?} ? ? ? ?speakhash(1, 2, 3, 4, 5, 6); I get the error: ? ? ? ?Too many positional parameters passed; got 6 but expected 0 ? ? ? ? ?in 'speakhash' at line 3:slurphash.p6 ? ? ? ? ? ?in main program body at line 7:slurphash.p6 According to the UsingPerl6 draft document, *%hash slurps all the remaining unbound named arguments into a hash. The key here is named arguments; You've invoked the speakhash sub with positional args. Try this: ?sub speakhash (*%hash) { ? ? ?say %hash.perl; ?} ?speakhash(a = 1, b = 2, c = 3, d = 4, e = 5, f = 6); Hm. It just so happens that I tried speakhash(1 = 2, 3 = 4, 5 = 6) and that didn't work. It seems that, although one can create a hash with those pairs, you *can't* pass them as arguments. I'm not clear why. dha -- I believe named arguments have to be valid parameter names. Hm. So how are valid parameter names defined? Identifiers in perl6 seem to be composed of letters, digits and underscores (and hyphens and apostrophes between letters). Are parameter names defined differently? You certainly seem to be able to declare a variable $1. dha -- David H. Adler - d...@panix.com - http://www.panix.com/~dha/ I'm Doug Stanhope and that's why I drink. - Doug Stanhope
Re: [perl #39734] t/doc/pod.t fails on Mac OS 10.4.6/perl 5.8.8
On Thu, Jul 06, 2006 at 06:22:31AM -0700, jerry gay wrote: On 7/5/06, via RT David H. Adler [EMAIL PROTECTED] wrote: As bugs go, not a killer, but still... The problem tests are as follows: not ok 329 - POD test for /Users/dha/parrot-0.4.5/src/ops/experimental.ops # Failed test (t/doc/pod.t at line 62) # /Users/dha/parrot-0.4.5/src/ops/experimental.ops (229): '=item' outside of any '=over' and not ok 1162 - POD test for /Users/dha/parrot-0.4.5/docs/ops/experimental.pod # Failed test (t/doc/pod.t at line 62) # /Users/dha/parrot-0.4.5/docs/ops/experimental.pod (105): '=item' outside of any '=over' i can't recreate this with a recent revision. from the svn log, it seems src/ops/experimental.ops was modified 19 june. perhaps you have a modified file in your working copy? Actually, as I see it, you have a modified file in yours. :-) I was working from the release version, which predates that change by about 2 hours... I guess it's fixed now. I suppose this is what I get for posting bug reports at 3am... dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ In the silence that followed, Homer was heard to mutter, Mmmm... context- dependent semantics... - Darrin Edwards in c.l.p.m.
Re: Unintended consequences
On Mon, May 22, 2006 at 09:45:31PM -0500, Andy Lester wrote: Here's an example of why I'm not real excited about CPANTS: http://community.livejournal.com/perl/120747.html You mean the fact that there's a perl community on LJ? :-) dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ perl -e 'print Just another P$0-r-l hacker'
Re: Test me please: P/PE/PETDANCE/Test-Harness-2.57_06.tar.gz
On Sun, Apr 23, 2006 at 01:02:00AM -0500, Andy Lester wrote: I'm approaching the end of this release cycle. I really want to get this released. Tests pass. One not numeric warning: t/00compile.ok 1/6Argument 2.57_06 isn't numeric in subroutine entry at t/lib/Test/More.pm line 670 dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ Nothing makes me appreciate Perl more than malloc. - Andy Lester
Re: Test me please: P/PE/PETDANCE/Test-Harness-2.57_06.tar.gz
On Sun, Apr 23, 2006 at 04:14:01PM -0400, David H. Adler wrote: On Sun, Apr 23, 2006 at 01:02:00AM -0500, Andy Lester wrote: I'm approaching the end of this release cycle. I really want to get this released. Tests pass. One not numeric warning: Of course, I forgot to mention: Perl 5.8.8, OS X 10.4.6 . D'oha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ Perfect is the enemy of done! - Sean Burke
Re: Test::Harness now tells you which TODOs passed unexpectedly
On Wed, Apr 19, 2006 at 12:52:41AM -0500, Andy Lester wrote: Please try out this dev release. I'd like to make it 2.58 tomorrow. Looks fairly good here. A warning, but nothing show stopping. ~/Test-Harness-2.57_05 11:55:36% make test PERL_DL_NONLAZY=1 /usr/local/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/*.t t/00compile.ok 1/6# Testing Test::Harness 2.57_05 under Perl 5.008007 and Test::More 0.42 Argument 2.57_05 isn't numeric in subroutine entry at t/lib/Test/More.pm line 670 t/00compile.ok t/assertok t/base..ok t/callback..ok t/from_line.ok t/harness...ok t/inc_taint.ok t/nonumbers.ok t/okok t/pod...ok t/point-parse...ok t/point.ok t/prove-globbingok t/prove-switchesok t/strap-analyze.ok t/strap.ok t/test-harness..ok 37/216 skipped: various reasons t/version...ok All tests successful, 37 subtests skipped. Files=18, Tests=569, 21 wallclock secs ( 5.84 cusr + 3.22 csys = 9.06 CPU) -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ Dir-ty deeds...DONE TO SHEEP! Heh heh...AC/DC, eat yer heart out. - Mary Roth
Re: prove users: Please test P/PE/PETDANCE/Test-Harness-2.57_04.tar.gz
On Mon, Apr 17, 2006 at 01:55:59PM -0500, Andy Lester wrote: I'm about to release T::H 2.58, but I have a pretty big difference in how globbing is done in prove, per Audrey. Please download and try it out on your box and make sure it's all good. Tests fine on OS X 10.4.6/perl 5.8.7 dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ Alaska is a large cold place with approximately six residents who would inbreed if they found each other more attractive. - Scott Adams
Re: What the heck is... wrong with Parrot development?
On Mon, Jun 06, 2005 at 05:07:42PM -0700, Edward Peschko wrote: On Mon, Jun 06, 2005 at 07:53:03PM -0400, Uri Guttman wrote: SV == Sam Vilain [EMAIL PROTECTED] writes: SV Three cheers for Dan! hear! hear!! I'll add a cheer as well And I. But it still strikes me as odd. I saw some tension in the perl6 mailing lists, but nothing that would have suggested that *this* would happen. Keep in mind that, first, only a certain amount of the process makes itself known on the mailing list and, more importantly, there's the issue of burnout. Dan's been riding this horse for a while, and a certain amount of saddlesores and a desire to sit in a stationary comfy chair is understandable. Ok, maybe I should leave the metaphors to others. :-) In any case, I agree that this is not a matter that warrents extensive discussion. Speculation isn't terribly useful here. dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ Just Install Perl. - Chris Nandor
Re: Where is Devel::Cover installed?
On Thu, Oct 28, 2004 at 09:51:06PM -0400, James E Keenan wrote: On my Mac OS X (Darwin), when I install a Perl module from CPAN, it is installed in or under this directory: /usr/local/lib/perl5/site_perl/5.8.4/ Recently I got hankerin' to look at the source code for Devel::Cover. I would have expected to find it here: /usr/local/lib/perl5/site_perl/5.8.4/Devel/Cover.pm Much to my surprise, it wasn't there! Mine is in /usr/local/lib/perl5/site_perl/5.8.5/darwin-2level/Devel/Cover.pm On OS X (and other systems, I'm sure) stuff sometimes gets installed under architecture specific directories like that. As mentioned elsehwere, perldoc -l is your friend. dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ ... nononono. And to use nonononono just to negate that is, uhm, confusing. Someone might think I'm stuttering. - Abigail, p5p
Re: Test::DoubleQuotedEntities
On Tue, Aug 24, 2004 at 10:38:50AM +0100, Mark Fowler wrote: I released another testing module yesterday: http://search.cpan.org/dist/Test-DoubleEncodedEntities/ I note that that's not the name in the subject of your mail. I hope this is the right one. :-) (oh, and as an aside I released a new Acme::Test::Buffy, with slightly improved documentation and spelling too - but no one cares about that) Says who? dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ What kind of marathon crack binge would cause you believe this? - Mark Rogaski
Re: Release 0.0.11 status
On Fri, Sep 19, 2003 at 09:22:05PM -0700, Steve Fink wrote: Anything I'm missing? I feel obliged to suggest putting HQ9PLUS into the languages directory. :-) dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ It must be difficult being such a visionary. Not really. You just have to drink a whole lot. - http://www.goats.com/archive/index.html?990420
Re: We *need* this op! :-)
On Thu, Aug 07, 2003 at 12:57:11PM -0400, Gordon Henriksen wrote: This is really a language feature; you should add it to the hq9+ implementation. Sadly, this was not considered when hq9+ was developed, so it's not actually part of the language. Maybe someone should develop and extended version - hq9+42 dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ however, if people don't like Perl, they don't have to use it. they can stay at the office solving their problems while the Perl Mongers go out and drink. ;)- brian d foy in c.l.p.misc
Re: We *need* this op! :-)
On Fri, Aug 08, 2003 at 12:33:03PM +0100, Nicholas Clark wrote: On Fri, Aug 08, 2003 at 02:20:46AM -0400, David H. Adler wrote: On Thu, Aug 07, 2003 at 12:57:11PM -0400, Gordon Henriksen wrote: This is really a language feature; you should add it to the hq9+ implementation. Sadly, this was not considered when hq9+ was developed, so it's not actually part of the language. Maybe someone should develop and extended version - hq9+42 No, hq9*6, surely? Well, that loses the all-important increment op. How about hq9+(6*9) ? (if everyone is still in the dark about six by nine see http://whatis.techtarget.com/definition/0,,sid9_gci211501,00.html ) Frankly, I always thought that Arthur's explanation was more convincing than the base 13 argument... dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ We are the Borg. You will be assimilated! Nah, only kidding. We're just the Sontarans. Care to take part in some 'medical research'?
hq9+ update
Thanks to schwern, a couple of glitches in my interpreter have (I think) been fixed. updated version now replacing old version at http://www.thetasigma.com/parrot/hq9p.pasm dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ Perl Porters, Inc. today announced the release of version .006 of their popular Perl5 compiler suite, codenamed `Rabid Rat'. - Nathan Torkington on p5p (this was a *joke*)
I scare me.
I'm sure it needs a few tweaks, but I've managed to write a hq9+ interpreter in pasm. [insert deity here] help us all. :-) Any thoughts on this? http://www.thetasigma.com/parrot/ dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ It's all eggs, bacon, beans and a fried slice. - Madness
Re: $foo.Foun (was Re: Properties and stricture)
On Wed, Jun 06, 2001 at 01:37:23AM -0500, Me wrote: Larry's MMV on that ;-) Man I really need to get up to speed with these acronyms. I know YMMV, is MMV a distant cousin perhaps? Same idea, except it's Larry's Milage in question, rather than Yours. dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ Shut up, listen, and dance. - Madness
Re: Things have paused... really?
On Tue, Feb 20, 2001 at 02:33:48PM -0500, Dan Sugalski wrote: At 01:32 PM 2/20/2001 -0600, Dave Rolsky wrote: On Tue, 20 Feb 2001, Simon Cozens wrote: valuable and interesting. (aside: Python is Mahler. Discuss.) So while we may Hmm, I think of Python as more Babbit than Mahler. Perl is ... John Cage? Would that mean that perl 6 corresponds to 4'33"? (If I have the composers right...) You do, but surely it's been longer than that since we've heard anything... :-) dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ tastes filling! less great! - ignatz in #perl
Re: Take it outside, please
On Sun, Feb 18, 2001 at 12:11:05PM -0500, [EMAIL PROTECTED] wrote: I don't care who's trolling who, or who's not trolling who. I don't want to hear Yet Another My-Language-Is-Cleaner-Than-Perl-And-Will-Beat-The-Pants-Off-It argument. Get this off perl6-*. Take it to clpm or your local NY.pm meeting. In the latter case, please only do so if schwern is in town and we can shove you and him into a different room... dha, 1/2 :-) -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ You get the idea that if Apple won a 90% market share, bought out Microsoft, and hired Bill Gates to mop the bathrooms, Business Week would write: "Apple has all but ignored the possibility of alien invasion..."- David Pogue
Re: RFC 195 (v1) Retire chop().
On Fri, Sep 08, 2000 at 02:50:37AM +, Ed Mills wrote: Shoot chop. and chomp. Unless you add unchop and unchomp. Parity issue. Like a language with YES and no NO. Just kill then both. Although I'm rather fond of symmetry, it's not inherently good. Rather boring if overused. I admit to being a bit sentimental about chop, but I can't think of any exciting reasons to keep it. The parity reasoning, however strikes me as a bad idea/precedent. dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ Just Install Perl. - Chris Nandor