From: Simon Strandgaard <0bz63fz3m1qt3001@...> Date: 2003-05-10T09:03:20+09:00 Subject: Re: capture output On Sat, 10 May 2003 08:45:26 +0900, Brian Candler wrote: > Is this planned as part of "Embedding Ruby in C++ tutorial"? If so, I hope > you don't mind if I argue that it doesn't belong there. Yes I agree that this most likely will confuse newcomers.. Embedding ruby into c/cpp is already a very difficult topic. Things should be made as intuitive as possible, so that Ruby can beat Python! http://www.boost.org/libs/python/doc/index.html python versus "tutorial-ruby-embedded-into-c++" http://metaeditor.sf.net/embed/ ruby-in-a-sandbox: Im working on editor project where I "think" I need this feature (my knowledge about unix-TTYs is minimal). One case where I think a sandbox definitly will be necessary with Ncurses and other TTY applications. Without a sandbox then rubys output will clutter up the TTY. With a sandbox you can store rubys output in a buffer. Another case: many unix-applications is today being started from the desktop, and no console output is visible. You will need to redirect rubys output to the applications status-box/log-window. [snip c++sandbox] > code can. I cannot see any real-world application where such a sandbox is > needed, because it probably just means that the logic is being done in the > wrong place: if the Ruby part of your program needs to redirect any output > it generates, or capture output of a child, then just do it in Ruby. This last case is important if you want to do realworld applications :-) > Just to be clear, I think writing up a tutorial on this embedding is a > really worthwhile thing to do, and I applaud you for doing so. But I think > it's important not to make it seem like this sort of sandboxing is > necessary, because it makes embedding Ruby look far harder than it actually > is, and might put people off. Material for an appendix perhaps. True, Talk about ruby-sandbox should go in the Appendix. Right now its located within the [Embedding Concepts] section http://metaeditor.sourceforge.net/embed/#id2842584 When Im done with my in-depth studies of ruby-sandbox, I will rewrite this sections.. and place it in the appendix. [snip pthreads] Thanks for the good advices. More advices is wanted so that we can beat Pythons tutorial :-) -- Simon Strandgaard