source: project/wiki/notes-on-chicken.h @ 31089

Last change on this file since 31089 was 31089, checked in by arthurmaciel, 6 years ago
File size: 2.8 KB
Line 
1== Notes on {{chicken.h}} file
2
3[[toc:]]
4
5=== Disclaimer
6
7This page is a modest primer for reading the [[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=blob;f=chicken.h;h=f5a103ee14314f7c679e01dd8e11c0404043791a;hb=HEAD|{{chicken.h}}]] header file. By no means it is intended to be a comprehensive guide for understanding chicken source. Please consider reading [[Internals]] for a more in-depth understanding of how Chicken works. Feel free to make suggestions to [[/users/arthurmaciel|Arthur]] or edit this page directly.
8
9=== Purpose
10
11As stated at its beginning, [[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=blob;f=chicken.h;h=f5a103ee14314f7c679e01dd8e11c0404043791a;hb=HEAD|{{chicken.h}}]] is a general headerfile for compiler generated executables.
12
13=== License and copyright
14
15The file is licensed under the [[http://opensource.org/licenses/BSD-3-Clause|3-clause BSD license]] and nowadays The Chicken Team retains its copyright.
16
17=== Language
18
19[[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=blob;f=chicken.h;h=f5a103ee14314f7c679e01dd8e11c0404043791a;hb=HEAD|{{chicken.h}}]] is implemented in {{C}} programming language. If you don't know {{C}}, it is strongly advised to study it before proceeding. On {{#chicken}} some resources were pointed out:
20* {{##C}} IRC channel wiki: [[http://www.iso-9899.info/wiki/Main_Page]]
21* {{C syntax}} topic on wikipedia: [[http://en.wikipedia.org/wiki/C_syntax]]
22
23=== Coding conventions
24
25There are some conventions regarding variables and function names:
26; Predicates : {{p}} at the end of function names generally means {{predicate}} as in [[http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node69.html|Common Lisp]].We can see a bunch of examples from line [[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=blob;f=chicken.h;h=f5a103ee14314f7c679e01dd8e11c0404043791a;hb=HEAD#l1163|1163]] to 1198. Ex.: {{C_truep(x)}} would be in Scheme equivalent to {{true?}} in {{(define (true? x) (if x #t #f))}}, but returning {{1}} for {{#t}} and {{0}} for {{false}}.
27
28
29=== External configuration
30
31On line [[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=blob;f=chicken.h;h=f5a103ee14314f7c679e01dd8e11c0404043791a;hb=HEAD#l62|62]] {{chicken-config.h}} file is included. We can see that Makefiles fill this file with many options that will be used by {{chicken.h}}, according to the machine/platform/system environment. For comparison, see how [[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=blob;f=Makefile.linux;h=010b560eea074dae1da63627e6c83f09b1733263;hb=HEAD|{{Makefile.linux}}]] and [[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=blob;f=Makefile.mingw-msys;h=2af2dc17b5794df796782dd787baed474d897364;hb=HEAD|{{Makefile.mingw-msys}}]] differ regarding to their options (lines 61 and 82 respectively).
32
33
34
35
36
37
38
39
Note: See TracBrowser for help on using the repository browser.