lib/nydp/builtin/divide.rb in nydp-0.5.1 vs lib/nydp/builtin/divide.rb in nydp-0.6.0
- old
+ new
@@ -1,17 +1,10 @@
class Nydp::Builtin::Divide
include Nydp::Builtin::Base, Singleton
- def builtin_invoke vm, args
- vm.push_arg divide(args.cdr, args.car)
- end
+ def name ; "/" ; end
- def divide args, accum
- if Nydp::NIL.is? args
- accum
- else
- divide(args.cdr, (accum / args.car))
- end
+ def builtin_call *args
+ (args.reduce &:/)._nydp_wrapper
end
- def name ; "/" ; end
end