Re: RFC 155 (v2) Remove mathematic and trigonomic functions from core binary

2000-08-28 Thread Stephen P. Potter

Lightning flashed, thunder crashed and Nick Ing-Simmons [EMAIL PROTECTED] 
whispered:
| I think this is inappropriate for sin/cos/tan et. al. and possibly even 
| sockets (although Win32 sockets are weird enough that it would be worthwhile)
| 
| But for getpw* or shm/queue/msg or other may-not-be-there but we can 
| fake it if you REALLY want it stuff it makes sense to move the faking out
| into a loadable so we can fix it independantly of perl.

As I've stated before, when I first started, I decided to propose moving
things as groups, not a monolithic "move everything that can/makes sense"
type of thing.  Unfortunately, I thought it would be a good idea to put
them out one at a time (because of my schedule) and wait for discussion to
quiet down a bit on each so that I could hopefully make the next one even
better.  I can see that maybe this wasn't the best way to do things.  I'll
try to write all of them and submit them all, then drop the ones that
everyone agrees aren't wortthwhile.

At this point, should I go ahead and abandon the Math/Trig and/or Sockets
ones?

-spp



Re: RFC 155 (v2) Remove mathematic and trigonomic functions from core binary

2000-08-28 Thread Russ Allbery

Stephen P Potter [EMAIL PROTECTED] writes:

 At this point, should I go ahead and abandon the Math/Trig and/or
 Sockets ones?

I'm still in favor of moving the socket functions into Socket if for no
other reason than it may help beat into people's heads that code like:

eval 'require "sys/socket.ph"';
eval 'sub SOCK_DGRAM {-f "/vmunix" ? 2 : 1;}' if $@;

and

$csock = pack('S n a4 x8', 2, 0, $caddr);
$ssock = pack('S n a4 x8', 2, $port, $saddr);

unless (socket(S,2,SOCK_DGRAM,$UDP_PROTO)) {
warn "$0 (socket): $!\n"; close S; return undef;
}

should be done away with for good.

-- 
Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/



Re: RFC 155 (v2) Remove mathematic and trigonomic functions from core binary

2000-08-28 Thread Jarkko Hietaniemi

 I'm still in favor of moving the socket functions into Socket if for no
 other reason than it may help beat into people's heads that code like:
 
 eval 'require "sys/socket.ph"';
 eval 'sub SOCK_DGRAM {-f "/vmunix" ? 2 : 1;}' if $@;
 
 and
 
 $csock = pack('S n a4 x8', 2, 0, $caddr);
 $ssock = pack('S n a4 x8', 2, $port, $saddr);
 
 unless (socket(S,2,SOCK_DGRAM,$UDP_PROTO)) {
 warn "$0 (socket): $!\n"; close S; return undef;
 }
 
 should be done away with for good.

Agreed.  As Nat put it, to do things socketish with anything even
approaching portability (readability), one has to load the bloody
module already anyway.

 -- 
 Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/

-- 
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen



RFC 155 (v2) Remove mathematic and trigonomic functions from core binary

2000-08-28 Thread Perl6 RFC Librarian

This and other RFCs are available on the web at
  http://dev.perl.org/rfc/

=head1 TITLE

Remove mathematic and trigonomic functions from core binary

=head1 VERSION

  Maintainer: Stephen P. Potter [EMAIL PROTECTED]
  Date: Aug 24 2000
  Last Modified: Aug 28 2000
  Version: 2
  Mailing List: [EMAIL PROTECTED]
  Number: 155

=head1 ABSTRACT

Move the mathematic functions (Cexp, Clog, Csqrt) from the core
binary into a loadable module.  Remove the trigonomic (Catan2, Ccos, 
Csin) functions from the binary, they can already be loaded from the 
Math::Trig.pm module.

=head1 DESCRIPTION

It is desirable to make the perl core binary be easy to maintain and
parse.  It is further desirable to make it easy for parts of the language
to be unimplemented on future ports (such as for embedded systems).  Moving
as many of the special purpose functions to loadable modules serves these
goals well.

There are very few mathematic functions currently in the core binary.
These appear to have been mostly chosen only because they were either easy
to implement or they had been included in other languages that perl was
designed to "replace".  It would be worthwhile to move these functions to
a loadable module (CMath.pm).  Moving these functions to a module also
allows ease of adding other functions to these categories.  The specific
functions that would move to the CMath.pm module are:

=over 4

=item

Cexp

=item

Clog

=item

Csqrt

=back

The trigonomic functions currently included in the core binary are of
generally limited and specific value.  This RFC is further proposing that all 
trigonomic functions should move to a Math::Trig.pm module.  In general,
those functions are already there, this proposal would have them removed from
the core binary.

The specific functions that would be covered under this proposal are:

=over

=item

Catan2

=item

Ccos

=item

Csin

=back

=head1 IMPLEMENTATION

Creation of CMath.pm module for the listed math functions.  Other useful
functions can also be added to this module.  Removal of mathematic and
trigonomic functions from core binary.  It is recommended that they be 
defined to require Cuse Math; or Cuse Math::Trig, but it should be
acceptible for them to autoload.

=head1 REFERENCES

Lperlfunc

=head1 CHANGES

Version 1 of this RFC included a brain-drain on the category of the functions.
They are trigonomic, not geometric.

Version 1 of this RFC lumped all mathematic functions into one category.
This version breaks them into two categories.

Inclusion of more reasoning.