Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] Look left and right around plugin-input-converters rules?

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] Look left and right around plugin-input-converters rules?


Chronological Thread 
  • From: Joris van der Hoeven <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Look left and right around plugin-input-converters rules?
  • Date: Tue, 30 Sep 2008 18:25:03 +0200

On Mon, Sep 29, 2008 at 03:00:02PM +0100, Duncan Smith wrote:
> Hi,
> I'm writing a plug-in to map some of the symbols found in math-menu.scm
> across to Maxima in a natural way, rather than simply substitute a math
> symbol for another token, I'd like to use the context of the surrounding
> items, for e.g.
>
> (this example relates to the Maxima plug-in, but in general is applicable to
> any plug-in)
>
> (plugin-configure maxima-relations
> (:require #t))
> (plugin-input-converters maxima
> ("<neq>" "is(not equal(lval,rval))"))
>
> (%i1) 1 = / 2; /* = / are the keystrokes to generate the <neq> symbol */
> Incorrect syntax: is is not an infix operator
> 1 is(
> (%i1)
>
> What I'd really like is for the <neq> symbol to get converted to:
>
> is(not equal(1, 2));
>
> Is it possible to refer to the operands in the conversion rule, or maybe you
> can use a RegEx to identify which tokens to the left and right of the
> operator will be consumed and re-arranged in the output?

No, I rather try to keep things simple.
But you might try replacing <neq> by a Maxima lambda-expressions
which does the things that you want.

Best wishes, Joris



Archive powered by MHonArc 2.6.19.

Top of Page