ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Commands based on previously defined commands, with fixed values for  arguments
@ 2010-08-07 16:03 Vedran Miletić
  2010-08-07 16:10 ` Commands based on previously defined commands, =D=A with fixed values for �rguments R. Bastian
  2010-08-07 16:33 ` Commands based on previously defined commands, with fixed values for arguments Aditya Mahajan
  0 siblings, 2 replies; 7+ messages in thread
From: Vedran Miletić @ 2010-08-07 16:03 UTC (permalink / raw)
  To: NTG-ConTeXt mailing list

How can I define a command by reusing the already defined command?

\def \HelloTwo #1#2 {Hello, #1 and #2!}
\def \HelloOne #1 {\HelloTwo{#1}{Vedran}}

This gives me a "Runaway argument".

-- 
Vedran Miletić
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re:  Commands based on previously defined commands, =D=A with fixed values for �rguments
  2010-08-07 16:03 Commands based on previously defined commands, with fixed values for arguments Vedran Miletić
@ 2010-08-07 16:10 ` R. Bastian
  2010-08-07 16:21   ` Commands based on previously defined commands, DA with fixed values for šrguments Vedran Miletić
  2010-08-07 16:33 ` Commands based on previously defined commands, with fixed values for arguments Aditya Mahajan
  1 sibling, 1 reply; 7+ messages in thread
From: R. Bastian @ 2010-08-07 16:10 UTC (permalink / raw)
  To: ntg-context

On Sat, 7 Aug 2010 18:03:22 +0200
Vedran Miletić <rivanvx@gmail.com> scribit:

> How can I define a command by reusing the already defined command?
> 
> \def \HelloTwo #1#2 {Hello, #1 and #2!}
> \def \HelloOne #1 {\HelloTwo{#1}{Vedran}}
> 
> This gives me a "Runaway argument".
> 
> -- 
> Vedran Miletić

where is #2 for HelloTwo ?

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


-- 
René Bastian
www.pythoneon.org
www.musiques-rb.org
http://www.soundsurvey.org.uk/
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re:  Commands based on previously defined commands, DA with fixed values for šrguments
  2010-08-07 16:10 ` Commands based on previously defined commands, =D=A with fixed values for �rguments R. Bastian
@ 2010-08-07 16:21   ` Vedran Miletić
  2010-08-07 18:01     ` Arthur Reutenauer
  0 siblings, 1 reply; 7+ messages in thread
From: Vedran Miletić @ 2010-08-07 16:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2010/8/7 R. Bastian <rbastian@free.fr>:
> On Sat, 7 Aug 2010 18:03:22 +0200
> Vedran Miletić <rivanvx@gmail.com> scribit:
>
>> How can I define a command by reusing the already defined command?
>>
>> \def \HelloTwo #1#2 {Hello, #1 and #2!}
>> \def \HelloOne #1 {\HelloTwo{#1}{Vedran}}
>>
>> This gives me a "Runaway argument".
>>
>> --
>> Vedran Miletić
>
> where is #2 for HelloTwo ?
>

The code

\def \HelloOne #1 {\HelloTwo{#1}{Vedran} }

compiles. #2 should be fixed to "Vedran", but it comes out empty.

-- 
Vedran Miletić
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Commands based on previously defined commands, with fixed values for arguments
  2010-08-07 16:03 Commands based on previously defined commands, with fixed values for arguments Vedran Miletić
  2010-08-07 16:10 ` Commands based on previously defined commands, =D=A with fixed values for �rguments R. Bastian
@ 2010-08-07 16:33 ` Aditya Mahajan
  2010-08-07 16:54   ` Vedran Miletić
  1 sibling, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2010-08-07 16:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 433 bytes --]

On Sat, 7 Aug 2010, Vedran Miletić wrote:

> How can I define a command by reusing the already defined command?
>
> \def \HelloTwo #1#2 {Hello, #1 and #2!}
> \def \HelloOne #1 {\HelloTwo{#1}{Vedran}}
>
> This gives me a "Runaway argument".

Can you post a complete example? This works for me

\def\HelloTwo#1#2{Hello, #1 and #2!}
\def\HelloOne#1{\HelloTwo{#1}{Vedran}}

\starttext
\HelloOne {One}
\stoptext

Aditya

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Commands based on previously defined commands, with fixed values for arguments
  2010-08-07 16:33 ` Commands based on previously defined commands, with fixed values for arguments Aditya Mahajan
