PyF95++/STL/AList
From blockit
Contents |
Why AList?
Do you guys like cutesy names? Do you like to remind me that this list may be one of several by prepending an indefinite article? Of course not. The "A" denotes that this is an array-based linked-list. "list" is also a keyword in Python and to avoid any remote chance of confusion between the uppercase "List" and the builtin lowercase "list", an "A" was prepended. This occurs elsewhere, for instance "AModule".
API
init
function init(this, capacity) result(err) as init
iterate
function iterate(this, value) result(b) as iterate
resetIteration
subroutine resetIteration(this) as resetIteration
length
function length(this) result(lng) as length
push
function push(this, item) result(err) as push
popBack
function popBack(this, item) result(err) as popBack
isEmpty
function isEmpty(this) result(b) as isEmpty
clear
function clear(this) result(err) as clear
get
function get(this, obj, idx) result(err) as get
refCount
function refCount(this) result(ref) as refCount
mergeSort
subroutine mergeSort(this) as mergeSort
delete
function delete(this) result(err) as delete
<=
function lessThanEqualTo_(this, other) result(b) as operator(<=)
>=
function greaterThanEqualTo_(this, other) result(b) as operator(>=)
>
function greaterThan_(this, other) result(b) as operator(>)
<
function lessThan_(this, other) result(b) as operator(<)
.is.
function is_(this, other) result(b) as operator(.is.)
=
subroutine equals_(this, other) as assignment(=)
Examples
Basic Example
program AList_Example autouse end autouse implicit none type(AList<integer>) :: intList end program AList_Example
A More Complicated Example
This example demonstrates the development of a list of a user-defined type.
program AList_Example2
autouse
end autouse
implicit none
type derType
integer :: flag
real, dimension(100) :: values
end type
type(AList<derType>) :: derList
end program AList_Example2
