[racket] context switching

From: Jakub Piotr Cłapa (jpc-ml at zenburn.net)
Date: Mon Jun 14 15:47:54 EDT 2010

On 12.06.10 06:40, synx wrote:
> Here's a little something I was playing with, the notion of context
> switching. What does a certain symbol (er, parameter) mean in a given
> context? Can parameters be grouped together into meaningful context
> objects that change a bunch of parameters at once?

Why do you want to have your context in parameters in the first place? 
If you want to use multithreading then using parameters the way you do 
will result in a diverging world. If you don't want multiple threads 
then simple global variables and structures should be sufficient.

IIUC you try to use PLT Scheme/Racket like LPC is used in LP-Muds (as a 
dynamic language to express the world). I don't think raw PLT Scheme is 
dynamic enough for this. As I see it you should build a dynamic (maybe 
Smalltalk like, you may check schemetalk from SCG.unibe.ch) object 
system with support for loading classes from disk at runtime (easy) and 
switching them without restarting the server. You may also check the DGD 
MUD driver (it is a MUD driver based on a new implementation of the LPC 
language and really nice persistency features; it seems to have quite a 
good overal design).

You also really need some ways to protect yourself agains malicious and 
runaway code. (threads and kill-thread are good but you must check that 
all your code is kill-safe)

Jakub Piotr Cłapa

Posted on the users mailing list.