~ubuntu-branches/ubuntu/wily/julia/wily

« back to all changes in this revision

Viewing changes to doc/manual/calling-c-and-fortran-code.rst

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-11-17 19:32:52 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20131117193252-tkrpclguqqebqa35
Tags: 0.2.0+dfsg-3
testsuite-i386.patch: loosen the numerical precision for yet another test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    Int32
66
66
 
67
67
``clock`` takes no arguments and returns an ``Int32``. One common gotcha
68
 
is that a 1-tuple must be written with with a trailing comma. For
 
68
is that a 1-tuple must be written with a trailing comma. For
69
69
example, to call the ``getenv`` function to get a pointer to the value
70
70
of an environment variable, one makes a call like this::
71
71
 
339
339
and should be posted as a bug so that it can be resolved.
340
340
 
341
341
If the pointer of interest is a plain-data array (bitstype or immutable), the
342
 
function ``pointer_to_array(ptr,dims,[own])`` may be more more useful. The final
 
342
function ``pointer_to_array(ptr,dims,[own])`` may be more useful. The final
343
343
parameter should be true if Julia should "take ownership" of the underlying
344
344
buffer and call ``free(ptr)`` when the returned ``Array`` object is finalized.
345
345
If the ``own`` parameter is omitted or false, the caller must ensure the
377
377
 
378
378
A ``(name, library)`` function specification must be a constant expression.
379
379
However, it is possible to use computed values as function names by staging
380
 
through ``eval`` as follows:
 
380
through ``eval`` as follows::
381
381
 
382
382
    @eval ccall(($(string("a","b")),"lib"), ...
383
383