This repository was archived by the owner on Apr 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
List
tarcieri edited this page Feb 12, 2011
·
8 revisions
Lists are immutable and singly linked. A list literal looks like:
[1,2,3,4,5]Note: work on List methods is ongoing.
- Ruby equivalent: Array#[]
- Erlang equivalent: lists:nth/2, lists:seq/2
- Implemented: partial
- Notes: Currently only supports simple index lookups
Retrieve the nth element of a list.
- Ruby equivalent: Enumerable#all?
- Erlang equivalent: lists:all/2
- Implemented: partial
- Notes: Currently only supports lists:all/2 behavior
Passes each element of the collection to the given block. The method returns true if the block never returns false or nil. If the block is not given, an implicit block of {|obj| obj} is used (that is all? will return true only if none of the collection members are false or nil.)
- Ruby equivalent: Enumerable#any?
- Erlang equivalent: lists:any/2
- Implemented: partial
- Notes: Currently only supports lists:any/2 behavior
Passes each element of the collection to the given block. The method returns true if the block ever returns a value other than false or nil. If the block is not given, an implicit block of {|obj| obj} is used (that is any? will return true if at least one of the collection members is not false or nil.