This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Translators again
- To: guile at sourceware dot cygnus dot com
- Subject: Re: Translators again
- From: Ian Bicking <bickiia at earlham dot edu>
- Date: Tue, 8 Feb 2000 19:02:28 -0500
- References: <p2t4sbkn9e4.fsf@pampelmuse.zrz.tu-berlin.de>
- Reply-To: bickiia at earlham dot edu
On Mon, Feb 07, 2000 at 07:40:51PM +0100, Jost Boekemeier wrote:
> Lalo Martins <lalo@webcom.com> writes:
>
> > On Fri, Feb 04, 2000 at 12:09:58AM +0000, Neil Jerram wrote:
> > > Lalo Martins writes:
> > >
> > > Oh. And what about ``eval''? The situation where I want to
> > > execute a string of user input? Remember that Guile is also for
> > > extension :-)
> > >
> > > Sorry, I don't follow - please explain a little further.
> >
> > If the user inputs a line of code for extension in my program,
> > how am I supposed to know what language it is?
>
> 1. One repl per module (per package).
> 2. The module may override the default repl.
>
>
> Example:
>
> (define-module (m) :use-module (lang tcl))
> 1 + 1; -> 2
> <control-d>
> ;; back in meta environment
>
> (define-module (n) :use-module (oop goops))
> define-generic -> generic
> <control-d>
> ;; back in meta environment
>
> <control-d>
>
> # back on shell level
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.
As such, there should probably be a way to explicitly saying the
language. Like (eval *some-expression* language), as in
(eval "puts {hello world}" 'tcl). The application would have to
keep track of what language was prefered -- by command-line option,
preferences, or something like it depending on the app.
Another option might be to allow inlined foreign-language expression
-- some sort of # expression. Like #l(tcl "puts {hello world}") --
well, I think #l might already be used, but something like that.
I'm also not sure how free-form things can be after a #. Maybe
something like #l(tcl /puts "hello world"/) where the first
character is also the terminating character, to prevent needing too
many backslashes.
The # form would allow using foreign languages in places where they
are not otherwise supported by the program author.
--
Ian Bicking / 4869 N. Talman Ave. Apt. G, Chicago, IL 60625
bickiia@earlham.edu / http://www.cs.earlham.edu/~bickiia