slang-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] embedding slsh ?


Brian Ahr <brianahr@xxxxxxxxx> wrote:
>I would be particularly interested in seeing the following functions 
>available from the library:
>
>* slsh_interactive
>* slsh_use_readline
>* slsh_init_readline_intrinsics

I may create a separate readline module that can be loaded into the
interpreter.  But do not look for that anytime soon.

>Granted, thats a pretty small chunk of code. It also seems that slsh 
>loads the autoload.sl and slshrl.sl files on start up - and the behavior
>of the above listed functions does not quite match the behavior of slsh 
>unless those files are loaded. I suppose applications could load those 
>files manually, given the installation prefix to S-lang.

It is recommended that an application's load-path include the slsh
directories.

[...]
>I hadn't thought about loading part of my application as a module. I'll 
>look into that as well.

I think that may be your best bet at the moment, especially if your
application has an interactive command-line where the user "lives"
most of the time.  Otherwise, I would just use a simple combination of
SLrline_open, SLrline_read_line, SLang_load_string, and SLclose. 

If you app has a GUI, you might want to consider Mike Noble's SLgtk.
His latest announcement contains the following note that might be
relevant:

        Includes gPrompt, a lightweight terminal-like widget with an
        embedded S-Lang prompt, scrolling output, and a simple history
        mechanism.  gPrompt facilitates the complementary use of a GUI
        & interactive command line within a single application process,
        without resorting to the complexity of multithreading.

Good luck,
--John



[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]