Slashdot Mirror


User: Piers+Cawley

Piers+Cawley's activity in the archive.

Stories
0
Comments
47
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 47

  1. Re:Damian's Klingon module on Larry Wall On Perl, Religion, and... · · Score: 1

    It's written. I've seen it work. But it's apparently still awaiting approval from the Klingon Language Institute, who are taking their own sweet time over it.

  2. Why tie variables? on Ask Larry Wall · · Score: 1
    Can anyone explain why tied variables are better than pure objects with proper accessor methods, btw?


    Not better, just different. And Perl's had tied variables for longer than it's had OO. Tying, say, your aliases.db to a perl hash in a simple maintainance script can be a very effective and natural way of working. For larger, more formal work, you're often better off with a more formal interface, but tied variables have their place.
  3. Re:How Object-Oriented is Perl on Ask Larry Wall · · Score: 1

    Personally, I'd go so far as to say that Encapsulation is a somewhat overrated virtue. But then I would say that; I'm busy working on an Object Persistence tool for Perl. Because encapsulation is virtually nonexistent in Perl OO I can get the information I need directly from the object without the author of that class having to do anything special (but he can if he wants to.)

  4. Re:Patenting Ideas (basic vs improvement patents) on Paging Eliza: Patenting IM Bots · · Score: 1

    I'm sorry, but patenting a stool would be a really shitty thing to do.

  5. Re:Time to upgrade? on Perl 5.8.0 Released · · Score: 2, Funny
    If we're going to play perl golf...
    #!perl -l
    print rand<.5?"Definitely, yes":"Outlook cloudy"
    Or we could go for weird
    print for("Definitely, yes","Outlook cloudy")[rand 2]
  6. Re:Excellent! Now I have something to do at work : on Perl 5.8.0 Released · · Score: 1

    Can I suggest writing something that duplicates the oraperl interface using DBI and DBD::Oracle, and using that to run your scripts?

    It'd probably make your life easier. In the long run.

  7. Re:Cocoa bindings... on Perl 5.8.0 Released · · Score: 4, Informative
  8. Re:Excellent! Now I have something to do at work : on Perl 5.8.0 Released · · Score: 1

    Oraperl? Or do you mean DBI + DBD::Oracle. oraperl, sybperl and all those other monstrosities have been unsupported for ages.

  9. Re:Explanation of Pumpking on Perl 5.8.0 Released · · Score: 2, Informative

    Um... 'Pumpking' isn't a typo. It's the standard perl hacker title for the holder of the Patch Pumpkin.

  10. Ooh look... on Apocalypse 5 Released · · Score: 1
    One of the things I like about the current perl 6 process is Larry's gleeful appropriation of all sorts of useful stuff from everywhere else. It's great. Look at the features of functional languages that you picked out:
    1. Macros: In a sense, that's what Apocalypse 5 is paving the way for; the ability to manipulate the current grammar and add new language features is a small step. Okay, so they're not going to be as clean as lisp/scheme macros, in part because Perl itself is nowhere near as clean as lisp/scheme.
    2. Tail call optimization: According to discussions on perl6.language it looks like it's going to be possible to have at least some (I'm hoping for lots) tail call elimination.
    3. Continuations: (I assume that's what you meant given that you talk about call/cc (personally I prefer let/cc, but hey)). Again, it looks like perl will be getting these (at last), the capability will certainly be there in the underlying VM.
    Now, you may not like perl's syntax, but having these capabilities in the language is going to be great. And hell, you can always morph the syntax into scheme if you like, just make yourself a new grammar and a few supporting functions. I'll probably beat you to that, I've already got the makings of a perl6 scheme interpreter, now to make an A5 based parser for it.
  11. Re:There's an old saying on Alleged eBay Hacker Goofs up and Goes to Jail · · Score: 1

    That's proves in the sense of 'tests'.

    Well, that's my excuse. And I'm sticking to it.

  12. There's an old saying on Alleged eBay Hacker Goofs up and Goes to Jail · · Score: 1, Redundant
    A man who represents himself in court has a fool for a client.
    Looks like this isn't going to be the exception that proves the rule.
  13. Re:Maybe, possibly.. on Perl6 for Mortals · · Score: 1
    I wondered how many emails saying "No you idiot, it's like this..." you got? Maybe none, maybe loads...

    None so far. Although the author of Coro wrote to tell me he wasn't inspired by the Perl 6 process, he just had an itch he needed to scratch.

    And a couple of people complained about a Buffy spoiler or reckoned I'd got Willow's traits wrong.

    And Larry appears to have changed his mind about NaN since I wrote the article. Currently it looks like an unnumfiable value will give 'undef' not NaN.
  14. Re:Perl going the way of C++ on Perl6 for Mortals · · Score: 1

    $^_ + $^_

    is alot more mysterious then

    sub { $_[0] + $_[1] }

    Indeed so. But it does an awful lot more.
  15. The author writes on Perl6 for Mortals · · Score: 1

    I think that comment in the text of the article was intended more to point out that there really isn't a whole lot to add to a language besides syntactic sugar, since perl is already Turing-complete.

    I don't think the author intended for a comparison out of resentment.

    You hit the nail on the head there.

  16. Re:Is it really. on Perl6 for Mortals · · Score: 1

    CGI/mod_perl is an inappropriate place for OOP? Have you seen the current slashcode? It's completely OO. Almost every serious mod_perl based system I've worked on in the past n years has been OO. It just fits.

  17. Re:Comment from a real PERL programmer on Perl6 for Mortals · · Score: 1
    This might be valid Perl6:

    %b{@a} := ^-x @a ^_ '.c';


    Well, it sort of is, but you'll end up with a bunch of '.c' entries in your hash where something wasn't executable, and there's really no need to use :=

    It'd be better written as

    for my $basename (grep -x, @a) {
    %b{$basename} = $basename _ '.c';
    }
  18. Re:Filehandles on Perl6 for Mortals · · Score: 4, Interesting
    What version of perl are you using? In 5.6.0 and later


    open my $fh, $file or die;


    will give you a nice shiny, lexically scoped filehandle.


    And yeah, $| = 1 is a historical PITA. It's going away in Perl 6 though. Hurrah!

  19. Coding for 'other people' on Perl6 for Mortals · · Score: 1

    Even if you're the only person on the project and it's private code, the 'other guy' is just you in a couple of weeks/months time. But it looks like you know this.

  20. Re:Just what Perl needs - more syntax on Perl6 for Mortals · · Score: 1

    Gah! You're right. Must read more closely. I don't tend to use $_ if I can help it.

  21. Re:Seems like the article wasn't for you on Perl6 for Mortals · · Score: 3, Informative

    It's a functional programming thing, named for Haskell Curry. The basic idea is that if you have a function with two arguments, f, and you call it passing in only one argument with value x, you get back another function f' such that f'(y) is equivalent to f(x,y). If you call f with a different value of x, then you get back a different f'.

    This sort of thing is, if not exactly commonplace, a feature of the likes of Haskell, Lisp, Scheme, Perl 5 (if you did the hard work by hand), and various other programming languages that support closures. The perl 6 syntax is simply about making currying easier to use.

  22. Re:Just what Perl needs - more syntax on Perl6 for Mortals · · Score: 1

    If that's supposed to be perl, you mean:

    my($firstname,$lastname,$age) =~ /([a-z]+) ([a-z]+) (\d+)/i

  23. Seems like the article wasn't for you on Perl6 for Mortals · · Score: 1

    I wrote it for an audience of people who already use perl, and who had read the apocalypses and exegeses describing what Larry has done so far. If I'd taken the time to explain the syntax then I'd've spent the majority of my article rehashing the references. Thank you, but no.

    The particular example you cite is a currying parameter, using one introduces a currying context.
    And you are so much the wiser already aren't you. But if you go and Read The Fine Apocalypse, you'll see that it's explained, with pointers to a more in depth explanation if you need it. Throwing up your hands in horror because you don't understand it and it looks weird seems a little extreme.

  24. Re:Pros and Cons of Perl on Perl6 for Mortals · · Score: 2, Interesting
    Now there I have to disagree with you. I think that the changes in Perl as we move to Perl 6 are going to make it easier to write clearer code. The new function definition semantics for instance will move all the code for dealing with function arguments out of the body of the function, so someone reading/maintaining that code can concentrate on the meat. Replacing $self->foo with .foo is nice too. The emphasis gets shifted to the things that are important.

    Of course, many of these tools will allow criminal bastards who shouldn't be allowed anywhere near a production codebase to perpetrate monstrosities. But they can do that already in any language they choose to pollute. And Larry has been making noises about allowing folks to write their own versions of things like strict, which, when taken hand in hand with the more accessible parser should mean that sites that want to can enforce their own rules for coding.

    If you want to be good, Perl 6 is going to let you be better.

  25. Re:Maybe, possibly.. on Perl6 for Mortals · · Score: 2, Informative

    Well, as I wrote the article and I'm reasonably confident I'm not a fool, I guess I'd better respond.

    Larry hasn't finished yet. There's another 30 Apocalypses due. So that means some things are conditional, and I've got to guess which way Larry is going to jump. So I do. And if I'm wrong, so what, it's still fun trying to read the tea leaves.