[fluxus] editor retraction

Dave Griffiths dave at pawfal.org
Mon Jun 27 06:28:11 PDT 2005


>> I'm not sure I get exactly what you mean, but maybe a better way of
>> doing this would be to do something like
>>
>> (define (osc-repl)
>>     (if (osc-msg "/code") ; if /code message is recieved
>>         (eval-string (osc 0))) ; read the first argument as code
>>     (if (osc-msg "/foo") ; if /foo message is recieved
>>         (do-something-else))
>>     (render-stuff)) ; call other functions
>>
>> (start-osc "88008")
>> (every-frame "(osc-repl)")
>>
>> then you could send a message along the lines of
>> /code "(build-sphere 12 12)"
>>
>> you could send one message for code that is to be evaluated once, and
>> another for code to be evaluated each frame etc etc.
>
> nice,.  but i was hoping to avoid the situation where sending something
> like
> /code '(load "another-file.scm")' destroys the repl when its evaluated,
>    ..  . i suppose i could just be more careful ;)

thats true - I was intending to add some hardcoded messages for uploading
and executing code, but it's much more powerful to have it happening in
the scheme code as you are doing.

maybe there should be multiple interpreters, maybe one per workspace,
something I've been intending trying out anyway for running multiple
scripts at once - so you could do something like:

in workspace 1:
(load-execute "another-file.scm" 2) ; runs in interpreter/workspace 2

then one interpreter could always be running the osc reading code and
managing the others.

cheers,

dave





More information about the Fluxus mailing list