- From: "Adrian S." <address@hidden>
- To: address@hidden
- Subject: [TeXmacs] Re: Macros with default values.
- Date: Sat, 4 Dec 2010 13:54:02 -0700
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=P4mMqxHW2FCTLCRON9VE87H22sIdqy7D8pFAqrnqERjQW/j1hOAjdc1tbRiWwaQfi1 O8jtAv7QkgHWHs9dhveOTDGE6ZdpENhhWtr92PIzqtvYC5yd8g+zIRtn7QAXlBbrigOe iWZFbOoPV3XA5d2gbpQhtku//ml1s20k+xsFg=
I found a way to do it. It is just doing the example in the manual,
with one modification.
The example in the texmacs manual did not work, but this version did.
<inactive|<assign|hey|<inactive|<macro|first|second|<inactive|<if|<inactive|<equal|<arg|second>|>>|Only
<arg|first>|<arg|first> and <arg|second>>>>>>>
This is the version that the manual had in the section "Writing
Texmacs Stylefiles" under
"Writing a simple style package". The only problem is that the uninit
should be erased for it to work.
<inactive|<assign|hey|<inactive|<macro|first|second|<inactive|<if|<inactive|<equal|<arg|second>|<uninit>>>|Hey
<arg|first>, you look lonely today...|Hey <arg|first> and <arg|second>, you
form a nice couple!>>>>>>
I hope this helps someone.
Peace.
-Adrian.
On Wed, Dec 1, 2010 at 10:24 PM, Adrian S. <address@hidden> wrote:
>
I wanted to write a macro with default values something like, in python,
>
def f(x=1,y=2):
>
return x+y
>
>
>
I saw the following example in the manual, but I have not managed to
>
make it work.
>
>
<assign|hey|<macro|first|second|<style-with|src-compact|none|<if|<equal|<arg|second>|<uninit>>|Hey
>
<arg|first>, you look lonely today...|Hey <arg|first> and <arg|second>, you
>
form a nice couple!>>>>>
>
>
Is this a bug?
>
>
Thanks for you help!
>
>
Peace.
>
-Adrian
>
Archive powered by MHonArc 2.6.19.