[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Variables as variables
From: |
David Kastrup |
Subject: |
Re: Variables as variables |
Date: |
Mon, 20 Jan 2014 17:00:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
"Phil Holmes" <address@hidden> writes:
> ----- Original Message -----
> From: "David Kastrup" <address@hidden>
> To: "Johan Vromans" <address@hidden>
> Cc: <address@hidden>
> Sent: Monday, January 20, 2014 3:23 PM
> Subject: Re: Variables as variables
>
>
>
>> That's not "like a real variable as known from other programming
>> language". If I write
>>
>> aaa = 3
>> bbb = aaa + 1
>> print ( bbb )
>> aaa = 5
>> print ( bbb )
>>
>> I know of no programming language which will output 6 the second time
>> round. You are not thinking of a variable, but of a parametric
>> procedure.
>
> IIRC metafont does something of this sort.
mf
This is METAFONT, Version 2.718281 (TeX Live 2013/Debian)
**\relax
*aaa := 3;
bbb = aaa + 1;
show bbb;
*
*>> 4
*aaa := 5;
show bbb;
*>> 4
*
It takes care when reassigning values to a variable to _first_ make the
existing expressions independent from the respective variable.
--
David Kastrup