(def testify (x) - (if (isa x 'fn) x [is _ x])) + (if (isa x 'fn) x [iso _ x]))
Allow lists to be used as the first argument to Arc's list sequence functions.
arc2 | patch | |||
---|---|---|---|---|
(rem '(c d) '((a b) (c d) (e f))) | ⇒ | ((a b) (c d) (e f)) | ((a b) (e f)) | |
(pos '(4 5) '(1 2 3 (4 5) 6)) | nil | 3 |
By using git or patch, you can incorporate this patch into your version of Arc.
$ git pull git://github.com/CatDancer/arc.git tag arc2.testify-iso0
For example,
$ mkdir arc $ cd arc $ git init $ git pull git://github.com/CatDancer/arc.git tag arc2.testify-iso0
To apply this patch to your copy of arc using the patch command, download arc2.testify-iso0.patch into your Arc directory, and at the Unix command line inside the Arc directory, type:
patch <arc2.testify-iso0.patch
“patch
” is a standard utility that comes with Unix. (If you’re running Windows, iirc patch
comes with cygwin).
For example,
$ wget http://ycombinator.com/arc/arc2.tar [... downloading ...] $ tar xf arc2.tar $ cd arc2 $ patch <arc2.testify-iso0.patch patching [...] $