This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Translators again


Ian Bicking <bickiia@earlham.edu> writes:

> It seems as though the REPL may not be implemented in a standard way
> in many applications.  That is, RPL are somewhat application-specific,
> only the E really relates to Guile or the language.

Isn't it possible for a foreign language implementor to
implement a language specific eval?

Lets assume someone wants to contribute the tcl module my.tcl.  This
person must also implement a foreign language interface module
`my.scm' which exports my.tcl's interface to the scheme world -- possibly
by inheriting the standard tcl repl and standard tcl eval from the
(ice-9 lang tcl) module.


A client of my.tcl would look like:

(define-module (test-my-tcl))

(module-open (ice-9 guile) ((user my) (rename eval tcl:eval)))

(eval '(+ 1 2) (the-environment))
(tcl:eval "1 + 2")

;; or:

(module-open (user my) ((ice-9 guile) (rename eval system:eval)))

(system:eval '(+ 1 2) (the-environment))
(eval "1 + 2")


Jost

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]