Thanks Jose,

If I'm understanding this correctly the simple way to do this is to
put the logic for each page in its own file. so instead of (de report
..) I would have a report.l file that just contains the guts of what
I'm coding.

Reloading model.l is not really an issue for me. Besides at the moment
if it does change ir porably means that the underlying database also
needs to be nerfed and recreated becasue I've made large changes to
the the entity structures. THough this is not likely at this stage
where I'm mostly working on getting my reporting function to spit out
the HTML that I want.

regs

Konrad.

2012/3/6 José Romero <jose.cyb...@gmail.com>:
> Hi Konrad,
>
> On Tue, 6 Mar 2012 12:46:44 +1100
> Konrad Zielinski <kzielin...@gmail.com> wrote:
>
>> Hi,
>>
>> At the moment I have my project in two files
>>
>> model.l which contains my domain classes, database init code and other
>> related functions.
>> server.l which contains my URL handling functions.
>>
>> I find that I'm constantly having to kill and restart the server
>> process and then navigate to the code I'm working on. This is quite
>> cumbersome.
>>
>> Is there a way to get the running picolisp process to detect and
>> action changed source files without constant restarts.
>>
>> regs Konrad
>>
>
> You could just use the technique Alex uses, most of the code that
> may need some quick tweak for each object is contained in a file that
> is quickly 'loaded every time a request for that object arrives.
>
> If you are careful designing the application you could make server.l
> 'load model.l again once in a while (maybe by "visiting" some secret
> URL). if you have stuff in server.l that may change very often, move it
> out to another module.
>
> If you want to automatically detect a changed file and reload it, you
> could code something like this, on Linux, using inotifywait(1) (I use
> this code for synchronizing files between my shared host and my laptop
> over ssh+rsync)
>
> # Recursively watch the current directory
> (setq *InotifyFD
>   (pipe
>      (call 'inotifywait "-mrq"
>         "-e" "modify,create,move,delete"
>         "." ) ) )
>
> (de reload ()
>   # load modules, initialize variables, etc etc.
>         )
>
> (task *InotifyFD
>   (in *InotifyFD
>      # The process died somehow, clean up.
>      (when (eof) (task *InotifyFD))
>      (line) # Eat notification.
>      # Wait 5 secs for the notifications to settle before reloading

Reply via email to