Changeset 35531 in project


Ignore:
Timestamp:
05/08/18 17:43:00 (5 months ago)
Author:
felix
Message:

man/5: fixed links, some additions and improvements

Location:
wiki/man/5
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • wiki/man/5/Accessing external objects

    r35529 r35531  
    77For a list of the special forms that allow definition of Scheme procedures
    88that access native C/C++ code, consult the documentation on the
    9 [[(chicken foreign)|Module (chicken foreign)]] module. The remainder
     9[[Module (chicken foreign)|(chicken foreign)]] module. The remainder
    1010of this chapter merely explains a few special cases.
    1111
     
    1313
    1414When you call a C function which needs to return quantities of data, several issues arise:
    15 * the size of the nursery is limited, so C_alloc can cause stack overflow
     15* the size of the nursery is limited, so {{C_alloc}} can cause stack overflow
    1616* if you malloc in C, and intend to leave it there, and directly access parts of that data from Scheme, you will need C accessor functions to pinpoint the parts you need and return them as Scheme objects; you will also need a finalizer if you intend for this data to be garbage-collected
    1717* building up lists or other complex Scheme structures from individual pairs, or putting non-immediate objects into vectors, is cumbersome in C
    1818
    19 So some would advise you to just return a pointer to Scheme, use memcpy or any other function(s) which you need to get the data into CHICKEN-managed memory and into the desired kind of data structure, then free the C data.  For this example, we are trying to return an array of doubles into an f64vector; we can accomplish that by adding a specialized copy function to the C library being integrated:
     19So some would advise you to just return a pointer to Scheme, use memcpy or any other function(s) which you need to get the data into CHICKEN-managed memory and into the desired kind of data structure, then free the C data.  For this example, we are trying to return an array of doubles into an {{f64vector}}; we can accomplish that by adding a specialized copy function to the C library being integrated:
    2020
    2121<enscript highlight=C>
  • wiki/man/5/Acknowledgements

    r35318 r35531  
    4040Robin Lee Powell, Alan Post, "Pupeno", Davide Puricelli, "presto",
    4141Doug Quale, Imran Rafique, Eric Raible, Ivan Raikov, Santosh Rajan,
    42 Joel Reymont, "rivo", Chris Roberts, Eric Rochester, Paul Romanchenko,
     42Peder Refnes, Joel Reymont, "rivo", Chris Roberts, Eric Rochester,
     43Paul Romanchenko,
    4344Andreas Rottman, David Rush, Lars Rustemeier, Daniel Sadilek,
    4445Otavio Salvador, Burton Samograd, "Sandro", "satori", Aleksej Saushev,
     
    7879; Olin Shivers : implementation of {{let-optionals[*]}}.
    7980
    80 The documentation and examples for explicit renaming macros was taken from
    81 the following paper:
    82 
    83 William D. Clinger.
    84 [[ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/prop/exrename.ps.gz|''Hygienic macros through explicit renaming'']].
    85 Lisp Pointers. IV(4). December 1991.
    86 
    8781---
    8882Previous: [[faq|FAQ]]
  • wiki/man/5/Bibliography

    r34157 r35531  
    99R. P. Brent, P. Zimmermann: ''Modern Computer Arithmetic'' [[https://members.loria.fr/PZimmermann/mca/pub226.html]]
    1010
     11William D. Clinger: ''Hygienic macros through explicit renaming'', Lisp Pointers. IV(4). December 1991
     12[[ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/prop/exrename.ps.gz]].
     13
     14
    1115---
    1216Previous: [[Acknowledgements]]
  • wiki/man/5/C interface

    r35529 r35531  
    4444
    4545Is {{x}} an immediate object?
    46 (see [[#constructors-for-immediate-scheme-objects|below]] for a definition)
     46(see below for a definition)
    4747
    4848===== C_fitsinfixnump
  • wiki/man/5/Cross development

    r35525 r35531  
    244244----
    245245Previous: [[Deployment]]
    246 Next: [[Bugs and limitation]]
     246
     247Next: [[Bugs and limitations]]
  • wiki/man/5/Data representation

    r35318 r35531  
    163163Previous: [[C interface]]
    164164
    165 Next: [[Extensions]]
     165Next: [[Modules]]
  • wiki/man/5/Declarations

    r35466 r35531  
    365365Previous: [[Types]]
    366366
    367 Next: [[Included modules]]
     367Next: [[Extensions]]
  • wiki/man/5/Deployment

    r35528 r35531  
    2424
    2525The simplest form of deployment is the single executable. The runtime
    26 library ({{libchicken.so}} or {{libchicken.dll}}) is required for these
     26library ({{libchicken.so}}, {{libchicken.dylib}} or {{libchicken.dll}}) is required for these
    2727programs to run, unless you link your application statically:
    2828
     
    170170
    171171---
    172 Previous: [[Units and the linking model]]
     172Previous: [[Units and linking model]]
    173173
    174174Next: [[Cross development]]
  • wiki/man/5/Egg specification format

    r35525 r35531  
    290290[egg property] (dependencies NAME ...)
    291291
    292 Specifies dependencies between components. Note that this use
     292Specifies dependencies to additional source files. {{NAME ...}} must
     293denote filenames of which the program or extension depends.
     294A program or extension implicitly depends on its source file and
     295and on the egg-specification file.
     296
     297Note that this use
    293298of the {{dependencies}} property is different from the property
    294299of the same name that is used at the "global" level of the
     
    324329Previous: [[Extension tools]]
    325330
    326 Next: [[Units and the linking model]]
     331Next: [[Units and linking model]]
  • wiki/man/5/Embedding

    r35529 r35531  
    6565Scheme program.
    6666
    67 === return-to-host
    68 
    69 TODO: This has been documented under (chicken platform)
    70 
    71 The {{eval}} library unit also provides boilerplate callbacks, that
    72 simplify invoking Scheme code embedded in a C or C++ application:
    73 
    74 <procedure>(return-to-host)</procedure>
    75 
    76 Exits the Scheme code and returns to the invoking context that called {{CHICKEN_run}}
    77 or {{CHICKEN_continue}}.
    78 
    79 After {{return-to-host}} has been executed and once {{CHICKEN_run}} returns,
    80 you can invoke callbacks which have been defined with {{define-external}}.
    81 
    82 The {{eval}} library unit also provides boilerplate callbacks, that simplify invoking Scheme
    83 code embedded in a C or C++ application:
    84 
    8567=== CHICKEN_eval
    8668
  • wiki/man/5/Extension tools

    r35525 r35531  
    231231; {{-repository}} : print path to egg repository
    232232; {{-override FILENAME}} : override versions for installed eggs with information given in {{FILENAME}}, which can be generated by {{-scan}} or by the {{-list}} option of the {{chicken-status}} program
    233 : {{-from-list FILENAME}} : install eggs given in {{FILENAME}}, in the same format as produced by the {{-list}} option in {{chicken-status}}; this option may be given multiple times
     233; {{-from-list FILENAME}} : install eggs given in {{FILENAME}}, in the same format as produced by the {{-list}} option in {{chicken-status}}; this option may be given multiple times
    234234; {{-v   -verbose}} : be verbose
    235235
  • wiki/man/5/Module scheme

    r35529 r35531  
    14741474
    14751475Implementations of Scheme are not required to implement the whole
    1476 tower of subtypes given under "[[#numerical-types|Numerical types]]",
     1476tower of subtypes given under "[[#Numerical types|Numerical types]]",
    14771477but they must implement a coherent subset consistent with both the
    14781478purposes of the implementation and the spirit of the Scheme
     
    15981598; {{obj}} : any object
    15991599; {{list, list1, ... listj, ... list : (see "[[#pairs-and-lists|Pairs and lists]]" below)
    1600 ; {{z, z1, ... zj, ...}} : complex number (currently not supported by CHICKEN core, see the "[[/egg/numbers|numbers]]" egg)
     1600; {{z, z1, ... zj, ...}} : complex number
    16011601; {{x, x1, ... xj, ...}} : real number
    16021602; {{y, y1, ... yj, ...}} : real number
    1603 ; {{q, q1, ... qj, ...}} : rational number (NOTE: fractional numbers are not supported by CHICKEN core, see the "[[/egg/numbers|numbers]]" egg)
     1603; {{q, q1, ... qj, ...}} : rational number
    16041604; {{n, n1, ... nj, ...}} : integer
    16051605; {{k, k1, ... kj, ...}} : exact non-negative integer
     
    26922692of string beginning with index start (inclusive) and ending with index
    26932693end (exclusive). The {{end}} argument is optional and defaults to the
    2694 length of the string.
     2694length of the string, this is a non-standard extension in CHICKEN.
    26952695
    26962696<procedure>(string-append string ...)</procedure><br>
  • wiki/man/5/Modules

    r35529 r35531  
    2525modules that export or import the same toplevel binding.
    2626
    27 A module is initially empty (has no visible bindings). You must at least
     27A module is initially empty (has no visible bindings with the exception
     28of  {{import}} and {{cond-expand}}). You must at least
    2829import the {{scheme}} module to do anything useful. To access any
    2930of the non-standard macros and procedures, import the {{(chicken base)}}
    30 module.
     31module. 
    3132
    3233CHICKEN's module system has the following features:
     
    3637* Imports can be lexically scoped
    3738* Parameterized modules are supported
     39
     40At toplevel and outside of a module, the initially available bindings
     41are everything that is exported from the [[Module scheme|scheme]],
     42[[Module (chicken base)|(chicken base)]] and
     43[[Module (chicken syntax)|(chicken syntax)]] modules.
    3844
    3945
  • wiki/man/5/Units and linking model

    r35525 r35531  
    7171----
    7272Previous: [[Egg specification format]]
     73
    7374Next: [[Deployment]]
Note: See TracChangeset for help on using the changeset viewer.