Skip to content

Commit

Permalink
Manual removal of the "is" keyword. There may be some leftovers.
Browse files Browse the repository at this point in the history
  • Loading branch information
cadrian committed Jun 19, 2014
1 parent cdbd870 commit 22fbd01
Show file tree
Hide file tree
Showing 5,276 changed files with 46,100 additions and 46,061 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 5 additions & 5 deletions misc/benchmarks/shootout/dev/eiffel/binary-trees/binarytrees.e
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ create {ANY}
make

feature {ANY}
min_depth: INTEGER is 4
min_depth: INTEGER 4

max_depth: INTEGER is
max_depth: INTEGER
once
if argument_count >= 1 and then argument(1).is_integer then
Result := argument(1).to_integer
end
Result := Result.max(min_depth + 2)
end

stretch_depth: INTEGER is
stretch_depth: INTEGER
do
Result := max_depth + 1
end

make is
make
local
long_lived_tree: NODE; depth, iterations, i, c: INTEGER
do
Expand All @@ -52,7 +52,7 @@ feature {ANY}
print("long lived tree of depth " + max_depth.out + "%T check: " + long_lived_tree.test.out + "%N")
end

maketree (depth, item: INTEGER): NODE is
maketree (depth, item: INTEGER): NODE
local
d, i: INTEGER
do
Expand Down
4 changes: 2 additions & 2 deletions misc/benchmarks/shootout/dev/eiffel/binary-trees/node.e
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ feature {ANY}

left, right: NODE

test: INTEGER is
test: INTEGER
do
Result := value
if left /= Void then
Result := Result + left.test - right.test
end
end

make (v: INTEGER; l, r: NODE) is
make (v: INTEGER; l, r: NODE)
do
value := v
left := l
Expand Down
4 changes: 2 additions & 2 deletions misc/benchmarks/shootout/dev/eiffel/fannkuch/fannkuch.e
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ feature {ANY}

buffer: STRING

make is
make
do
if argument_count > 0 and then argument(1).is_integer then
n := argument(1).to_integer
Expand All @@ -27,7 +27,7 @@ feature {ANY}
end
end

fannkuch (x: like n): like n is
fannkuch (x: like n): like n
require
x > 1
local
Expand Down
272 changes: 136 additions & 136 deletions misc/benchmarks/shootout/dev/eiffel/fasta/fasta.e
Original file line number Diff line number Diff line change
Expand Up @@ -4,157 +4,157 @@
class FASTA

insert
ARGUMENTS
ARGUMENTS

create {ANY}
make
make

feature {ANY}
im: INTEGER is 139968
im: INTEGER 139968

ia: INTEGER is 3877
ia: INTEGER 3877

ic: INTEGER is 29573
ic: INTEGER 29573

last: INTEGER_32
last: INTEGER_32

random (max: REAL_64): REAL_64 is
do
last := (last * ia + ic) \\ im
Result := max * last / im
end
random (max: REAL_64): REAL_64
do
last := (last * ia + ic) \\ im
Result := max * last / im
end

alu: STRING is "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG%
alu: STRING "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG%
%GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA%
%CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT%
%ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA%
%GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG%
%AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC%
%AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"

iub: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]] is
once
Result := {FAST_ARRAY[TUPLE[CHARACTER, REAL_64]] << ['a', 0.27], ['c', 0.12], ['g', 0.12], ['t', 0.27], ['B', 0.02], ['D', 0.02], ['H', 0.02], ['K', 0.02], ['M', 0.02], ['N', 0.02], ['R', 0.02], ['S', 0.02], ['V', 0.02], ['W', 0.02], ['Y', 0.02] >> }
end

homo_sapiens: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]] is
once
Result := {FAST_ARRAY[TUPLE[CHARACTER, REAL_64]] << ['a', 0.3029549426680], ['c', 0.1979883004921], ['g', 0.1975473066391], ['t', 0.3015094502008] >> }
end

make_cumulative (a: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]]) is
local
cp: REAL_64; i: INTEGER; t: TUPLE[CHARACTER, REAL_64]
do
cp := 0.0
from
i := a.lower
until
i > a.upper
loop
t := a.item(i)
cp := cp + t.second
t.set_second(cp)
i := i + 1
end
end

make is
local
n: INTEGER
do
last := 42
make_cumulative(homo_sapiens)
make_cumulative(iub)
if argument_count > 0 then
n := argument(1).to_integer
else
n := 1000
end
make_repeat_fasta("ONE", "Homo sapiens alu", alu, n * 2, std_output)
make_random_fasta("TWO", "IUB ambiguity codes", iub, n * 3, std_output)
make_random_fasta("THREE", "Homo sapiens frequency", homo_sapiens, n * 5, std_output)
end

