Forum: Ruby Is it possible to run Tcl from Ruby?

Posted by Ishaan B. (ishaan_b)
on 2013-03-12 10:20
Is it possible to integrate Ruby with Tcl such that Tcl frontend and Tk
backend???
Posted by Carlo E. Prelz (Guest)
on 2013-03-12 10:26
(Received via mailing list)
Subject: Is it possible to run Tcl from Ruby?
  Date: mar 12 mar 13 06:20:05 +0900

Quoting Ishaan B. (lists@ruby-forum.com):

> Is it possible to integrate Ruby with Tcl such that Tcl frontend and Tk
> backend???

Tcl/TK support is included in Ruby from the beginning. I never used it
personally, but if you google around you will find several
resources. For example, a multi-language tutorial:

http://www.tkdocs.com/tutorial/

Carlo
Posted by Ishaan B. (ishaan_b)
on 2013-03-12 10:32
Thanks Carlo but I wanted to run Tcl scripts without the usage of Tk.

Am planning to store and retreive Tcl data from Ruby database
Posted by Carlo E. Prelz (Guest)
on 2013-03-12 10:45
(Received via mailing list)
Subject: Re: Is it possible to run Tcl from Ruby?
  Date: mar 12 mar 13 06:32:48 +0900

Quoting Ishaan B. (lists@ruby-forum.com):

> Thanks Carlo but I wanted to run Tcl scripts without the usage of Tk.
>
> Am planning to store and retreive Tcl data from Ruby database

Umm... Would opening a pipe with tclsh solve your problem? See

ri IO::pipe

Carlo
Posted by Hidetoshi NAGAI (Guest)
on 2013-03-12 14:58
(Received via mailing list)
From: "Ishaan B." <lists@ruby-forum.com>
Subject: Re: Is it possible to run Tcl from Ruby?
Date: Tue, 12 Mar 2013 18:32:48 +0900
Message-ID: <05a930d2fcb845d239c35e2d5d92ed72@ruby-forum.com>
> Thanks Carlo but I wanted to run Tcl scripts without the usage of Tk.
> Am planning to store and retreive Tcl data from Ruby database

Please use tcltklib and tkutil directly.
For example,
------------------------------------
require 'tcltklib'
require 'tkutil'

interp = TclTkIp.new(nil, nil)
ret = interp._eval("source hoge.tcl")
ret = interp._invoke("source", "hoge.tcl")
ret = interp._invoke('lsort', TkUtil._get_eval_string([3,1,2]))
p interp._split_tklist(ret)
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.