전제 조건에서 배열을 반복하고 싶습니다. 하지만 전제 조건에서는 "보낸 사람"및 "건너 뛰기"구문을 사용할 수 없습니다.사전 조건으로 배열을 반복하는 방법은 무엇입니까?
전제 조건에서 배열을 반복 할 방법이 있습니까?
insert_last (s: STRING)
require
new_is_longer_than_prevs:
-- here I want to iterate through array "arr" and if length of s is longer than all other previously stored string values in array
do
arr.force (s, arr.upper + 1)
end
참. 내 답장을 편집하여 1을 위아래로 변경합니다. –
@LouisM, 예, 이제는 모든 '하위'값에 대해 작동합니다. –