
Untitled
By: a guest on
Apr 18th, 2012 | syntax:
Fortran | size: 0.66 KB | hits: 19 | expires: Never
function scheme_make_list_int (array) result (list)
use scm, only: scm_t, scm_list, scm_cons, scm_from_int
implicit none
integer(IK), intent(in) :: array(:)
type(scm_t) :: list
! *** end of interface ***
! FIXME: Intel compiler has troubles assembling the final list in
! the result directly. Introduce temp var:
type(scm_t) :: temp
integer :: i
temp = scm_list ()
do i = size (array), 1, -1
temp = scm_cons (scm_from_int (array (i)), temp)
enddo
list = temp
end function scheme_make_list_int
type, public, bind(c) :: scm_t
private
integer(c_intptr_t) :: ptr
end type scm_t