Hello ConTeXist.

Is there any way to evaluate of contents of two macros as I am showing in my 
minimal example? 

I know, that problem is in expansion, but I dont know to resolve it.

My minimal example consist of piece lua code, because I am solving my problem 
in mixed codes (TeX & Lua)

 

Thanx for help.

Jaroslav Hajtmar

 

 

\starttext

 

\startluacode

                interfaces.definecommand ("domymacro", {

                    arguments = { { "option", "string" }  },

                    macro = function (opt_1)

                       if #opt_1>0 then

                               context(opt_1)

                               else

                               context("123")

                               end

                    end

                               })

                interfaces.definecommand("mymacro", {

                    macro = function ()

                      context.dosingleempty()

                      context["domymacro"]()

                    end

                               })

\stopluacode

 

\def\myothermacro{123}

 

\hairline

 

\mymacro[123]

 

\mymacro

 

\myothermacro

 

\hairline

 

\doifelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

 

\doifsamestringelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

 

\doifinstringelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

 

\doifincsnameelse{\mymacro}{\mymacro[123]}{equal content}{not equal content}

 

 

\hairline

 

\doifelse{\mymacro}{\myothermacro}{equal content}{not equal content}

 

\doifsamestringelse{\mymacro}{\myothermacro}{equal content}{not equal content}

 

\doifinstringelse{\mymacro}{\myothermacro}{equal content}{not equal content}

 

\doifincsnameelse{\mymacro}{\myothermacro}{equal content}{not equal content}

 

 

 

\stoptext

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to