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

Re: [sc-dev] library config



On Wed, Dec 17, 2003 at 04:03:08PM +0100, Arve Knudsen wrote:
> 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).

command line parsing is optional, you can use the defaults or pass in
an option struct. i'm working on a gui application that uses the
language client base and does its own command line parsing in addition
to options parsed by the base class (just like the terminal client).

> 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 need the notifications from the library in my subclass to define
primitives etc. without subclassing you'd have to pass function
pointers, which may or may not be more tedious ...

> 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).

the language 'user' needs to redefine behavior of two more
aspects, depending on the particular application:

in a gui application the post routines will write to some text output
window.

the tick method needs to be called from the application main loop. i
just realized that AppClock is _not_ supposed to run in a separate
thread, so the terminal client needs to dispatch in its input loop to
periodically trigger the AppClock driver.

> 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.

emacs just reads from sclang's stdout, passes code to stdin and uses a
fifo to get information back from the language.

> I'm currently able to evaluate blocks/lines of code at least. There
> isnt any existing Vim plugin for SC is there?

none that i know of. i do know some vi freaks, however, who probably
would be very interested in something like that ;)

<sk>