Subject: mailing-list for TeXmacs Users
List archive
From : "Sam Liddicott" <address@hidden>- To: address@hidden
- Subject: Re: [TeXmacs] quasi and quote advice needed
- Date: Wed, 06 Apr 2011 12:58:15 +0100
- Envelope-to:
- Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAADxQTFRF NTdQY2Z/i286eHFugnNXoJBwm5GCs5VeoqO0ua+fwLCQ4c2q19C81NDF4eLr/unQ/PTf/fXW+/rq /f/7XKo76wAAAAlwSFlzAAALEwAACxMBAJqcGAAAAi9JREFUSMetloGSqyAMRVsFNAQkxP//15cE 62rFdt/MZqbTVu/hBhLEx/qf8fgDIAN455wHyPk7wCIe9nA+fwGSH87hgD8AHPfRpy2GwdMtcBh+ mg4Ech9Ih+RNixJKDLEL0GF8VLkSojePHrDlryNijbFW8zBg8PUKbBOI6D1WCV5Rf2DzxCtgBlMs tRRVW5LyVW3ew1TfAZZ6RcQicpb4yZmaC74DJADK6BdATOrUAbJzsZie+K22ZnEBknNYysvhVH6u 1X8CqAe4DuANoPoOrAbsHXUARJ5knc5z4EyyTnHoAqj7xvkYIdk65AwhyEZKMusOIDV2QQQaCnDQ gBiDR3RdIEb5CBESt2wgQJI0Yx/Agphg1MgNsD+QkszM9wHVPx/PeQOW+fmcR9DF8+4CyCJhCuP8 fDzmBbLqs8JzMODqYNfDvKhoGYM2lDosy5jlRozccRAgrPM8iygQS3Mv87IugUgKlC7NZ6liuy4r uresVq5QuQAr09ZKEga8OkluyKXeQ6Bs3SrtqgC1pWLNqAfwDhBnB+sK8OrVL4D4h1B4zWPWhJhu gPUHKA5EwSMYUMsdQK+UKDhIOTSHeg+8HCoTOGtB/gwcl4mSdGybwXegPWhM/RHYKwchkckhUNMX 6j7ueQNScLbZZOPRxaADyO2UQCJpl7wbnE6gQ+ksWjpngxOwF1tF5ecP3R6KB+AQxPfHLncQ+nKw 06fhu68OTIfJ869eTtg22l+9zfwDK3mKl5BFHMYAAAAASUVORK5CYII=
I'm wiser now!
<assign|nf-chunk-new|<macro|name|args|<quasi|<new-counter|<merge|code-chunk-|<unquote|<arg|name>>>><new-counter|<merge|code-line-|<unquote|<arg|name>>>><assign|<unquote|<merge|code-item-|<arg|name>>>|<macro|<compound|<unquote|<merge|next-code-line-|<arg|name>>>><render-item|<compound|<unquote|<merge|the-code-line-|<arg|name>>>>>>><compound|<merge|inc-code-chunk-|<unquote|<arg|name>>>><assign|<merge|code-args-|<unquote|<arg|name>>>|<arg|args>>>>>
I realise that enclosing the defining macro's body in <quasi> means that all the <unquote> blocks within it are evaluated first, and then the macro body is evaluated as a whole.
Hurrah!
On 06/04/11 11:54, Sam Liddicott wrote:
I'm trying to write a macro that defines a macro rather like the <item> macro but which uses a counter whose name is not item.
The new defined macro might be called: code-item-blah and so the macro should be defined as:
<macro|<next-code-line-blah><render-item|the-code-line-blah>>
The code below tries to generate such a macro, but it doesn't work - something to do with <unquote*|<quote-arg|name>>
<assign|<merge|code-item-|<unquote|<arg|name>>>|<macro|<quasi|<compound|<merge|next-code-line-|<unquote*|<quote-arg|name>>>><render-item|<unquote|<compound|<merge|the-code-line-|<unquote*|<quote-arg|name>>>>>>>>>
I've tried using:
<unquote*|<quote-arg|name>>
<unquote|<quote-arg|name>>
<unquote|<arg|name>>
<quote-arg|name>
<arg|name>
But I just get the error "bad merge" rendered
<unquote*|<arg|name>> is slightly different
If I replace <unquote*|<quote-arg|name>> with a literal text, e.g. msntp-update-config:
<assign|<merge|code-item-|<unquote|<arg|name>>>|<macro|<quasi|<compound|<merge|next-code-line-|msntp-update-config>><render-item|<unquote|<compound|<merge|the-code-line-|msntp-update-config>>>>>>>
then everything works absolutely fine
--
[FSF Associate Member #2325] <http://www.fsf.org/register_form?referrer=2325>
<http://www.openrightsgroup.org/>
- [TeXmacs] quasi and quote advice needed, Sam Liddicott, 04/06/2011
- Re: [TeXmacs] quasi and quote advice needed, Sam Liddicott, 04/06/2011
Archive powered by MHonArc 2.6.19.