Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.
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]

Instance methods

Note: work on List methods is ongoing.

List#[]

  • Ruby equivalent: Array#[]
  • Erlang equivalent: lists:nth/2, lists:seq/2
  • Implemented: partial

Retrieve the nth element of a list.

List#all? [{|obj| block}] → true or false

  • Ruby equivalent: Enumerable#all?
  • Erlang equivalent: lists:all/2
  • Implemented: partial

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.)

Clone this wiki locally