in
returnUs (\xs -> assign : xs)
+primCode [lhs] (IndexOffForeignObjOp pk) [obj, ix]
+ = let
+ lhs' = amodeToStix lhs
+ obj' = amodeToStix obj
+ ix' = amodeToStix ix
+ obj'' = StIndex PtrRep obj' foHS
+ assign = StAssign pk lhs' (StInd pk (StIndex pk obj'' ix'))
+ in
+ returnUs (\xs -> assign : xs)
+
primCode [] (WriteByteArrayOp pk) [obj, ix, v]
= let
obj' = amodeToStix obj
let base = amodeToStix' x
in
case getAmodeRep x of
- ArrayRep -> StIndex PtrRep base mutHS
- ByteArrayRep -> StIndex IntRep base dataHS
- ForeignObjRep -> error "ERROR: native-code generator can't handle ForeignObjs (yet): use -fvia-C!"
+ ArrayRep -> StIndex PtrRep base mutHS
+ ByteArrayRep -> StIndex IntRep base dataHS
+ ForeignObjRep -> StIndex PtrRep base foHS
+ {-error "ERROR: native-code generator can't handle ForeignObjs (yet): use -fvia-C!"-}
_ -> base
\end{code}