Module: Rouge::Seq
- Defined in:
- lib/rouge/seq.rb
Overview
Functions, clases and modules concerning the ‘seq’ sequence abstraction.
Defined Under Namespace
Modules: ASeq, ISeq Classes: Array, Cons, Lazy
Constant Summary collapse
- Empty =
An empty seq.
Object.new
- UnknownSeqError =
An error thrown when we try to do a seq operation on something that’s not seqable.
Class.new(StandardError)
Class Method Summary collapse
Class Method Details
.seq(form) ⇒ Object
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/rouge/seq.rb', line 276 def self.seq(form) case form when ISeq form.seq when NilClass form when ::Array if form.empty? nil else Rouge::Seq::Array.new(form, 0) end when Hash, Set, Enumerator seq(form.to_a) when String seq(form.chars) else raise UnknownSeqError, form.inspect end end |