[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [m17n-list] Can I define a function in a .mim input method file?
From: |
Chen, Chien-ting |
Subject: |
Re: [m17n-list] Can I define a function in a .mim input method file? |
Date: |
Wed, 27 Jun 2018 01:12:28 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
I've read the macro used in the si-wijesekera.mim and vi-base.mim file.
Nevertheless, I found that the macro doesn't accept any argument. Is
there any workaround or any way to solve the problem? I'm curious that I
should use the variables defined in the main program before calling a macro.
K. Handa 於 2018年06月26日 20:32 寫道:
> In article <address@hidden>, "Chen, Chien-ting" <address@hidden> writes:
>
>> I tried to write a input method with m17n. After I looked the tutorial
>> https://www.nongnu.org/m17n/manual-en/m17nDBTutorial.html , I've found
>> that it's under lisp-like language. But can I define a function in .mim
>> file?
>> for example:
>> (define (add1 x)
>> (+ 1 x)
>> )
>> and I can use (insert (add1 one-set-value)) to insert the number in the
>> text box.
> MIM file uses S-expression syntax like Lisp, but the semantics is very
> different, and lisp-like function is not supported.
> But, you can use MACRO directive will help you.
> For example, si-wijesekera.mim heavily uses macros.
>
> ---
> K. Handa
> address@hidden