File: misc.e

package info (click to toggle)
eglade 0.3.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 560 kB
  • ctags: 823
  • sloc: yacc: 429; makefile: 174; sh: 24; ansic: 9
file content (35 lines) | stat: -rw-r--r-- 687 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-- Copyright (C) 1999 Daniel Elphick and others
-- Licensed under Eiffel Forum Freeware License, version 1;
-- (see forum.txt)
--
indexing

	description: "Contains miscellaneous routines"
	author: "Daniel Elphick <de397@ecs.soton.ac.uk>"

class MISC

feature {NONE}

	append_arrays(a, b: ARRAY[ANY]) is
			-- append array b to end of array a
		require
			a_is_valid: a /= Void
			b_is_valid: b /= Void
		local
			offset: INTEGER
			old_upper: INTEGER
		do
			old_upper := a.upper
			a.resize(a.lower, a.upper + b.count)
			from
				offset := 0
			until
				offset >= b.count
			loop
				a.put(b @ (b.lower + offset), old_upper + offset + 1)
				offset := offset + 1
			end
		end
			
end