On Wed, Dec 17, 2003 at 12:00:21PM +0100, Arve Knudsen wrote:Just an idea, perhaps it would be good to factor commonalities between theapp and SC_TerminalClient into a base class? It could take care ofinitialization, library loading and such. Perhaps better implemented as acomponent class, rather than derived from. I was thinking of creating a Python interface (with the help of SWIG) to sclang, so I could script it from within Vim (built with Python support). A more basic client class,which doesn't read from the commandline would be useful here I think. Am Ion to something?i've split the class into an abstract base class (SC_LanguageClient) and SC_TerminalClient. SC_LanguageClient parses common commandline options (memory, network port) and strips them from the argv. you can also pass options from your program, though. maybe have a look at it, the interface may still be missing something
Perhaps the LanguageClient is still a little too tied to console semantics, like parseOptions and printUsage? I'm thinking it should rather contain minimal functionality, common among clients (graphical, console, whatever). I did implement a basic client for my own use, if you would be interested in having a look at it least.
It offers what I identified as basic services, such as interpreting command lines. I don't know SuperCollider very well yet though, so I could be way off. I implemented it as a concrete class as well, because I dont _think_ it would be necessary to make these services part of the deriving class' interface (the Liskov IS-A principle). I'm attaching my version of SC_TerminalClient.cpp and SC_ClientBase.cpp in case you care to comment (keep in mind the interface could probably use some work).
I don't really know how the integration is done with Emacs (there are some SC language files involved from what I can see), but I played around with scripting SC from within Vim (with Python), with an interface to SC_ClientBase generated by SWIG. I'm currently able to evaluate blocks/lines of code at least. There isnt any existing Vim plugin for SC is there?
Regards Arve Knudsen
Attachment:
SC_ClientBase.cpp
Description: Binary data
Attachment:
SC_TerminalClient.cpp
Description: Binary data