Guest User

Untitled

a guest
Apr 18th, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.   function scheme_make_list_int (array) result (list)
  3.     use scm, only: scm_t, scm_list, scm_cons, scm_from_int
  4.     implicit none
  5.     integer(IK), intent(in) :: array(:)
  6.     type(scm_t) :: list
  7.     ! *** end of interface ***
  8.  
  9.     ! FIXME: Intel compiler has  troubles assembling the final list in
  10.     ! the result directly. Introduce temp var:
  11.     type(scm_t) :: temp
  12.     integer :: i
  13.  
  14.     temp = scm_list ()
  15.     do i = size (array), 1, -1
  16.        temp = scm_cons (scm_from_int (array (i)), temp)
  17.     enddo
  18.     list = temp
  19.   end function scheme_make_list_int
  20.  
  21. type, public, bind(c) :: scm_t
  22.    private
  23.    integer(c_intptr_t) :: ptr
  24. end type scm_t
Advertisement
Add Comment
Please, Sign In to add comment