Karim Belabas on Sun, 05 Aug 2012 02:54:49 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: support for packages: require()


* Karim Belabas [2012-08-05 02:41]:
> Six years ago, Ilya Zakharevich sent a series of short patches to support a new
> function require():
> 
>   http://pari.math.u-bordeaux1.fr/archives/pari-dev-0601/msg00023.html
>   http://pari.math.u-bordeaux1.fr/archives/pari-dev-0601/msg00026.html
>   http://pari.math.u-bordeaux1.fr/archives/pari-dev-0601/msg00049.html
> 
> inspired by Perl modules. In its simplest form,
> 
>   require("file.gp")
> 
> it would try to load a GP file exactly once [ the file is not reloaded 
> if we require it again ].

Ilya later sent an example package "strings.gp" (complete with tests
and documentation)

  http://pari.math.u-bordeaux1.fr/archives/pari-dev-0603/msg00004.html

(As is, the mechanism is very cumbersome and should be improved, but I
find the functionnality interesting.)

    K.B.
-- 
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`