select_random (a: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]]): CHARACTER is
local
r: REAL_64; i: INTEGER; stop: BOOLEAN; t: TUPLE[CHARACTER, REAL_64]
do
r := random(1.0)
from
i := a.lower
until
stop
loop
t := a.item(i)
stop := r < t.second or else i = a.upper
if stop then
Result := t.first
end
i := i + 1
end
end

line_length: INTEGER is 60

make_random_fasta (id, desc: STRING; a: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]]; n: INTEGER; s: OUTPUT_STREAM) is
local
i, j: INTEGER
do
s.put_character('>')
s.put_string(id)
s.put_character(' ')
s.put_string(desc)
s.put_new_line
from
i := n
until
i < 1
loop
from
j := i.min(line_length)
until
j < 1
loop
s.put_character(select_random(a))
j := j - 1
end
s.put_new_line
i := i - line_length
end
end

make_repeat_fasta (id, desc, a: STRING; n: INTEGER; s: OUTPUT_STREAM) is
local
i, j, k, kn: INTEGER
do
s.put_character('>')
s.put_string(id)
s.put_character(' ')
s.put_string(desc)
s.put_new_line
kn := a.count
k := 1
from
i := n
until
i < 1
loop
from
j := i.min(line_length)
until
j < 1
loop
if k > kn then
k := 1
end
io.put_character(a.item(k))
k := k + 1
j := j - 1
end
s.put_new_line
i := i - line_length
end
end
iub: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]]
once
Result := {FAST_ARRAY[TUPLE[CHARACTER, REAL_64]] << ['a', 0.27], ['c', 0.12], ['g', 0.12], ['t', 0.27], ['B', 0.02], ['D', 0.02], ['H', 0.02], ['K', 0.02], ['M', 0.02], ['N', 0.02], ['R', 0.02], ['S', 0.02], ['V', 0.02], ['W', 0.02], ['Y', 0.02] >> }
end

homo_sapiens: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]]
once
Result := {FAST_ARRAY[TUPLE[CHARACTER, REAL_64]] << ['a', 0.3029549426680], ['c', 0.1979883004921], ['g', 0.1975473066391], ['t', 0.3015094502008] >> }
end

make_cumulative (a: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]])
local
cp: REAL_64; i: INTEGER; t: TUPLE[CHARACTER, REAL_64]
do
cp := 0.0
from
i := a.lower
until
i > a.upper
loop
t := a.item(i)
cp := cp + t.second
t.set_second(cp)
i := i + 1
end
end

make
local
n: INTEGER
do
last := 42
make_cumulative(homo_sapiens)
make_cumulative(iub)
if argument_count > 0 then
n := argument(1).to_integer
else
n := 1000
end
make_repeat_fasta("ONE", "Homo sapiens alu", alu, n * 2, std_output)
make_random_fasta("TWO", "IUB ambiguity codes", iub, n * 3, std_output)
make_random_fasta("THREE", "Homo sapiens frequency", homo_sapiens, n * 5, std_output)
end

select_random (a: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]]): CHARACTER
local
r: REAL_64; i: INTEGER; stop: BOOLEAN; t: TUPLE[CHARACTER, REAL_64]
do
r := random(1.0)
from
i := a.lower
until
stop
loop
t := a.item(i)
stop := r < t.second or else i = a.upper
if stop then
Result := t.first
end
i := i + 1
end
end

line_length: INTEGER 60

make_random_fasta (id, desc: STRING; a: FAST_ARRAY[TUPLE[CHARACTER, REAL_64]]; n: INTEGER; s: OUTPUT_STREAM)
local
i, j: INTEGER
do
s.put_character('>')
s.put_string(id)
s.put_character(' ')
s.put_string(desc)
s.put_new_line
from
i := n
until
i < 1
loop
from
j := i.min(line_length)
until
j < 1
loop
s.put_character(select_random(a))
j := j - 1
end
s.put_new_line
i := i - line_length
end
end

make_repeat_fasta (id, desc, a: STRING; n: INTEGER; s: OUTPUT_STREAM)
local
i, j, k, kn: INTEGER
do
s.put_character('>')
s.put_string(id)
s.put_character(' ')
s.put_string(desc)
s.put_new_line
kn := a.count
k := 1
from
i := n
until
i < 1
loop
from
j := i.min(line_length)
until
j < 1
loop
if k > kn then
k := 1
end
io.put_character(a.item(k))
k := k + 1
j := j - 1
end
s.put_new_line
i := i - line_length
end
end

end -- class FASTA
Loading

0 comments on commit 22fbd01

Please sign in to comment.