Class: Nydp::Builtin::LessThan
- Inherits:
-
Object
- Object
- Nydp::Builtin::LessThan
show all
- Includes:
- Base, Singleton
- Defined in:
- lib/nydp/builtin/less_than.rb
Instance Method Summary
collapse
Methods included from Base
#builtin_invoke_1, #builtin_invoke_2, #builtin_invoke_3, #builtin_invoke_4, #handle_error, #inspect, #invoke, #invoke_1, #invoke_2, #invoke_3, #invoke_4, #nydp_type, #to_s
Methods included from Helper
#cons, #list, #literal?, #pair?, #sig, #sym, #sym?
Methods included from Converter
#n2r, #r2n
Instance Method Details
#builtin_invoke(vm, args) ⇒ Object
4
5
6
|
# File 'lib/nydp/builtin/less_than.rb', line 4
def builtin_invoke vm, args
vm.push_arg(less_than(args.car, args.cdr) || Nydp::NIL)
end
|
#less_than(arg, args) ⇒ Object
8
9
10
11
|
# File 'lib/nydp/builtin/less_than.rb', line 8
def less_than arg, args
return arg if Nydp::NIL.is? args
(arg < args.car) && less_than(args.car, args.cdr)
end
|
13
|
# File 'lib/nydp/builtin/less_than.rb', line 13
def name ; "<" ; end
|