From 5522c2c91e4404b03fabed3b582b046f592af673 Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Wed, 7 Jul 2010 10:12:01 +0200 Subject: [PATCH] example work and move README to org-mode with new CL support coming --- README.org | 137 ++++++++++++++++++++++++++----------------- TODO.lisp | 47 +++++++++++---- examples/00-loadingData.lisp | 10 +++- examples/01-basicEDA.lisp | 9 ++- 4 files changed, 132 insertions(+), 71 deletions(-) diff --git a/README.org b/README.org index dc1a5f8..ce366c9 100644 --- a/README.org +++ b/README.org @@ -1,53 +1,57 @@ --*- mode: text -*- -MOSTLY WRONG, NEEDS UPDATE. +This file will work better with org-mode and David Ito´s +org-babel-lisp as well as his hypo approach to literate programming +for gaming, as an org-babel extension. [fn:1] +* Fast Start -For a fast start: + You probably did (preferred) -You probably did: +#+begin_src shell + git clone git://github.com/blindglobe/common-lisp-stat.git +#+end_src - git clone git://repo.or.cz/CLS.git -(or perhaps: - git clone http://repo.or.cz/w/CLS.git -) - -or + or - git clone git://github.com/blindglobe/common-lisp-stat.git +#+begin_src shell + git clone git://repo.or.cz/CLS.git + git clone http://repo.or.cz/w/CLS.git +#+end_src -and now you should: + which might be a few revisions behind, and now you should: - git submodules init - git submodules update +#+begin_src shell + git submodules init + git submodules update +#+end_src -to get the whole package. However, not all submodules are attached -yet! Will need to load + to get the whole package. However, not all submodules are attached + yet (need to do this soon). -Make the shared library liblispstat with an ANSI C compiler (only gcc -tested at this point): + Make the shared library liblispstat with an ANSI C compiler (only gcc + tested at this point): - cd lib - make +#+begin_src shell + cd lib && make && cd +#+end_src -run a common lisp (SBCL, CMUCL, CLISP, CLOZURE-CL) starting in the -current directory. Recent versions of CFFI and LIFT can be found in -the external/ subdirectory, and should be autoload-able, assuming that -you are using a Lisp implementation supporting ASDF. (AJR-FIXME: need -to upload my GIT mirrors to repo.or.cz or similar, and have them -potentially available as submodules if needed) + run a common lisp (SBCL, CMUCL, CLISP, CLOZURE-CL) starting in the + current directory. Recent versions of CFFI and LIFT can be found in + the external/ subdirectory, and should be autoload-able, assuming + that you are using a Lisp implementation supporting ASDF. + (AJR-FIXME: need to upload my GIT mirrors to repo.or.cz or similar, + and have them potentially available as submodules if needed) -(on Debian or similar systems: can use CLC (Common Lisp Controller) or -SBCL approaches, i.e. ~/.clc/systems or ~/.sbcl/systems should -contain softlinks to the cls, cffi, and lift ASDF files -(i.e. cls.asd, cffi.asd, and lift.asd). AJR-FIXME: There is -probably a similar incantation for other CL's, need to record that -here!). + (on Debian or similar systems: can use CLC (Common Lisp Controller) + or SBCL approaches, i.e. ~/.clc/systems or ~/.sbcl/systems should + contain softlinks to the cls, cffi, and lift ASDF files + (i.e. cls.asd, cffi.asd, and lift.asd). AJR-FIXME: There is + probably a similar incantation for other CL's, need to record that + here!). -Step through ls-demo.lisp for a range of examples of activities. - + Step through ls-demo.lisp for a range of examples of activities. -So basically .. + So basically 1. change directory into the CommonLispStat working directory. 2. start your lisp @@ -66,59 +70,74 @@ So basically .. 4. Tell me ( mailto:blindglobe@gmail.com ) if there is any thing wrong (or if anything happens to work. -CMUCL and SBCL seem to work just fine at this stage. + CMUCL and SBCL seem to work just fine at this stage. -CLISP is finicky regarding the problems that we have with CFFI -conversation. In particular that we can not really do typing that we -need to take care of. I think this is my problem, not someone -elses. + CLISP is finicky regarding the problems that we have with CFFI + conversation. In particular that we can not really do typing that + we need to take care of. I think this is my problem, not someone + elses. -Need to test ECL. Clozure-CL seems to work. + Need to test ECL. Clozure-CL seems to work. -=========== + =========== -See Doc/README* for history and design considerations -See Doc/INSTALL for getting this to work and run + See Doc/README* for history and design considerations + See Doc/INSTALL for getting this to work and run -=========== + =========== -Working on this with git: + Working on this with git: - git clone git://repo.or.cz/CommonLispStat.git - cd CommonLispStat - git submodules init - git submodules update +#+begin_src shell + git clone git://repo.or.cz/CommonLispStat.git + cd CommonLispStat + git submodules init + git submodules update +#+end_src -will pull the whole repository, and create a "master" branch to work -on. If you are making edits, Probably, you don't want to use the -master branch, but more to use a topic-centric branch, so you might: + will pull the whole repository, and create a "master" branch to + work on. If you are making edits, Probably, you don't want to use + the master branch, but more to use a topic-centric branch, so you + might: +#+begin_src shell git checkout -b myTopicBranch +#+end_src and then work on myTopicBranch, pulling back to the master branch when needed by +#+begin_src shell git checkout master git pull . myTopicBranch +#+end_src (or +#+begin_src shell git rebase myTopicBranch +#+end_src ) of course, perhaps you want to contribute to the mob branch. For that, after cloning the repository as above, you would: +#+begin_src shell git checkout -b mob remotes/origin/mob +#+end_src (work, work, work... through a cycle of +#+begin_src shell git add git commit -m "what I just did" +#+end_src ad-nauseum. When ready to commit, then just: +#+begin_src shell git push git+ssh://mob@repo.or.cz/srv/git/CommonLispStat.git mob:mob +#+end_src ) @@ -130,9 +149,11 @@ branch before uploading. Will work on a formal example soon. (the basic principle is that instead of the edit cycle on mob, do something like: +#+begin_src shell git checkout mob git pull . myTopicBranch git push git+ssh://mob@repo.or.cz/srv/git/CommonLispStat.git mob:mob +#+end_src ) @@ -162,3 +183,13 @@ we could have used SEXPs as well. This is currently done by using an =========== + + +* Footnotes + +[fn:1] I´m not including instructions for Emacs or git, as the former +is dealt with other places and the latter was required for you to get +this. Since disk space is cheap, I´m intentionally forcing git to be +part of this system. Sorry if you hate it. Org-mode, org-babel, and +org-babel-lisp, and hypo are useful for making this file a literate +and interactively executable piece of work. diff --git a/TODO.lisp b/TODO.lisp index c04634f..dbf6ada 100644 --- a/TODO.lisp +++ b/TODO.lisp @@ -1,6 +1,6 @@ ;;; -*- mode: lisp -*- -;;; Time-stamp: <2010-03-19 08:17:46 tony> +;;; Time-stamp: <2010-06-15 09:59:40 tony> ;;; Creation: <2008-09-08 08:06:30 tony> ;;; File: TODO.lisp ;;; Author: AJ Rossini @@ -24,10 +24,13 @@ ;; core system ;;(asdf:oos 'asdf:load-op 'lisp-matrix) ;;(asdf:oos 'asdf:compile-op 'cls :force t) - (asdf:oos 'asdf:load-op 'cls) + (asdf:oos 'asdf:load-op :cls) ;; visualization - (asdf:oos 'asdf:load-op 'cl-cairo2-x11) + ;; (asdf:oos 'asdf:load-op 'cl-cairo2-x11) + ;; (asdf:oos 'asdf:compile-op 'iterate :force t) + (asdf:oos 'asdf:load-op 'iterate) + ;; (asdf:oos 'asdf:compile-op :cl-2d :force t) (asdf:oos 'asdf:load-op 'cl-2d) ;; doc reporting @@ -35,7 +38,7 @@ (asdf:oos 'asdf:load-op 'cl-typesetting)) ;;INFRA - ;; (asdf:oos 'asdf:compile-op 'asdf-system-connections :force t) + ;; (asdf:oos 'asdf:compile-op 'asdf-system-connections :force t) ;; (asdf:oos 'asdf:compile-op 'lisp-matrix) ;; (asdf:oos 'asdf:load-op 'xarray) @@ -129,16 +132,25 @@ (check-var *df-test* 0) -(check-type (xref *df-test* 1 1) simple-character-string) +(class-of + (xref *df-test* 1 1)) + +(check-type (xref *df-test* 1 1) + string) ;; => nil, so good. +(check-type (xref *df-test* 1 1) + vector) ;; => nil, so good. +(check-type (xref *df-test* 1 1) + real) ;; => simple-error type thrown, so good. + +;; How to nest errors within errors? +(check-type (check-type (xref *df-test* 1 1) real) ;; => error thrown, so good. + simple-error) (xref *df-test* 1 2) -(class-of - (xref *df-test* 1 1) ) (check-type) - (integerp (xref *df-test* 1 2)) (floatp (xref *df-test* 1 2)) (integerp (xref *df-test* 1 3)) @@ -146,11 +158,9 @@ (floatp (xref *df-test* 1 3)) (type-of (vector 1 1d0)) +(type-of *df-test*) - -(loop ) - (xref *df-test* 2 1) (xref *df-test* 0 0) (xref *df-test* 1 0) @@ -333,4 +343,17 @@ where ;; difference between empirical, fisherian, and ...? information. -;;; Docudown... \ No newline at end of file +;;; Docudown... + +;;; CL-genomic +(asdf:oos 'asdf:compile-op :ironclad) + +(in-package :cl-user) +(asdf:oos 'asdf:load-op :cl-genomic) + +(in-package :bio-sequence) +(make-dna "agccg") ;; fine +(make-aa "agccg") ;; fine +(make-aa "agc9zz") ;; error + + diff --git a/examples/00-loadingData.lisp b/examples/00-loadingData.lisp index 809701e..f095521 100644 --- a/examples/00-loadingData.lisp +++ b/examples/00-loadingData.lisp @@ -1,6 +1,6 @@ ;;; -*- mode: lisp -*- -;;; Time-stamp: <2010-02-10 14:07:45 tony> +;;; Time-stamp: <2010-06-07 13:55:13 tony> ;;; Creation: <2009-03-12 17:14:56 tony> ;;; File: template.lisp ;;; Author: AJ Rossini @@ -39,8 +39,10 @@ ;; we'll be loading from directories in the CLS homedir, so we want to ;; make it easier to reach. (defun localized-pathto (x) - "return a string denoting the complete path. -FIXME: UNIX-centric (though might work on Mac OSX). Might want to + "Given a string representing a relative path from the CLS home +directory, return a string denoting the complete path. + +FIXME: UNIX-centric (though might work on Mac OSX). We really want to return a pathspec, not a string/namespec" (check-type x string) (concatenate 'string *cls-home-dir* x)) @@ -55,6 +57,8 @@ return a pathspec, not a string/namespec" ;; of packages.lisp, as it holds the overall defsystem structure. (load-data "iris.lsp") ;; (the above partially fixed). diabetes + ;; FIXME above: Diabetes unbound, but it shouldn't be. I think + ;; we need to eliminate LispStat v1. (variables)) (progn diff --git a/examples/01-basicEDA.lisp b/examples/01-basicEDA.lisp index bdebf0f..96a276f 100644 --- a/examples/01-basicEDA.lisp +++ b/examples/01-basicEDA.lisp @@ -1,6 +1,6 @@ ;;; -*- mode: lisp -*- -;;; Time-stamp: <2010-03-03 16:22:26 tony> +;;; Time-stamp: <2010-06-07 09:29:46 tony> ;;; Creation: <2009-04-19 09:41:09 tony> ;;; File: basic-eda.lisp ;;; Author: AJ Rossini @@ -17,7 +17,7 @@ ;; We assume that the "loading-data.lisp" code has been run, and one ;; now wants to analyze the data loaded into *chickwts-df* -(load (localized-pathto "loading-data.lisp") +(load (localized-pathto "examples/00-loadingData.lisp") :verbose t) *chickwts-df* @@ -38,7 +38,10 @@ ;; random, biased, convenience sampling; ;; #2 purpose of dataset integration/manipulation ;; #3 sampling/temporal component of variables -;; + + +;; Create metadata variable graph which provides an initial analysis +;; structure for recording results. (defparameter *chkwt-df-depgraph* (let ((g (make-container 'graph-container ))) -- 2.11.4.GIT