Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] HELP: tuple as args?

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] HELP: tuple as args?


Chronological Thread 
  • From: "Sam Liddicott" <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] HELP: tuple as args?
  • Date: Wed, 16 Mar 2011 10:02:55 -0000
  • 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=


On 15/03/11 10:34, Sam Liddicott wrote:


Wahey - the macro examples using unquote* lead me to this:

<quasi|<tree|J|<unquote*|<jags>>>>

quite niftily shows the answer, which is:

<quasi|<cline|<unquote*|<jags>>>>

I hadn't realised that unquote* could work on non-arg!

So now I know that quasi...unquote*
is used to strip the label from a tree and return the sub-expressions



Nope, that doesn't quite work - it worked for me because jags was a plain macro with no <with or arguments.

quasi and unquote are stripping down the macro definition and not running on the macro results until cline is executed.

(I'm glad to notice that because I've been struggling for months to write a macro that overrides and existing macro but can still call the old definition without without wasting an "assign" variable).

So I need a way to have the <jags> evaluated before the quasi and unquote* take effect. I don't look forward to it. The easier way is internally to jags assign the result data to a global var and use that. ugly - but I guess the quote-value macro helps:
<quasi|<tree|P|<unquote*|<quote-value|points>>>>

so I need something like: quota-macro-result that does what quote-value does to a value...

I'll keep working on it, but if anyone wants to give me the answer, please do...


(what you can do while waiting for things to download)

Sam


On 15/03/11 08:49, Sam Liddicott wrote:


If I have a tuple whose members are to be the arguments of a macro, how do I express this?

For instance, I have a tuple which is a list of points that I want to pass to cline

I've tried:

<assign|jags|<macro|<tuple|<point|5.26538|24.5758>|<point|14.155443841778|24.2794681836222>|<point|12.2927635930679|26.9041539886228>|<point|11.4460907527451|26.0574811483>|<point|10.1337478502447|27.2851567667681>|<point|9.20240772588967|26.3114830003969>|<point|7.0010583410504|28.174163249107>|<point|6.06971821669533|25.8458129382193>|<point|4.37637253604974|27.2004894827358>>>>

<assign|jag|<macro|<merge|<tuple|<compound|cline>>|<jags>>>>

<jag>


But it's not quite the right thing to draw the cline - after all it returns a tuple

The nearest I have seen is map-args but of course it doesn't cross the args boundary. I'm trying various use of the eval family but I can't see how they could make success...

Sam




--
[FSF Associate Member #2325] <http://www.fsf.org/register_form?referrer=2325>

<http://www.openrightsgroup.org/>



Archive powered by MHonArc 2.6.19.

Top of Page