From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Clinton Ebadi Newsgroups: gmane.lisp.guile.user Subject: Re: Interpreter Sessions (Newbie) Date: Sat, 22 Feb 2003 12:53:28 -0500 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <200302221253.28371.clinton@unknownlamer.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1046080724 19177 80.91.224.249 (24 Feb 2003 09:58:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 24 Feb 2003 09:58:44 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18nFNi-0004yy-00 for ; Mon, 24 Feb 2003 10:58:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18nFG4-0007jR-0A for guile-user@m.gmane.org; Mon, 24 Feb 2003 04:50:48 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18nFFb-0007ho-00 for guile-user@gnu.org; Mon, 24 Feb 2003 04:50:19 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18nFFZ-0007hR-00 for guile-user@gnu.org; Mon, 24 Feb 2003 04:50:18 -0500 Original-Received: from out014pub.verizon.net ([206.46.170.46] helo=out014.verizon.net) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18nFEA-0007E9-00 for guile-user@gnu.org; Mon, 24 Feb 2003 04:48:51 -0500 Original-Received: from vsynth ([151.196.175.203]) by out006.verizon.net (InterMail vM.5.01.05.20 201-253-122-126-120-20021101) with ESMTP id <20030222174910.VIIK1817.out006.verizon.net@vsynth>; Sat, 22 Feb 2003 11:49:10 -0600 Original-Received: from clinton by vsynth with local (Exim 3.35 #1 (Debian)) id 18mdq4-00025G-00; Sat, 22 Feb 2003 12:53:28 -0500 Original-To: Pedro Ortega , User-Agent: KMail/1.4.2 In-Reply-To: X-Authentication-Info: Submitted using SMTP AUTH at out006.verizon.net from [151.196.175.203] at Sat, 22 Feb 2003 11:49:09 -0600 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1686 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1686 On Saturday 22 February 2003 12:03, Pedro Ortega wrote: > 1. Given an user id, create (if it doesn't exist) or > restore the environment (using a database or another > persistent storage media). You can do this with modules: ;;; (make-module size uses-list) (define userid-module (make-module 1021 (list (resolve-module=20 '(guile-user))))) Now you have a module that has access to all the symbols from guile-user = (you=20 can add other modules to the uses-list, just use resolve-module to resolv= e=20 the module from the name). You can then pass userid-module as the second argument to eval or you can= do=20 things like: (module-define! userid-module 'foo 5) ; foo now has the value 5 in=20 userid-module > 2. Execute the Scheme code with the environment, in order > to get the response string. (eval "expression" userid-module) Or I think you may be able to have different module set for each thread s= o you=20 could give each user their own thread and do (set-current-module=20 userid-module) in that thread (I'm not entirely sure because I don't use=20 threads). > 4. Save the updated environment. You can't do this right now, although I could add support for serializing= =20 modules to my hacked together object serializer=20 (http://unknownlamer.org/files/temp/serialize.scm) which I will be mergin= g=20 back into Guile-Web soon. --=20 http://unknownlamer.org _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user