Class: Lisp::Port

Inherits:
Atom show all
Defined in:
lib/rubylisp/port.rb

Instance Attribute Summary

Attributes inherited from Atom

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Atom

#all?, #apply_to, #car, #cdr, #character?, #class?, #copy, #doc, #environment?, #eof_object?, #eq?, #equal?, #eqv?, #evaluate, #false?, #frame?, #function?, #length, #lisp_object?, #list?, #macro?, #negative?, #number?, #object?, #pair?, #positive?, #primitive?, #print_string, #quoted, #set!, #set_location, #special?, #string?, #symbol?, #true?, #vector?, #zero?

Constructor Details

#initialize(p) ⇒ Port

Returns a new instance of Port.



9
10
11
# File 'lib/rubylisp/port.rb', line 9

def initialize(p)
  @value = p
end

Class Method Details

.with_value(p) ⇒ Object



5
6
7
# File 'lib/rubylisp/port.rb', line 5

def self.with_value(p)
  self.new(p)
end

Instance Method Details

#port?Boolean

Returns:



17
18
19
# File 'lib/rubylisp/port.rb', line 17

def port?
  true
end

#to_sObject



21
22
23
# File 'lib/rubylisp/port.rb', line 21

def to_s
  "<port: #{@value}>"
end

#typeObject



13
14
15
# File 'lib/rubylisp/port.rb', line 13

def type
  :port
end