File: list

package info (click to toggle)
epic 3.004-17.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,192 kB
  • ctags: 3,197
  • sloc: ansic: 40,843; makefile: 530; sh: 129; perl: 17
file content (19 lines) | stat: -rw-r--r-- 478 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# showlist <list of items>
#
# Comments:
# This is apparantly an intellectual exercise, as this is most certainly
# not the "best" way to do this, by any modern measure.  However, it does
# demonstrate that it is possible to use a counter to iterate through the
# argument list in a useful manner without using recursion of any kind.
#
alias showlist {
	@ sl.cnt = 0
	while (sl.wrd = [$($sl.cnt)])
	{
		echo $sl.wrd
		@sl.cnt++
	}
	^assign -sl.cnt
	^assign -sl.wrd
}
#anonymous