Question: Is it possible to export routines from a personal package

   Is there a way to export routines from a package. The reason I ask, I was answering a question here and I needed two routines I have, that I put together a couple of years ago in a package. I used showstat copied, pasted and edited. Worked, but not great and would utterly fail with anything complicated. e.g. In the two routines pasted  below SignedArea on line 3 c[1]  is c   [1] that caused a minor problem.  

restart

NULL

"RonanRoutines:-SignedArea := proc(a::{Vector, list}, b::{Vector, list}, c::{Vector, list, null} := null)  local M, A;     1   if c = null then     2       A := 1/2*a[1]*b[2]-1/2*a[2]*b[1]         else     3       A := 1/2*(b[2]-c[2])*a[1]+1/2*(-b[1]+c[1])*a[2]+1/2*c[2]*b[1]-1/2*c               [1]*b[2]         end if;     4   return A  end proc:"

NULLNULL

"RonanRoutines:-CrossingNumber := proc(A::list, B::list, C::list, E::list)  local s1, s2, s3, s4;     1   s1 := RonanRoutines:-SignedArea(A,B,C);     2   s2 := RonanRoutines:-SignedArea(A,B,E);     3   s3 := RonanRoutines:-SignedArea(C,E,B);     4   s4 := RonanRoutines:-SignedArea(C,E,A);     5   if s1 = 0 and s2 = 0 and s3 = 0 and s4 = 0 then     6       'undefined'         elif 0 <= signum(s1) and signum(s2) <= 0 then     7       if 0 <= signum(s3) and signum(s4) <= 0 then     8           -1             end if         elif signum(s1) <= 0 and 0 <= signum(s2) then     9       if signum(s3) <= 0 and 0 <= signum(s4) then    10           1             end if         else    11       0         end if  end proc:  "

NULL

Download Export_from_Package.mw

Please Wait...