For Programmers: Free Programming Magazines  


Home > Archive > Tcl > February 2005 > Why is not package search recursive in $auto_path?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Why is not package search recursive in $auto_path?
Bhushit Joshipura

2005-02-24, 3:59 am

Hello,

I was curious why the package search in auto_path is not recursive.

Having it recursive would help a lot in software organization. For
example, we can just add "animals" in the auto_path. Then work on
animal/feline/lion, animal/feline/tiger, animal/bovine/cow,
animal/canine/wolf without worrying about the breadth of animal
families - feline, bovine, canine, primate ...

-Bhushit

Bob Techentin

2005-02-24, 4:01 pm

"Bhushit Joshipura" <joshipura@gmail.com> wrote
>
> I was curious why the package search in auto_path is not recursive.
>
> Having it recursive would help a lot in software organization. For
> example, we can just add "animals" in the auto_path. Then work on
> animal/feline/lion, animal/feline/tiger, animal/bovine/cow,
> animal/canine/wolf without worrying about the breadth of animal
> families - feline, bovine, canine, primate ...


Searching all directories under $auto_path directoriies can already be
slow. To make it recursive would make it very very slow.

Look in tcllib for an example of a recursive package hierarchy. The
pkgIndex.tcl file for tcllib will just append its own directory to
auto_path, so future package requests will look in its subdirectories.
(There is also alternative code for pre-8.3.1 Tcl which cannot perform
this feat.)

Bob
--
Bob Techentin techentin.robert@NOSPAMmayo.edu
Mayo Foundation (507) 538-5495
200 First St. SW FAX (507) 284-9171
Rochester MN, 55901 USA http://www.mayo.edu/sppdg/



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com