Class: Skeem::SkmFormals
- Inherits:
-
Object
- Object
- Skeem::SkmFormals
- Defined in:
- lib/skeem/s_expr_nodes.rb
Overview
class
Instance Attribute Summary collapse
-
#arity ⇒ Object
readonly
Returns the value of attribute arity.
-
#formals ⇒ Object
readonly
Returns the value of attribute formals.
Instance Method Summary collapse
- #evaluate(aRuntime) ⇒ Object
-
#initialize(theFormals, arityKind) ⇒ SkmFormals
constructor
A new instance of SkmFormals.
- #nullary? ⇒ Boolean
- #required_arity ⇒ Object
- #variadic? ⇒ Boolean
Constructor Details
#initialize(theFormals, arityKind) ⇒ SkmFormals
Returns a new instance of SkmFormals.
520 521 522 523 |
# File 'lib/skeem/s_expr_nodes.rb', line 520 def initialize(theFormals, arityKind) @formals = theFormals arity_set(arityKind) end |
Instance Attribute Details
#arity ⇒ Object (readonly)
Returns the value of attribute arity.
517 518 519 |
# File 'lib/skeem/s_expr_nodes.rb', line 517 def arity @arity end |
#formals ⇒ Object (readonly)
Returns the value of attribute formals.
516 517 518 |
# File 'lib/skeem/s_expr_nodes.rb', line 516 def formals @formals end |
Instance Method Details
#evaluate(aRuntime) ⇒ Object
525 526 527 |
# File 'lib/skeem/s_expr_nodes.rb', line 525 def evaluate(aRuntime) formals.map! { |param| param.evaluate(aRuntime) } end |
#nullary? ⇒ Boolean
529 530 531 |
# File 'lib/skeem/s_expr_nodes.rb', line 529 def nullary? arity.nullary? end |
#required_arity ⇒ Object
537 538 539 |
# File 'lib/skeem/s_expr_nodes.rb', line 537 def required_arity (arity.high == '*') ? arity.low : arity.high end |
#variadic? ⇒ Boolean
533 534 535 |
# File 'lib/skeem/s_expr_nodes.rb', line 533 def variadic? arity.variadic? end |