1
0
Fork 0

Doc: a few words on tm-properties

This commit is contained in:
Miguel de Benito 2014-06-07 16:53:37 +00:00
parent e5a3807a3f
commit 5ad3b029f9
1 changed files with 48 additions and 16 deletions

View File

@ -1,17 +1,22 @@
<TeXmacs|1.0.7.17> <TeXmacs|1.99.1>
<style|tmdoc> <style|<tuple|tmdoc|english>>
<\body> <\body>
<tmdoc-title|Function definition and contextual overloading> <tmdoc-title|Function definition and contextual overloading>
Conventional programming languages often provide mechanism to overload Conventional programming languages often provide some means to overload
certain functions depending on the types of the arguments. <TeXmacs> certain functions depending on the types of the arguments. <TeXmacs>
provides additional context-based overloading mechanisms, which require the provides additional context-based overloading mechanisms, which require the
use of the <scm|tm-define> construct for function declarations (and use of the <scm|tm-define> construct for function definitions (and
<scm|tm-define-macro> for macro declarations). Furthermore, one may use <scm|tm-define-macro> for macro definitions). Definition with
<scm|tm-define> for associating additional properties to a function, such <scm|tm-define> also allows the specification of properties of the
as documentation or default values for the arguments. function/macro: arguments, synopsis, etc.
Furthermore, one may use <scm|tm-property> for associating additional
properties, such as interactivity or default values for the arguments, of a
function <em|which is already defined>, specifically functions exported
from <c++> code through the glue.
<\explain> <\explain>
<scm|(tm-define <scm-arg|head> <scm-args|options> <scm|(tm-define <scm-arg|head> <scm-args|options>
@ -26,7 +31,22 @@
macros defined using <scm|tm-define> and <scm|tm-define-macro> are macros defined using <scm|tm-define> and <scm|tm-define-macro> are
public. Each option is of the form <scm|(:<scm-arg|kind> public. Each option is of the form <scm|(:<scm-arg|kind>
<scm-args|arguments>)> and the <scm-arg|body> starts at the first element <scm-args|arguments>)> and the <scm-arg|body> starts at the first element
of the list following <scm-arg|head> which is not of this form. of the list following <scm-arg|head> which is not of this form. Available
options are <scm|:type>, <scm|:synopsis>, <scm|:returns>, <scm|:note>,
<scm|:argument>, <scm|:default>, <scm|:proposals>, <scm|:secure>,
<scm|:check-mark>, <scm|:interactive> and <scm|:balloon>.
</explain>
<\explain>
<scm|(tm-property <scm-arg|head> <scm-args|options>)><explain-synopsis|<TeXmacs>
properties definition>
<|explain>
<scm|tm-property> allows the declaration of <TeXmacs> properties for
functions which have already been defined, specifically for functions
exported through the glue. Available options are <scm|:type>,
<scm|:synopsis>, <scm|:returns>, <scm|:note>, <scm|:argument>,
<scm|:default>, <scm|:proposals>, <scm|:secure>, <scm|:check-mark>,
<scm|:interactive> and <scm|:balloon>.
</explain> </explain>
<paragraph*|Contextual overloading> <paragraph*|Contextual overloading>
@ -155,12 +175,19 @@
</explain> </explain>
<\explain> <\explain>
<scm|(:argument <scm-arg|var> <scm-arg|description>)><explain-synopsis|argument <scm|(:argument <scm-arg|var> <scm-arg|description>)>
description>
<scm|(:argument <scm-arg|var> <scm-arg|type>
<scm-arg|description>)><explain-synopsis|argument description>
<|explain> <|explain>
This option gives a short <scm-arg|description> of one of the arguments This option gives a short <scm-arg|description> of one of the arguments
<scm-arg|var> to the function or macro. Such a description is used for <scm-arg|var> to the function or macro. Such a description is used for
instance for the prompts, when calling the function interactively. instance for the prompts, when calling the function interactively. For
these uses, the second format allows for the specification of a
<scm-arg|type> which changes how the widgets/prompts work. Some allowed
values are <scm|"string">, the default, and <scm|"file"> and
<scm|"directory">. If any of the last two is specified, tab completion in
the interactive prompt will traverse the file system.
</explain> </explain>
<\explain> <\explain>
@ -171,6 +198,14 @@
the function or macro. the function or macro.
</explain> </explain>
<\explain>
<scm|(:type (-\<gtr\> <scm-arg|from> <scm-arg|to>))><explain-synopsis|type
conversion description>
<|explain>
This option specifies that a function or macro performs a conversion from
the data type <scm-arg|from> to the data type <scm-arg|to>.
</explain>
<tmdoc-copyright|2007--2010|Joris van der Hoeven> <tmdoc-copyright|2007--2010|Joris van der Hoeven>
<tmdoc-license|Permission is granted to copy, distribute and/or modify this <tmdoc-license|Permission is granted to copy, distribute and/or modify this
@ -181,8 +216,5 @@
Documentation License".> Documentation License".>
</body> </body>
<\initial> <initial|<\collection>
<\collection> </collection>>
<associate|language|english>
</collection>
</initial>