Re: basic issue with do and :=
- To: mathgroup at smc.vnet.net
- Subject: [mg60413] Re: [mg60402] basic issue with do and :=
- From: János <janos.lobb at yale.edu>
- Date: Fri, 16 Sep 2005 03:48:53 -0400 (EDT)
- References: <200509150916.FAA15855@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Isn't b[i] not equal to i+1 ?
János
On Sep 15, 2005, at 5:16 AM, David wrote:
> Hi all,
>
> this works as (I) expected
>
> -------------------------
> Do[a[i] = i, {i, 10}]
> Do[b[i] =a[i]+1, {i, 10}]
> -------------------------
>
> While this doesn't:
>
> --------------------------
> Do[a[i] = i, {i, 10}]
> Do[b[i] :=a[i]+1, {i, 10}]
> ---------------------------
>
> [note ":=" instead of "=" on the second line].
>
> namely the output is: "b[2]:=a[i]+1" for all i
>
>
>
> Is there any compact way to define: "b[i] :=a[i]+1" for all i ?
>
>
> Thank you in advance,
>
> David
----------------------------------------------
Trying to argue with a politician is like lifting up the head of a
corpse.
(S. Lem: His Master Voice)
- References:
- basic issue with do and :=
- From: "David" <isolanoster@gmail.com>
- basic issue with do and :=