Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^3: Perl oddities

by Anonymous Monk
on Mar 02, 2005 at 13:17 UTC ( #435808=note: print w/replies, xml ) Need Help??

in reply to Re^2: Perl oddities
in thread Perl oddities

I know. But you can do away with either sin or cos as well - they are the same primitive, just shifted a quarter of a phase. That of course doesn't mean tan couldn't be present. After all, Perl gives us push, pop, shift and unshift, when they can all be trivially implemented using splice. Perl is a rich language, and any minimal approach is, to quote brian, what I consider exceptions to normal Perl thinking. Normal Perl thinking is "programmer convenience". A minimalistic approach isn't programmer convenience.

Replies are listed 'Best First'.
Re^4: Perl oddities
by herveus (Parson) on Mar 02, 2005 at 14:24 UTC

    My sense is that push/pop/shift/unshift are much more frequently used than the trig functions. On that basis, it makes Huffman sense to provide the convenience of the push, etc. functions while declining to provide a fuller set of trig functions.

      You can only explain that with "Huffman" if the save space of 'tan' actually allows you to do something else. Besides, for your reasoning to really work, you'd have to sacrifice one of sin or cos. The analogue would really be having 'splice', 'push' and 'unshift', but not 'pop' or 'shift'. ;-)

        To be more clear, the utility of push, et al. justifies their existence. I claim (without specific evidence) that the trig functions are, in general, used much less frequently, thus making their expansion a less productive use of energy.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2019-11-18 13:43 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (90 votes). Check out past polls.