@ 2010-08-07 16:54   ` Vedran Miletić
  2010-08-07 17:10     ` Arthur Reutenauer
  0 siblings, 1 reply; 7+ messages in thread
From: Vedran Miletić @ 2010-08-07 16:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2010/8/7 Aditya Mahajan <adityam@umich.edu>:
> Can you post a complete example? This works for me
>
> \def\HelloTwo#1#2{Hello, #1 and #2!}
> \def\HelloOne#1{\HelloTwo{#1}{Vedran}}
>
> \starttext
> \HelloOne {One}
> \stoptext

Same here, it works. From what I see, you removed the spacing, and if
I add it back it doesn't work again.

Are there any rules where the space should be and where it should not?

-- 
Vedran Miletić
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Commands based on previously defined commands, with fixed values for arguments
  2010-08-07 16:54   ` Vedran Miletić
@ 2010-08-07 17:10     ` Arthur Reutenauer
  0 siblings, 0 replies; 7+ messages in thread
From: Arthur Reutenauer @ 2010-08-07 17:10 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

> Are there any rules where the space should be and where it should not?

  The way you wrote the macro originally, the spaces were part of the
macro.  If you use your original definition of \HelloTwo, you can write
\HelloOne as follows:

----
	\def \HelloOne #1 {\HelloTwo {#1}{Vedran} }
----

and it works.

	\GoodByeOne{Arthur}
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re:  Commands based on previously defined commands, DA with fixed values for šrguments
  2010-08-07 16:21   ` Commands based on previously defined commands, DA with fixed values for šrguments Vedran Miletić
@ 2010-08-07 18:01     ` Arthur Reutenauer
  0 siblings, 0 replies; 7+ messages in thread
From: Arthur Reutenauer @ 2010-08-07 18:01 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

  Even if this is completely unrelated to ConTeXt, allow me to mention
this since I find it so funny:

  The message to which I'm replying has the following weird subject:

# Subject: Re: [NTG-context] Commands based on previously defined commands,
# 	DA with fixed values for šrguments

  Notice the word "DA" at the beginning of the second line, and the word
"šrguments"?  This was obviously not in Vedran's original message:

# Subject: [NTG-context] Commands based on previously defined commands,
#         with fixed values for   arguments

  Let me venture an explanation about how this happened: when replying
to the first message, René's e-mail transformed the subject as such:

# Subject: [NTG-context]
# 	=?UTF-8?Q?Re:__Commands_based_on_previously_defined_commands,
# 	=D=A_with_fixed_values_for_=9arguments?=

  This is quoted-printable, where all the characters but the "basic"
ones are quoted using their code point in the current encoding (here
UTF-8): hence the end line characters (carriage return + line feed) have
been rewritten as =D and =A respectively, in hexadecimal (it's 13 and 10
in decimal), and the tabulation character as =9 (for some reason, there
was a tab before the word "arguments").  But this is actually not
correct, the character codes should be formatted using two hexadecimal
digits (hence =0D, =0A and =09).  This is probably why when replying to
René, Vedran's e-mail agent has interpreted the "=D" and "=A" sequences
as plain 'D' and 'A', and, upon seeing the sequence "=9arguments", it
has use the letter 'a' in "arguments" as an exadecimal digit!  Which it
has interpreted as a Windows-1252 character (Microsoft's extension of
latin-1), where 0x9A is 'š', thus producing this rather weird result.

  This is a particularily disturbing example of mojibake
(http://en.wikipedia.org/wiki/Mojibake).

	Arthur
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-08-07 18:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-07 16:03 Commands based on previously defined commands, with fixed values for arguments Vedran Miletić
2010-08-07 16:10 ` Commands based on previously defined commands, =D=A with fixed values for �rguments R. Bastian
2010-08-07 16:21   ` Commands based on previously defined commands, DA with fixed values for šrguments Vedran Miletić
2010-08-07 18:01     ` Arthur Reutenauer
2010-08-07 16:33 ` Commands based on previously defined commands, with fixed values for arguments Aditya Mahajan
2010-08-07 16:54   ` Vedran Miletić
2010-08-07 17:10     ` Arthur Reutenauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).