example work and move README to org-mode with new CL support coming
[CommonLispStat.git] / README.org
blobce366c99dc07d7e7a5f86ead7320758c0c79d443
2 This file will work better with org-mode and David Ito´s
3 org-babel-lisp as well as his hypo approach to literate programming
4 for gaming, as an org-babel extension. [fn:1]
6 * Fast Start
8   You probably did  (preferred)
10 #+begin_src shell
11   git clone git://github.com/blindglobe/common-lisp-stat.git
12 #+end_src
14   or
16 #+begin_src shell
17   git clone git://repo.or.cz/CLS.git
18   git clone http://repo.or.cz/w/CLS.git
19 #+end_src
21   which might be a few revisions behind, and now you should:
23 #+begin_src shell
24   git submodules init
25   git submodules update
26 #+end_src
28   to get the whole package.  However, not all submodules are attached
29   yet (need to do this soon).
31   Make the shared library liblispstat with an ANSI C compiler (only gcc
32   tested at this point):
34 #+begin_src shell
35   cd lib && make && cd
36 #+end_src
38   run a common lisp (SBCL, CMUCL, CLISP, CLOZURE-CL) starting in the
39   current directory.  Recent versions of CFFI and LIFT can be found in
40   the external/ subdirectory, and should be autoload-able, assuming
41   that you are using a Lisp implementation supporting ASDF.
42   (AJR-FIXME: need to upload my GIT mirrors to repo.or.cz or similar,
43   and have them potentially available as submodules if needed)
45   (on Debian or similar systems: can use CLC (Common Lisp Controller)
46   or SBCL approaches, i.e.  ~/.clc/systems or ~/.sbcl/systems should
47   contain softlinks to the cls, cffi, and lift ASDF files
48   (i.e. cls.asd, cffi.asd, and lift.asd).  AJR-FIXME: There is
49   probably a similar incantation for other CL's, need to record that
50   here!).
52   Step through ls-demo.lisp for a range of examples of activities.
54   So basically
55   
56 1. change directory into the CommonLispStat working directory.
57 2. start your lisp
58 3. follow the commands in the ls-demo.lisp file, i.e.
60    a. (asdf:oos 'asdf:load-op 'cls) ;; use ASDF to load lispstat
61    b. (in-package :ls-user)
62    c. (normal-rand 20)
63    d. (setf mytest (normal-rand 20))
64    e. ... (and so on) ...
66    and see if they work (basic CFFI functionality for external C
67    library, LIFT package for unit-testing framework to ensure run time
68    stability).
69   
70 4. Tell me ( mailto:blindglobe@gmail.com ) if there is any thing wrong
71    (or if anything happens to work.
73    CMUCL and SBCL seem to work just fine at this stage.
75    CLISP is finicky regarding the problems that we have with CFFI
76    conversation.  In particular that we can not really do typing that
77    we need to take care of.  I think this is my problem, not someone
78    elses.
80    Need to test ECL.  Clozure-CL seems to work.
82    ===========
84    See Doc/README* for history and design considerations
85    See Doc/INSTALL for getting this to work and run
87    ===========
89    Working on this with git:
91 #+begin_src shell
92    git clone git://repo.or.cz/CommonLispStat.git 
93    cd CommonLispStat
94    git submodules init
95    git submodules update
96 #+end_src
98    will pull the whole repository, and create a "master" branch to
99    work on.  If you are making edits, Probably, you don't want to use
100    the master branch, but more to use a topic-centric branch, so you
101    might:
103 #+begin_src shell
104     git checkout -b myTopicBranch
105 #+end_src
107 and then work on myTopicBranch, pulling back to the master branch when
108 needed by
110 #+begin_src shell
111     git checkout master
112     git pull . myTopicBranch
113 #+end_src
116 #+begin_src shell
117     git rebase myTopicBranch
118 #+end_src
121 of course, perhaps you want to contribute to the mob branch.   For
122 that, after cloning the repository as above, you would:
124 #+begin_src shell
125     git checkout -b mob remotes/origin/mob
126 #+end_src
128 (work, work, work... through a cycle of
130 #+begin_src shell
131          <edit>
132          git add <files just edited>
133          git commit -m "what I just did"
134 #+end_src
136  ad-nauseum.  When ready to commit, then just:
138 #+begin_src shell
139      git push git+ssh://mob@repo.or.cz/srv/git/CommonLispStat.git mob:mob
140 #+end_src
144 and it'll be put on the mob branch, as a proposal for merging.
146 Another approach would be to pull from the topic branch into the mob
147 branch before uploading.   Will work on a formal example soon.
149 (the basic principle is that instead of the edit cycle on mob, do
150 something like:
152 #+begin_src shell
153   git checkout mob
154   git pull . myTopicBranch   
155   git push git+ssh://mob@repo.or.cz/srv/git/CommonLispStat.git mob:mob
156 #+end_src
160 Alternatively, one can work on the github repositories as well.  They
161 are a bit differently organized, and require one to get a github
162 account and work from there.  In that case, you'd need to D/L the
163 libraries. 
165 That gets a bit tricky, but see ./bin/GetRepos.sh for an example. 
167 ===========
169 I've started putting examples of use in function documentation.   If
170 you are a lisp'er, you'll find this pendantic and insulting.  Many of
171 the uses are trivial.  However, this has been tested out on a number
172 of research statisticians (the primary user audience) and found
173 useful.
175 Still need to write the (run-doc-ex 'function-name)  function, which
176 would print out the example and run it live.  Hopefully with the same
177 results.  I've used XML markup for this, but for no particular reason,
178 we could have used SEXPs as well.   This is currently done by using an
179 <example> tag set, as in
180     <example>
181     (progn
182        (example-code-for-function))
183     </example>
185 ===========
188 * Footnotes
190 [fn:1] I´m not including instructions for Emacs or git, as the former
191 is dealt with other places and the latter was required for you to get
192 this.  Since disk space is cheap, I´m intentionally forcing git to be
193 part of this system.  Sorry if you hate it.  Org-mode, org-babel, and
194 org-babel-lisp, and hypo are useful for making this file a literate
195 and interactively executable piece of work.