Re: [NTG-context] defining a comamnd as variable which behaves as constant

2016-04-10 Thread Wolfgang Schuster

Pablo Rodriguez 
10. April 2016 um 00:00
Dear list,

I have the following document:

\mainlanguage[es]
\starttext
\startTEXpage[offset=1em]
\dorecurse{27}%
{\def\abcd{\convertnumber{a}{\recurselevel}}%
\dorecurse{27}%
{\abcd\convertnumber{a}{\recurselevel} }\par}
\stopTEXpage
\stoptext

I want to test all lowercase-letter pairs in Spanish.

Excuse me for my missing programming notions. For the sample above, I
would need a command that behaves as a variable when defined, but as a
constant when invoked.

Is there any way to achieve that without using counters? Sorry if there
is too much nonsense in the previous paragraph. But I need to know how
to do it for another example too.
You can use Lua to create a list of all character combinations. The 
convert function
takes three argument, the first is the conversion method, the second the 
conversion
value and the third the language (optional and only used by certain 
conversion methods).



\starttext

\startluacode
for i = 1,27 do
for j = 1,27 do
context(converters.convert("a",i,"es"))
context(converters.convert("a",j,"es"))
context.par()
end
end
\stopluacode

\stoptext

Wolfgang
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] defining a comamnd as variable which behaves as constant

2016-04-10 Thread Pablo Rodriguez
On 04/10/2016 07:17 AM, Aditya Mahajan wrote:
> On Sun, 10 Apr 2016, Pablo Rodriguez wrote:
>> [...]
>> Is there any way to achieve that without using counters? Sorry if there
>> is too much nonsense in the previous paragraph. But I need to know how
>> to do it for another example too.
> 
> \edef\abcd{}

Thank you very much for your reply, Aditya.

I have seen \edef for years, but I didn’t know what it actually was.

Many thanks again for your help,

Pablo
-- 
http://www.ousia.tk
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] defining a comamnd as variable which behaves as constant

2016-04-09 Thread Aditya Mahajan

On Sun, 10 Apr 2016, Pablo Rodriguez wrote:


Dear list,

I have the following document:

   \mainlanguage[es]
   \starttext
   \startTEXpage[offset=1em]
   \dorecurse{27}%
   {\def\abcd{\convertnumber{a}{\recurselevel}}%
   \dorecurse{27}%
   {\abcd\convertnumber{a}{\recurselevel} }\par}
   \stopTEXpage
   \stoptext

I want to test all lowercase-letter pairs in Spanish.

Is there any way to achieve that without using counters? Sorry if there
is too much nonsense in the previous paragraph. But I need to know how
to do it for another example too.


\edef\abcd{}

Aditya
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] defining a comamnd as variable which behaves as constant

2016-04-09 Thread Pablo Rodriguez
Dear list,

I have the following document:

\mainlanguage[es]
\starttext
\startTEXpage[offset=1em]
\dorecurse{27}%
{\def\abcd{\convertnumber{a}{\recurselevel}}%
\dorecurse{27}%
{\abcd\convertnumber{a}{\recurselevel} }\par}
\stopTEXpage
\stoptext

I want to test all lowercase-letter pairs in Spanish.

Excuse me for my missing programming notions. For the sample above, I
would need a command that behaves as a variable when defined, but as a
constant when invoked.

Is there any way to achieve that without using counters? Sorry if there
is too much nonsense in the previous paragraph. But I need to know how
to do it for another example too.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___