On Sun, Nov 30, 2008 at 9:22 AM, Franco Saliola <[EMAIL PROTECTED]> wrote: > > Michael Abshoff wrote in the comments to trac ticket #4653: > >> one issue that might be worth considering now before merging is >> "name space pollution", i.e. there was some discussion at SD 11 >> that it would be better to have most of the functionality of certain >> packages like quadratic forms not in the global namespace. >> I am not sure what the situation with words is (sorry, no time to >> apply the patch and play :)), but it would be nice if most of the >> functionality would be in >> >> words.$FOO >> >> Sooner or later things will start colliding in the global namespace, >> so the time to fix this would be pre-merge :) > > I like this idea for several reasons, but it is something that needs > to be discussed since there should be a consistent way to do this > across all Sage packages/libraries. So let's discuss it. What is the > best way to do this? (I wasn't at Sage Days 11, so I don't know what > was decided.) > > One thing that comes to mind, from a user's perspective, is that there > should be a consistent way to load all functions from a given package > into the global name space. Something like: > > LoadPackage(words) > > or > > from words import * > > I prefer the latter, actually. > > Another related issue, perhaps this should be a different thread, is > pre-defined examples of objects. I am going to use graphs to > illustrate what I mean here. One can write, for example, > > sage: graphs.CompleteGraph(5) > Complete graph: Graph on 3 vertices > > But there are other objects lying around in the global name space > which should probably be access by such interface. And this should > also be consistent across Sage. Is graphs a suitable name for this? > Should it be something like GraphExamples or GraphConstructor or > something else instead? One problem with the name graphs is that some > sage-combinat developer is going to come along and define the > combinatorial class of all graphs and name it Graphs. Then graphs and > Graphs might have different behaviour unless one allows something like > this: > > sage: Graphs(3) > Graphs on 3 vertices > sage: Graphs.CompleteGraph(5) > Complete graph: Graph on 3 vertices > > Thoughts/comments?
I really like sage: finance.[tab] I don't like explicitly forcing people to import stuff before they can use it at all. Thus I much prefer $ sage .... sage: finance.[tab] and I don't like $ sage ... sage: import sage.finance as finance sage: finace.[tab] I do like various domains with lots of functions to have their functionality gathered together under a namespace. That said, I'm not for some massive reorganization of the current global namespace, since that wold break a huge amount of existing code -- both in Sage and out (e.g., the examples at wiki.sagemath.org/interact). And it's not the end of the world that len(globals()) is large. It's only a problem to me when there are specific reasons it is a problem. -- William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---