Module: Nydp::Helper
- Included in:
- Assignment, Builtin::Apply, Builtin::Ensuring, Builtin::IsPair, Builtin::Millisecs, Builtin::ThreadLocals, Compiler, Cond, Cond, ExecuteConditionalInstruction, FunctionInvocation, InterpretedFunction, InterpretedFunction, Pair, Pair, SymbolLookup, VM
- Defined in:
- lib/nydp/helper.rb
Instance Method Summary collapse
- #cons(a, b = Nydp.NIL) ⇒ Object
- #list(*args) ⇒ Object
- #literal?(expr) ⇒ Boolean
- #pair?(expr) ⇒ Boolean
- #sym(name, ns) ⇒ Object
- #sym?(expr, name) ⇒ Boolean
Instance Method Details
#cons(a, b = Nydp.NIL) ⇒ Object
11 12 13 |
# File 'lib/nydp/helper.rb', line 11 def cons a, b=Nydp.NIL Nydp::Pair.new a, b end |
#list(*args) ⇒ Object
15 16 17 |
# File 'lib/nydp/helper.rb', line 15 def list *args Nydp::Pair.from_list args end |
#literal?(expr) ⇒ Boolean
23 24 25 26 27 28 29 30 |
# File 'lib/nydp/helper.rb', line 23 def literal? expr case expr when String, Float, Integer, Fixnum, Nydp.NIL, Nydp::Symbol, Nydp::StringAtom, Nydp::Truth, Nydp::Nil true else false end end |
#pair?(expr) ⇒ Boolean
7 8 9 |
# File 'lib/nydp/helper.rb', line 7 def pair? expr expr.is_a?(Nydp::Pair) end |