# The original is from Daemon
# This one is from hop
# Must be used on ircII2.3.16+9 or better
# Just to demonstrate why /fe is better then recursion.

# /iterate command_word list_of_words
# will execute the command for each word in order
^alias iterate
{
        fe ($1-) ix {$0 $ix}
}

# /conbunch server1 server2 server3
^alias conbunch
{
        fe ($*) cx {connect $cx}
}

# /kickbunch nick1 nick2 nick3 nick4
^alias kickbunch
{
        fe ($*) kx {kick * $kx}
}

# you get the point
^alias squitbunch
{
        fe ($*) sx {squit $sx}
}

^alias versbunch
{
        fe ($*) vx {version $vx}
}

# /opalot + nick1 nick2 nick3     or /opalot - nick1 nick2 nick3  for op or deop
# It will op in an efficient fashion as well.
^alias opalot
{
        fe ($1-) mx my mz {mode * $0 $mx $my $mx}
}

# /addlist <listname> word1 word2 word3           add to array
^alias addlist
{
        fe ($1-) ax {
                assign $0.$%strip(#+\.-\*/\={}[]<>!@$$%^~`,?:|'\" $ax) $ax
        }
}

# not related to recursion directly but useful for dealing with arrays.
# /do <list name> <action for element>
^alias do foreach $0 ii { $1- $$($0[$$ii]) }

# /clean <list name>
^alias clean foreach $0 ii { assign -$0[$$ii] }

# Assuming  you've made a list with addlist of servers.. or people or whatever
# the following alias should give you some idea of other things to do..
^alias versall do $0 version

# Yes.. it looks cryptic.. Try /addlist servers h.ece* ucsu* *.unm.edu
# and then /versall servers
# or maybe just type /do servers version         ;)

# so much more.. so little time.. 
