Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: RFC: Integer::Partition::Unrestricted

by Limbic~Region (Chancellor)
on Feb 28, 2006 at 13:18 UTC ( [id://533338]=note: print w/replies, xml ) Need Help??


in reply to Re: RFC: Integer::Partition::Unrestricted
in thread RFC: Integer::Partition::Unrestricted

brian_d_foy,
Yes, pos and next are both Perl keywords. I am currently ambivalent on both points you raise. I could make the argument that there is enough visual distinction between a method call and a built-in call not to confuse the two or that shortened names for things have thrived in Unix for years, but I won't.

You have much more experience writing software for others than I do so I will take your advice. There were comments made by diotalevi and others in the CB that I will take as well. I solicited comments because I don't do this for a living ;-)

Cheers - L~R

  • Comment on Re^2: RFC: Integer::Partition::Unrestricted

Replies are listed 'Best First'.
Re^3: RFC: Integer::Partition::Unrestricted
by brian_d_foy (Abbot) on Feb 28, 2006 at 16:25 UTC

    You could make that argument, but it fails when you need to use those builtins inside the package that defines those methods. And, just because Unix is vowel-deficient doesn't mean that you need to be. :)

    --
    brian d foy <brian@stonehenge.com>
    Subscribe to The Perl Review
      You could make that argument, but it fails when you need to use those builtins inside the package that defines those methods. And, just because Unix is vowel-deficient doesn't mean that you need to be. :)

      Well - that depends on how you call them. As long as you carry on calling them as methods you'll be just fine - inside the declaring package or not.

      Personally I'm anti using keywords in procedural/functional APIs for exactly the reason you put forward. For OO interfaces I think it's fine - as long as the functionality matches the keywords they're copying. pos works well for me in this instance.

        What happens when you want to use the real pos()? I'm not worried about the methods. I'm talking about using the builtins, which you don't call as methods. :)

        Update: You have to be able to explain to everyone else who looks at your code why Perl ignores the subroutine you defined, which one you really wanted, and all sorts of other things. pos() may not be the best example though.

        #!/usr/bin/perl use warnings; sub shift { } my @array = qw( 1 2 3 ); shift @array;

        In general, don't purposedly cause ambiguity.

        --
        brian d foy <brian@stonehenge.com>
        Subscribe to The Perl Review

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://533338]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-24 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found