Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] get-arity Segmentation fault

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] get-arity Segmentation fault


Chronological Thread 
  • From: "Sam Liddicott" <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] get-arity Segmentation fault
  • Date: Fri, 08 Apr 2011 08:02:02 +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=


To follow on from yesterdays message:

I can't believe I just got this to work! (I typed it in a text editor and cut-n-paste to texmacs in one go).

<assign|tt|<xmacro|x|<get-arity|<eval-args|x>>>>

I have a use of eval-args that doesn't segfault!

However I think it is not a good way to get the number of arguments passed to a variable macro, if the arguments have a side-effect (like increasing a counter or setting global variables) then eval-args will cause the side effect.

This macro will also give the number of arguments. I hope there is a better way than this though

<assign|ll|<xmacro|x|<length|<map-args|identity|tuple|x>>>>



I tried this, but it also segfaults

<assign|ll|<xmacro|x|<length|x>>>

I also tried something like this but it seg-faults:

<assign|ll|<xmacro|x|<quasi|<length|<tuple|<unquote*|<arg|x>>>>>>>



Sam

On 07/04/11 22:12, Jan Lellmann wrote:

Hello,

the following code reproducibly produces segfaults when I move the cursor to the "x" inside the macro.

This is bad, since it is the only way to get the number of arguments passed to a variable macro.

----
<TeXmacs|1.0.7.3>

<style|generic>

<\body>
<xmacro|x|<get-arity|<eval-args|x>>>
</body>

<\initial>
<\collection>
<associate|language|american>
<associate|page-type|letter>
<associate|preamble|true>
</collection>
</initial>
----

Any ideas why?

Jan


--
[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