http://www.perlmonks.org?node_id=435833


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

Howdy!

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.

yours,
Michael

Replies are listed 'Best First'.
Re^5: Perl oddities
by Anonymous Monk on Mar 02, 2005 at 15:04 UTC
    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'. ;-)
      Howdy!

      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.

      yours,
      Michael
        Whose energy? It's not that tan (and acos, and asin, and atan) isn't provided by the C math library.

        Guess what, a corner where C is more programmer friendly than Perl... Now, that's an oddity! ;-)