help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] lessons from the python environment


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] lessons from the python environment
Date: Tue, 07 Sep 2004 13:54:20 +0200
User-agent: Mozilla Thunderbird 0.7.3 (Macintosh/20040803)


I'd like to propose we do something similar:
PackageLoader import: 'gtk' !
should look along a defined search path for a directory called gtk
containing a predefined filename, and then fileIn: that filename.

That could be another packages.xml file.

A default search path might be: the kernel directory

image directory

, ~/smalltalk-packages

how is this in python?

, /usr/share/gnu-smalltalk

the parent of the kernel directory

, /usr/share/gnu-smalltalk/site-packages
yes.

There is already a search path in the PackageLoader for package.xml files. The idea would be like this:

1) if a package name includes a /, look for another packages.xml file in a subdirectory (named like the package you are loading) of each directory of the search path. That is, loading blox-tk/Blox would look for the Blox package into the packages.xml file of the blox-tk directory.

2) add site-packages etc. to the search path.

3) add a <namespace> tag to packages.xml that would automatically switch the namespace before/after loading it. This way (yahoo) most of the loading scripts in the GNU Smalltalk would probably go away!

editor-bindings:
we already have an emacs mode, but AFAIK thats the only editor we have
bindings too. Having (for instance) a vim-smalltalk

volunteering? though I'd rather have you work on Blox/GTK :-) Note that I do most of my editing in vi, but I simply hate vim. :-)

refactoring:
I think gst suffers quite a bit not having a refactoring browser at the
moment.

yes, porting it would be wonderful but it is quite a lot of work. VW7 luckily has a RB with namespaces, it should be easier to start from it (or so I was told).

*) #!/bin line support: rather than writing a wrapper script that calls gst with the right
packages & .st files to load, or that pipes stuff into gst, users just
create a file with #!/bin/env python at the top, and it just works. I'm
working on a patch to do this for gnu-smalltalk.
I can do this too, but send the patch when it is ready. I'd like it to be as little intrusive as possible, e.g. recognizing the sequence *only* at the beginning of the file (in the lexer?). A problem is that you want to pass arguments but you cannot do

#! /bin/env gst -aQ

So in addition to supporting the shebang I'd install gst as both "gst" and "gst-run", with the latter doing something like

new_argv = alloca (sizeof (char *) * (argc + 2));
new_argv[0] = argv[0];
new_argv[1] = argv[1];
new_argv[2] = "-aQ";
memcpy (new_argv + 3, argv + 2, sizeof (char *) * (argc - 1));
gst_smalltalk_args (argc + 1, new_argv);

in main.c

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]