Class: Array

Inherits:
Object show all
Defined in:
lib/spectator/emacs.rb

Instance Method Summary collapse

Instance Method Details

#to_lispObject

Returns a string that represents the array as a lisp list.

Example:

[:foo, 123, "bar"].to_lisp => '(foo 123 "bar")'


64
65
66
67
# File 'lib/spectator/emacs.rb', line 64

def to_lisp
  sexp_array = map { |el| el.to_lisp }
  "(#{sexp_array.join ' '})"
end