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


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

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