Q:

Use List Element When Sending Bash Command In Remote Server

My expect script connects to several remote servers successfully and echos commands, but I can't manage to have it echo an item from a list. 
For example, when sshing to server1 I'd like to output to terminal fruit:apple
But apple is saved in expect while the send sends it to a local terminal where the list is not defined.  Is it possible to send expect variable to bash? 
In particular the lines relevant to this from the code:
set counter 0
set types {apple orange}
set var $types($counter)
send -- "echo 'fruit:$var'\r"
set $counter [expr $counter+1]

Full code:
#! /usr/bin/expect -f
# ./sshlogin.exp uptime
#declare hosts array"
set hosts {server1 server2}
set types {apple orange}
# setting credentials
set user jack
set password welcome
set counter 0
foreach vm $hosts {
        set var $types($counter)
        set timeout -1
        # now ssh
        spawn ssh $user@$vm -o StrictHostKeyChecking=no
        match_max 100000 # Look for passwod prompt
        expect "*? assword:*"
        # Send password aka $password
        send -- "$password\r"
        # send blank line (\r) to make sure we get back to gui
        expect "$ "
        send -- "echo 'fruit:$var'\r"
       expect "$ " 
       send -- "exit\r"
       set $counter [expr $counter+1]
expect eof }

A:

This is wrong
set counter 0
set types {apple orange}
set var $types($counter)

Tcl has lists which are numerically indexed arrays, and arrays which are associative arrays (hashes). 
You access elements of a list with, typically, the lindex command. 
You access elements of an array with the $arrname($key) syntax
To address the immediate problem with those 3 lines: you want
set var [lindex $types $counter]

Your answer is the perfect way to iterate over 2 lists, pulling out elements with the same numeric index. 
Running through the Tcl tutorial would be beneficial.