1
0
Fork 0
This commit is contained in:
Miguel de Benito 2012-08-17 14:47:11 +00:00
parent 184dc83b25
commit f0d676ba6e
2 changed files with 34 additions and 31 deletions

View File

@ -1,4 +1,4 @@
<TeXmacs|1.0.7.2> <TeXmacs|1.0.7.16>
<style|tmdoc> <style|tmdoc>
@ -15,13 +15,12 @@
<markup|drd-props>.<htab|5mm> <markup|drd-props>.<htab|5mm>
<\explain> <\explain>
<explain-macro|macro|var-1|<with|mode|math|\<cdots\>>|var-n|body><explain-synopsis|macro <explain-macro|macro|var-1|<math|\<cdots\>>|var-n|body><explain-synopsis|macro
of fixed arity> of fixed arity>
<|explain> <|explain>
This primitive returns a macro (the <TeXmacs> analogue of a This primitive returns a macro (the <TeXmacs> analogue of a
<with|mode|math|\<lambda\>>-expression) with <with|mode|math|n> <math|\<lambda\>>-expression) with <math|n> arguments, named after the
arguments, named after the literal strings <src-arg|var-1> until literal strings <src-arg|var-1> until <src-arg|var-n>.
<src-arg|var-n>.
New tags are defined by storing macros in the environment. Most of the New tags are defined by storing macros in the environment. Most of the
time, macros are stored without scope with <markup|assign>, but it is time, macros are stored without scope with <markup|assign>, but it is
@ -33,7 +32,7 @@
Definition of the <markup|abbr> tag Definition of the <markup|abbr> tag
<\tm-fragment> <\tm-fragment>
<inactive*|<assign|abbr|<macro|x|<group|<arg|x>>>>> <inactive*|<assign|abbr|<macro|x|<rigid|<arg|x>>>>>
</tm-fragment> </tm-fragment>
</example> </example>
@ -42,7 +41,7 @@
</explain> </explain>
<\explain> <\explain>
<explain-macro|arg|var|index-1|<with|mode|math|\<cdots\>>|index-n><explain-synopsis|retrieve <explain-macro|arg|var|index-1|<math|\<cdots\>>|index-n><explain-synopsis|retrieve
macro arguments> macro arguments>
<|explain> <|explain>
This primitive is used to retrieve the arguments of a macro within its This primitive is used to retrieve the arguments of a macro within its
@ -64,11 +63,11 @@
</itemize> </itemize>
When more than one arguments are specified, When more than one arguments are specified,
<explain-macro|arg|var|index-1|<with|mode|math|\<cdots\>>|index-n> <explain-macro|arg|var|index-1|<math|\<cdots\>>|index-n> expands to a
expands to a subtree of the argument <src-arg|var>. The value of the subtree of the argument <src-arg|var>. The value of the named argument
named argument must be a compound tree (not a string). The operands must be a compound tree (not a string). The operands <src-arg|var> until
<src-arg|var> until <src-arg|index-n> must all evaluate to positive <src-arg|index-n> must all evaluate to positive integers and give the
integers and give the path to the subtree of the macro argument. path to the subtree of the macro argument.
</explain> </explain>
<\explain> <\explain>
@ -76,11 +75,11 @@
arity> arity>
<|explain> <|explain>
This primitive returns a macro (the <TeXmacs> analogue of a This primitive returns a macro (the <TeXmacs> analogue of a
<with|mode|math|\<lambda\>>-expression) capable of taking any number of <math|\<lambda\>>-expression) capable of taking any number of arguments.
arguments. The arguments are stored in the macro variable with name The arguments are stored in the macro variable with name <src-arg|var> (a
<src-arg|var> (a literal string) during the evaluation of the literal string) during the evaluation of the <src-arg|body>. The
<src-arg|body>. The <with|mode|math|i>-th individual argument can then be <math|i>-th individual argument can then be accessed using
accessed using <explain-macro|arg|var|i>. <explain-macro|arg|var|i>.
</explain> </explain>
<\explain> <\explain>
@ -98,13 +97,12 @@
By default, the macro <src-arg|foo> is applied to all children. If By default, the macro <src-arg|foo> is applied to all children. If
<src-arg|first> has been specified, then we rather start at the <src-arg|first> has been specified, then we rather start at the
<with|mode|math|i>-th child of <src-arg|var>, where <with|mode|math|i> is <math|i>-th child of <src-arg|var>, where <math|i> is the result of
the result of evaluating <src-arg|first>. If <src-arg|last> has been evaluating <src-arg|first>. If <src-arg|last> has been specified too,
specified too, then we stop at the <with|mode|math|j>-th child of then we stop at the <math|j>-th child of <src-arg|var> (the <math|j>-th
<src-arg|var> (the <with|mode|math|j>-th child not being included), where child not being included), where <math|j> is the result of evaluating
<with|mode|math|j> is the result of evaluating <src-arg|last>. In this <src-arg|last>. In this last case, the arity of the returned tree is
last case, the arity of the returned tree is therefore therefore <math|j-i>.
<with|mode|math|j-i>.
Stated otherwise, <markup|map-args> applies <src-arg|foo> to all subtrees Stated otherwise, <markup|map-args> applies <src-arg|foo> to all subtrees
of the macro argument <src-arg|var> (or a range of subtrees if of the macro argument <src-arg|var> (or a range of subtrees if
@ -142,7 +140,7 @@
</explain> </explain>
<\explain> <\explain>
<explain-macro|compound|foo|arg-1|<with|mode|math|\<cdots\>>|arg-n><explain-synopsis|expand <explain-macro|compound|foo|arg-1|<math|\<cdots\>>|arg-n><explain-synopsis|expand
an unnamed macro> an unnamed macro>
<|explain> <|explain>
This primitive is useful to expand macros which are the result of a This primitive is useful to expand macros which are the result of a
@ -180,7 +178,7 @@
</explain> </explain>
<\explain> <\explain>
<explain-macro|drd-props|var|prop-1|val-1|<with|mode|math|\<cdots\>>|prop-n|val-n><explain-synopsis|set <explain-macro|drd-props|var|prop-1|val-1|<math|\<cdots\>>|prop-n|val-n><explain-synopsis|set
<abbr|D.R.D.> properties of a tag> <abbr|D.R.D.> properties of a tag>
<|explain> <|explain>
The arity and children accessibility of tags defined by macros are The arity and children accessibility of tags defined by macros are
@ -190,8 +188,8 @@
are: are:
<\description-dash> <\description-dash>
<item*|(arity, <with|mode|math|n>)<verbatim|>>Sets the arity to the <item*|(arity, <math|n>)>Sets the arity to the given fixed value
given fixed value <with|mode|math|n> (literal integer). <math|n> (literal integer).
<item*|(accessible, all)>Make it impossible to deactivate the tag with <item*|(accessible, all)>Make it impossible to deactivate the tag with
normal editor actions. Inaccessible children become effectively normal editor actions. Inaccessible children become effectively
@ -215,7 +213,7 @@
<explain-macro|get-arity|expression><explain-synopsis|arity of an <explain-macro|get-arity|expression><explain-synopsis|arity of an
expression> expression>
<|explain> <|explain>
Returns the label of the tree obtained when evaluating Returns the arity of the tree obtained when evaluating
<src-arg|expression>. <src-arg|expression>.
</explain> </explain>

View File

@ -1,4 +1,4 @@
<TeXmacs|1.0.7.14> <TeXmacs|1.0.7.16>
<style|tmdoc> <style|tmdoc>
@ -19,7 +19,12 @@
<menu|Session|Input mode|Mathematical input>. If this feature is available, <menu|Session|Input mode|Mathematical input>. If this feature is available,
then it is usually also possible to copy and paste output back into the then it is usually also possible to copy and paste output back into the
input. However, it depends on the particular application how well this input. However, it depends on the particular application how well this
works. works. Keep in mind that some key combinations may be used by the
<subsubmenu|Session|Input|Mathematical input> mode: for instance the key
<key|$> is usually redefined inside math mode, so if you want to input it
you'll have to type <key|S-F5><key|$>. You can read more about the prefix
key <key|S-F5> in ``<hlink|Keyboard shortcuts fot text
mode|../text/keyboard/man-text-kbd.en.tm>''.
<\example> <\example>
Below, you will find the <hlink|previous example Below, you will find the <hlink|previous example