Class: Ikra::Symbolic::ArrayIdentityCommand
- Includes:
- ArrayCommand
- Defined in:
- lib/symbolic/visitor.rb,
lib/symbolic/symbolic.rb
Constant Summary collapse
- Block =
Proc.new do |element| element end
- @@unique_id =
1
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Attributes included from ArrayCommand
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #base_type ⇒ Object
- #execute ⇒ Object
-
#externals ⇒ Object
Returns a collection of external objects that are accessed within a parallel section.
-
#initialize(target) ⇒ ArrayIdentityCommand
constructor
A new instance of ArrayIdentityCommand.
- #size ⇒ Object
Methods included from ArrayCommand
#[], #ast, #block_parameter_names, #lexical_externals, #pmap, #to_command
Constructor Details
#initialize(target) ⇒ ArrayIdentityCommand
Returns a new instance of ArrayIdentityCommand.
191 192 193 194 195 196 197 198 |
# File 'lib/symbolic/symbolic.rb', line 191 def initialize(target) super() @target = target # Ensure that base array cannot be modified target.freeze end |
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
183 184 185 |
# File 'lib/symbolic/symbolic.rb', line 183 def target @target end |
Instance Method Details
#accept(visitor) ⇒ Object
22 23 24 |
# File 'lib/symbolic/visitor.rb', line 22 def accept(visitor) visitor.visit_array_identity_command(self) end |
#base_type ⇒ Object
213 214 215 216 217 218 219 220 221 222 |
# File 'lib/symbolic/symbolic.rb', line 213 def base_type # TODO: add caching (@target is frozen) type = Types::UnionType.new @target.each do |element| type.(element.class.to_ikra_type) end type end |
#execute ⇒ Object
200 201 202 |
# File 'lib/symbolic/symbolic.rb', line 200 def execute @target end |
#externals ⇒ Object
Returns a collection of external objects that are accessed within a parallel section. This includes all elements of the base array.
209 210 211 |
# File 'lib/symbolic/symbolic.rb', line 209 def externals lexical_externals.keys + @target end |
#size ⇒ Object
204 205 206 |
# File 'lib/symbolic/symbolic.rb', line 204 def size @target.size end |