From: Eric Hodel Date: 2005-11-19T07:07:53+09:00 Subject: Re: embedded ruby limitations On Nov 18, 2005, at 1:47 PM, Timothy Byrd wrote: >> What are you expecting (your users?) to do in Ruby >> that could require multiple interpreters? Are you >> writing a web app using a not-ruby-aware framework, >> so you need to have separate "contexts" for different >> users of the app? > > (pardon my Windows-centric terminology) > > Imagine a command shell that can run individual Ruby commands > maintaining a persistent Ruby environment. For example (given a > syntax > of "%@ruby[" "]"): > > %@ruby[b = 42] > %@ruby[p b] > > would print 42 on the console, and then > > %@ruby[`set q=#{b**3}`] > > would set the environment variable q to 74088 - *back in the calling > environment*. > > Meanwhile, the shell would be able to directly run Ruby scripts, but > might well want to run them in a fresh, clean environment, as is done > by invoking ruby.exe on a script. And after the script has finished, > the b would still be 42 in the command shell's persistent Ruby > environment. I think irb's workspaces work this way. -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04