Re: [Chicken-users] an ode to Spiffy

From:

felix winkelmann

Subject:

Re: [Chicken-users] an ode to Spiffy

Date:

Thu, 26 May 2005 08:34:34 +0200

On 5/25/05, Graham Fawcett <address@hidden> wrote:
>
> Great idea -- such a tutorial would be excellent!
Yes, that would be *very* nice!
>
> As you suggested earlier, Michele, it would be great to have better
> error reports (and decent tracebacks, please!). I'd also love a
> remote-REPL facility, to connect to a running spiffy server...
Using the following code you should be able to connect
to a running csi via telnet:
(use tcp)
; Make sure to start csi with the "-:c" option to force
; display of the prompt.
(define (remote-repl #!optional (port 9999))
(let ((listener (tcp-listen port)))
(let-values (((i o) (tcp-accept listener)))
(current-input-port i)
(current-output-port o)
(current-error-port o)
(when (provided? 'debug)
(set! ##dbg#command-input-port i)
(set! ##dbg#command-output-port o) ) ) ) )
When running this with a separate spiffy thread, I had to press
return once on the console where I started csi. From then on
you have a repl in your telnet session.
>
> Heck -- if we can throw in a consistent DB API, a MySQL egg, a few
> handy webapp framework components, and a good tutorial, then you've
> got a serious contender in the silent masses' quest for the ideal LAMP
> (LAMS?) framework. (Well, maybe, if the silent masses can learn to
> digest parentheses.)
>
BTW, has anybody a good idea for a AJAX api? I hacked sajax a little
and got it basically working, but I'm not sure how to integrate this nicely into
spiffy.
cheers,
felix