Skip to Content.
Sympa Menu

texmacs-users - Re: TeXmacs macros functions values arguments apply and expand

Subject: mailing-list for TeXmacs Users

List archive

Re: TeXmacs macros functions values arguments apply and expand


Chronological Thread 
  • From: address@hidden
  • To: TeXmacs Users <address@hidden>
  • Subject: Re: TeXmacs macros functions values arguments apply and expand
  • Date: Mon, 7 Apr 2003 15:50:00 +0200

On Wed, Mar 12, 2003 at 02:02:36PM +0100, Philippe Audebaud wrote:
> in the style file 'packages/standard/std-list.ts', I see the definition
>
> <assign|newitemize|<func|name|tag|<assign|<apply|name>|<hold|<macro|body|<w\
> ith|thetag|<release|<value|tag>>|<expand|itemize-base|<arg|body>>>>>>>>
[...]
>
> Or else, is there a simple rule-of-thumb for
>
> 1) deciding between func | macro,
> 2) deciding between apply | expand ...,
> 2) deciding between arg | value | apply,

1.a) use a macro when you want the expansion to be editable
transparently (e.g. section)

1.b) use a function when you want to include hidden data but still
want it to be editable (e.g. index). Editing data in macros
causes the appearance of the dreadful green cursor.

1.c) there are also some weird cases when you would want use macro
expansions for computational purposes. See the 'tags' package on
my homepage.

2.a) use 'apply' when applying a function or recalling a value.

2.b) use 'expand' when expanding a macro.

3.a) use 'argument' when getting a macro parameter

3.b) use 'apply' or 'value' when getting a macro parameter. Generally,
it is safer to use 'value'. But in most cases 'apply' does just
as well and produce lighter notation. In your example, one of the
parameters must be a function object, so it must be recalled
unevaluated with 'value' and not 'apply' (which would evaluate it).

Last note: do not read and/or edit style file using an external editor
unless you *really* know what your are doing. Guesswork there
generally leads mistakes. Use TeXmacs to edit your style files instead
and please use Scheme cut-and-paste format when posting snippets on
mailing lists.


-- DDAA


  • Re: TeXmacs macros functions values arguments apply and expand, david, 04/07/2003

Archive powered by MHonArc 2.6.19.

Top of Page