From 6eb9cf17f161522d4eddf6783284952f8a84f099 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 15 Apr 2018 02:24:27 -0400 Subject: - Fixes for R back-end. --- new-luxc/source/luxc/lang/translation/r/eval.jvm.lux | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/r/eval.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux index c026750a7..5685ae05e 100644 --- a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux @@ -81,7 +81,7 @@ (Long::intValue [])) (: Top (if (host.instance? Null flag) - host.null + (host.null) //.unit)) value]))) @@ -90,9 +90,14 @@ (do e.Monad [high (ListVector::get-field-sexp [//.int-high-field] host-object) low (ListVector::get-field-sexp [//.int-low-field] host-object) - #let [high (:! Nat (IntArrayVector::getElementAsInt [0] (:! IntArrayVector high))) - low (:! Nat (IntArrayVector::getElementAsInt [0] (:! IntArrayVector low)))]] - (wrap (|> high (bit.shift-left +32) (n/+ low) nat-to-int)))) + #let [get-int-32 (|>> (IntArrayVector::getElementAsInt [0]) (:! Nat)) + high (get-int-32 (:! IntArrayVector high)) + low (get-int-32 (:! IntArrayVector low))]] + (wrap (:! Int + (n/+ (|> high (bit.shift-left +32)) + (if (i/< 0 (:! Int low)) + (|> low (bit.shift-left +32) (bit.shift-right +32)) + low)))))) (def: (lux-object host-object) (-> Object (Error Top)) -- cgit v1.2.3