[metapost] input command

Toby Thurston thurston at eml.cc
Sun Apr 9 00:07:24 CEST 2023


You are right that the Metapost manual (mpman.pdf) does explain the "input" operation properly.  

It is inherited directly from Metafont, so the best documentation for it is pages 179-180 of the Metafont Book. 
Fortunately it is pretty simple, so I can quote it directly here. The book says:

	- input <filename>.  When "input" is expanded, the expansion is null, but
    METAFONT prepares to read from the specified file before looking at any more 
    tokens from its current source.  A <filename> is subject to special restrictions
    explained on the next page.

And then on the next page it says that the syntax for <filename> depends on the local 
operating system and that MF does not even try to convert a file name to tokens; and hence
the operation must appear only in a text file, and not in a list of tokens like the replacement
text for a macro.  

The index in the MFBook makes it clear that "input" is a built-in token, and that therefore "it might
be dangerous to redefine it".  But re-definition is possible, as shown by the extended example on pp.287-288.

It might be helpful to have a summary of some of this in the MP documentation. 

Toby


> On 8 Apr 2023, at 11:00, metapost-request at tug.org wrote:
> 
> Send metapost mailing list submissions to
> 	metapost at tug.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://tug.org/mailman/listinfo/metapost
> or, via email, send a message with subject or body 'help' to
> 	metapost-request at tug.org
> 
> You can reach the person managing the list at
> 	metapost-owner at tug.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of metapost digest..."
> 
> 
> Today's Topics:
> 
>   1. input command (Ernst Reissner)
>   2. Re: input command (peter wilson)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 7 Apr 2023 15:43:11 +0200
> From: Ernst Reissner <rei3ner at arcor.de>
> To: metapost at tug.org
> Subject: [metapost] input command
> Message-ID: <daf22203-7112-cb48-3f34-f8b3bd52efaf at arcor.de>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> 
> Hello all,
> 
> I read the metapost manual by J.D. Hobby.
> 
> What I wonder: the 'command' input is used several times but it is 
> introduced nowhere.
> 
> What is it? a macro?, a command??
> 
> 
> Best Regards,
> 
> Ernst
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Fri, 7 Apr 2023 19:44:47 +0100
> From: peter wilson <herries.press at earthlink.net>
> To: metapost at tug.org
> Subject: Re: [metapost] input command
> Message-ID: <c799ab54-8a34-e660-335f-67209735ccfd at earthlink.net>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> 
> Have you checked both the Metapost amd Metafun manuals? Have you asked 
> on the mailing list `https://lists.tug.org/metapost`? What do you think 
> `command` might mean? --- GOM
> 
> On 07/04/2023 14:43, Ernst Reissner wrote:
>> Hello all,
>> 
>> I read the metapost manual by J.D. Hobby.
>> 
>> What I wonder: the 'command' input is used several times but it is 
>> introduced nowhere.
>> 
>> What is it? a macro?, a command??
>> 
>> 
>> Best Regards,
>> 
>> Ernst
>> 
>> -- 
>> http://tug.org/metapost/
> 
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> metapost mailing list
> metapost at tug.org
> https://tug.org/mailman/listinfo/metapost
> 
> 
> ------------------------------
> 
> End of metapost Digest, Vol 179, Issue 2
> ****************************************




More information about the metapost mailing list.