Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 18th, 2012  |  syntax: Fortran  |  size: 0.66 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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